use axum::{debug_handler, Extension, Json}; use crate::{ api::{ backend::ApiBackend, description::API_KEY_TAG, routes::api_keys::{models::ApiKey, sql}, }, errors::ApiError, }; #[debug_handler] #[utoipa::path( get, path = "/apikeys", summary = "Get all API Keys", description = "Get a list of all configured API Keys.", responses( (status = OK, body = Vec, description = "List of API Keys"), ), security( ("user_auth" = ["read:apikeys",]), ), tag = API_KEY_TAG)] pub async fn get_api_keys( Extension(backend): Extension, ) -> Result>, ApiError> { Ok(Json(sql::get_api_keys(backend.pool()).await?)) }