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

Axum migration: /oauth2/userinfo & UserAuthorization util

This commit is contained in:
Quentin Gliech
2022-03-30 16:21:45 +02:00
parent 64900ef1d9
commit 9dad21475e
8 changed files with 424 additions and 96 deletions

View File

@@ -24,7 +24,7 @@ use std::sync::Arc;
use axum::{
body::HttpBody,
extract::Extension,
routing::{get, post},
routing::{get, on, post, MethodFilter},
Router,
};
use mas_axum_utils::UrlBuilder;
@@ -83,6 +83,13 @@ where
get(self::oauth2::discovery::get),
)
.route("/oauth2/keys.json", get(self::oauth2::keys::get))
.route(
"/oauth2/userinfo",
on(
MethodFilter::POST | MethodFilter::GET,
self::oauth2::userinfo::get,
),
)
.fallback(mas_static_files::Assets)
.layer(Extension(pool.clone()))
.layer(Extension(templates.clone()))