1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-06 06:02:40 +03:00

config: allow serving the admin API routes

This commit is contained in:
Quentin Gliech
2024-07-24 15:43:37 +02:00
parent f4f61f0d51
commit 76755610cb
3 changed files with 22 additions and 0 deletions

View File

@@ -228,6 +228,10 @@ pub fn build_router(
mas_config::HttpResource::Compat => { mas_config::HttpResource::Compat => {
router.merge(mas_handlers::compat_router::<AppState>()) router.merge(mas_handlers::compat_router::<AppState>())
} }
mas_config::HttpResource::AdminApi => {
let (_, api_router) = mas_handlers::admin_api_router::<AppState>();
router.merge(api_router)
}
// TODO: do a better handler here // TODO: do a better handler here
mas_config::HttpResource::ConnectionInfo => router.route( mas_config::HttpResource::ConnectionInfo => router.route(
"/connection-info", "/connection-info",

View File

@@ -312,6 +312,9 @@ pub enum Resource {
path: Utf8PathBuf, path: Utf8PathBuf,
}, },
/// Admin API, served at `/api/admin/v1`
AdminApi,
/// Mount a "/connection-info" handler which helps debugging informations on /// Mount a "/connection-info" handler which helps debugging informations on
/// the upstream connection /// the upstream connection
#[serde(rename = "connection-info")] #[serde(rename = "connection-info")]

View File

@@ -788,6 +788,21 @@
} }
} }
}, },
{
"description": "Admin API, served at `/api/admin/v1`",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"enum": [
"adminapi"
]
}
}
},
{ {
"description": "Mount a \"/connection-info\" handler which helps debugging informations on the upstream connection", "description": "Mount a \"/connection-info\" handler which helps debugging informations on the upstream connection",
"type": "object", "type": "object",