bffh/bffhd/rest/authentication.rs
Andreas Bergmeier 8c6a1376d0 Add initial authentication OpenAPI
Currently only contains basic auth definitions to keep it simple stupid.
Mostly just following https://swagger.io/docs/specification/v3_0/authentication/basic-authentication/

Document can be printed via new command: openapi print
2025-01-19 18:35:38 +01:00

26 lines
528 B
Rust

use utoipa::{self};
#[derive(utoipa::ToSchema)]
pub struct AuthenticationMethod(String);
pub mod responses {
#[derive(utoipa::ToResponse)]
pub struct Unauthorized {
pub www_authenticate: Option<String>,
}
}
#[derive(utoipa::OpenApi)]
#[openapi(
info(description = "FabAccess Auth API"),
modifiers(&SecurityAddon),
components(schemas(AuthenticationMethod), responses(responses::Unauthorized)),
security(
("basicAuth" = []),
),
)]
pub struct ApiDoc;
include!("./security.rs");