mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2025-03-12 16:11:43 +01:00
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
26 lines
528 B
Rust
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");
|