admin api: add compatibility from v1/ to v2/

This commit is contained in:
Alex Auvolat
2025-01-28 15:59:32 +01:00
parent af1a530834
commit 5037b97dd4
4 changed files with 118 additions and 71 deletions
+2 -4
View File
@@ -127,12 +127,10 @@ impl ApiHandler for AdminApiServer {
req: Request<IncomingBody>,
endpoint: Endpoint,
) -> Result<Response<ResBody>, Error> {
let auth_header = req.headers().get(AUTHORIZATION).clone();
let auth_header = req.headers().get(AUTHORIZATION).cloned();
let request = match endpoint {
Endpoint::Old(endpoint_v1) => {
todo!() // TODO: convert from old semantics, if possible
}
Endpoint::Old(endpoint_v1) => AdminApiRequest::from_v1(endpoint_v1, req).await?,
Endpoint::New(_) => AdminApiRequest::from_request(req).await?,
};