moonbitstack/moonapi/security does not have a README file
pub struct DigestAuth {
realm : String
verify : (String) -> Bool
}pub struct OAuth2CodeBearer {
authorization_url : String
token_url : String
refresh_url : String
secret : String
}fn OAuth2CodeBearer::new(authorization_url : String, token_url : String, secret : String, refresh_url? : String) -> OAuth2CodeBearerfn OAuth2CodeBearer::scheme(self : OAuth2CodeBearer, scopes? : Array[(String, String)]) -> SecuritySchemepub(all) struct OAuth2PasswordBearer {
token_url : String
secret : String
}fn OAuth2PasswordBearer::authenticate(self : OAuth2PasswordBearer, ctx : Context, now_secs : Int64, scopes? : Array[String]) -> Result[AuthenticatedUser, Response]fn OAuth2PasswordBearer::scheme(self : OAuth2PasswordBearer, scopes? : Array[(String, String)]) -> SecuritySchemepub(all) enum SecurityScheme {
OAuth2Password(token_url~ : String, scopes~ : Array[(String, String)])
OAuth2Code(authorization_url~ : String, token_url~ : String, refresh_url~ : String, scopes~ : Array[(String, String)])
HttpBearer(bearer_format~ : String)
ApiKeyHeader(name~ : String)
ApiKeyQuery(name~ : String)
ApiKeyCookie(name~ : String)
HttpBasic
HttpDigest
OpenIdConnect(url~ : String)
}fn verify_bearer(ctx : Context, secret : String, scopes : SecurityScopes, now : Int64, auto_error : Bool) -> Result[AuthenticatedUser, Response]Install
Download zipmoonapi — a typed web framework for MoonBit (\u2190 FastAPI): routing, typed extractors, descriptor-driven validation, multi-version OpenAPI/Swagger (2.0 / 3.0 / 3.1) with security schemes, dependency injection, OAuth2 password-bearer with scopes, per-operation security enforcement, multipart and urlencoded form extractors, response_model filtering, background tasks, sub-application mounting, a CORS/gzip/exception-handler middleware stack with per-status handlers, Server-Sent Events, and WebSocket routes, on the moonasgi SEAM.
Dependencies