You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Run the registration policy on upstream OAuth registration
This commit is contained in:
26
policies/email_test.rego
Normal file
26
policies/email_test.rego
Normal file
@ -0,0 +1,26 @@
|
||||
package email
|
||||
|
||||
test_allow_all_domains {
|
||||
allow with input.email as "hello@staging.element.io"
|
||||
}
|
||||
|
||||
test_allowed_domain {
|
||||
allow with input.email as "hello@staging.element.io"
|
||||
with data.allowed_domains as ["*.element.io"]
|
||||
}
|
||||
|
||||
test_not_allowed_domain {
|
||||
not allow with input.email as "hello@staging.element.io"
|
||||
with data.allowed_domains as ["example.com"]
|
||||
}
|
||||
|
||||
test_banned_domain {
|
||||
not allow with input.email as "hello@staging.element.io"
|
||||
with data.banned_domains as ["*.element.io"]
|
||||
}
|
||||
|
||||
test_banned_subdomain {
|
||||
not allow with input.email as "hello@staging.element.io"
|
||||
with data.allowed_domains as ["*.element.io"]
|
||||
with data.banned_domains as ["staging.element.io"]
|
||||
}
|
Reference in New Issue
Block a user