impl MSC2964: OIDC token flow

# Conflicts:
#	Cargo.lock
This commit is contained in:
lafleur 2025-04-16 15:12:00 +02:00 committed by nexy7574
commit 5ab7b61129
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F
11 changed files with 553 additions and 1 deletions

View file

@ -118,9 +118,18 @@ pub fn build(router: Router<State>, server: &Server) -> Router<State> {
.ruma_route(&client::get_protocols_route)
.route("/_matrix/client/unstable/thirdparty/protocols",
get(client::get_protocols_route_unstable))
// MSC2965 is still not stabilized. See https://github.com/sandhose/matrix-spec-proposals/blob/msc/sandhose/oidc-discovery/proposals/2965-auth-metadata.md#unstable-prefix
// MSC2965 route.
.route("/_matrix/client/unstable/org.matrix.msc2965/auth_metadata",
get(client::get_auth_metadata))
// MSC2964 routes.
.route("/_matrix/client/unstable/org.matrix.msc2964/authorize",
get(client::authorize))
.route("/_matrix/client/unstable/org.matrix.msc2964/authorize",
post(client::authorize_consent))
.route("/_matrix/client/unstable/org.matrix.msc2964/login",
post(client::oidc_login))
.route("/_matrix/client/unstable/org.matrix.msc2964/token",
post(client::token))
.ruma_route(&client::send_message_event_route)
.ruma_route(&client::send_state_event_for_key_route)
.ruma_route(&client::get_state_events_route)