1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

policies: split the email & password policies and add jsonschema validation of the input

This commit is contained in:
Quentin Gliech
2023-08-30 15:01:37 +02:00
parent 6589f06d79
commit 23151ef092
25 changed files with 547 additions and 164 deletions

View File

@ -97,12 +97,18 @@ pub async fn policy_factory_from_config(
.await
.context("failed to open OPA WASM policy file")?;
let entrypoints = mas_policy::Entrypoints {
register: config.register_entrypoint.clone(),
client_registration: config.client_registration_entrypoint.clone(),
authorization_grant: config.authorization_grant_entrypoint.clone(),
email: config.email_entrypoint.clone(),
password: config.password_entrypoint.clone(),
};
PolicyFactory::load(
policy_file,
config.data.clone().unwrap_or_default(),
config.register_entrypoint.clone(),
config.client_registration_entrypoint.clone(),
config.authorization_grant_entrypoint.clone(),
entrypoints,
)
.await
.context("failed to load the policy")