1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Move from MSC3824 actions to org.matrix.msc3824.delegated_oidc_compatibility flag (#250)

Co-authored-by: Quentin Gliech <quenting@element.io>
This commit is contained in:
Hugh Nimmo-Smith
2022-06-15 16:49:03 +01:00
committed by GitHub
parent 5632f6ba99
commit 9e3f43f1f0
2 changed files with 10 additions and 20 deletions

View File

@ -33,18 +33,11 @@ use thiserror::Error;
use super::MatrixError;
#[derive(Debug, Serialize)]
#[serde(rename_all = "lowercase")]
enum Action {
Login,
Register,
}
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
enum LoginType {
#[serde(rename = "m.login.password")]
Password { actions: Vec<Action> },
Password,
// we will leave MSC3824 `actions` as undefined for this auth type as unclear
// how it should be interpreted
@ -55,7 +48,7 @@ enum LoginType {
Sso {
#[serde(skip_serializing_if = "Vec::is_empty")]
identity_providers: Vec<SsoIdentityProvider>,
actions: Vec<Action>,
delegated_oidc_compatibility: bool,
},
}
@ -73,12 +66,10 @@ struct LoginTypes {
pub(crate) async fn get() -> impl IntoResponse {
let res = LoginTypes {
flows: vec![
LoginType::Password {
actions: vec![Action::Login],
},
LoginType::Password,
LoginType::Sso {
identity_providers: vec![],
actions: vec![Action::Login, Action::Register],
delegated_oidc_compatibility: true,
},
LoginType::Token,
],