1
0
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:
Quentin Gliech
2023-08-30 18:36:53 +02:00
parent 7fcd022eea
commit 23571e87ea
14 changed files with 207 additions and 41 deletions

26
policies/email_test.rego Normal file
View 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"]
}