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]