implement list api keys

This commit is contained in:
mpostma 2021-02-16 15:28:19 +01:00
parent 4d9819f6ef
commit bead4075d8
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -18,5 +18,9 @@ struct KeysResponse {
#[get("/keys", wrap = "Authentication::Admin")] #[get("/keys", wrap = "Authentication::Admin")]
async fn list(_data: web::Data<Data>) -> HttpResponse { async fn list(_data: web::Data<Data>) -> HttpResponse {
todo!() let api_keys = data.api_keys.clone();
HttpResponse::Ok().json(KeysResponse {
private: api_keys.private,
public: api_keys.public,
})
} }