rust-axum.apis-mod.mustache Maven / Gradle / Ivy
{{#apiInfo}}
{{#apis}}
pub mod {{classFilename}};
{{/apis}}
{{/apiInfo}}
{{#authMethods}}
{{#isApiKey}}
{{#isKeyInCookie}}
/// Cookie Authentication.
#[async_trait::async_trait]
pub trait CookieAuthentication {
type Claims;
/// Extracting Claims from Cookie. Return None if the Claims is invalid.
async fn extract_claims_from_cookie(&self, cookies: &axum_extra::extract::CookieJar, key: &str) -> Option;
}
{{/isKeyInCookie}}
{{#isKeyInHeader}}
/// API Key Authentication - Header.
#[async_trait::async_trait]
pub trait ApiKeyAuthHeader {
type Claims;
/// Extracting Claims from Header. Return None if the Claims is invalid.
async fn extract_claims_from_header(&self, headers: &axum::http::header::HeaderMap, key: &str) -> Option;
}
{{/isKeyInHeader}}
{{/isApiKey}}
{{/authMethods}}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy