1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Authorization grant policy (#288)

Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
This commit is contained in:
Quentin Gliech
2022-07-21 11:18:59 -05:00
committed by GitHub
parent a263330ea5
commit ba6a382f2c
12 changed files with 319 additions and 21 deletions

View File

@@ -29,6 +29,10 @@ fn default_register_endpoint() -> String {
"register/violation".to_string()
}
fn default_authorization_grant_endpoint() -> String {
"authorization_grant/violation".to_string()
}
/// Application secrets
#[serde_as]
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
@@ -45,6 +49,10 @@ pub struct PolicyConfig {
#[serde(default = "default_register_endpoint")]
pub register_entrypoint: String,
/// Entrypoint to use when evaluating authorization grants
#[serde(default = "default_authorization_grant_endpoint")]
pub authorization_grant_entrypoint: String,
/// Arbitrary data to pass to the policy
#[serde(default)]
pub data: Option<serde_json::Value>,
@@ -56,6 +64,7 @@ impl Default for PolicyConfig {
wasm_module: None,
client_registration_entrypoint: default_client_registration_endpoint(),
register_entrypoint: default_register_endpoint(),
authorization_grant_entrypoint: default_authorization_grant_endpoint(),
data: None,
}
}