Skip to main content

Crate sz_orm_auth

Crate sz_orm_auth 

Source
Expand description

§SZ-ORM Auth — Authentication & Authorization

Provides JWT token signing/verification and RBAC-based permission control (Authorizer/RbacAuthorizer), covering user, credential, and role-permission models.

§Main Modules

  • auth — User, credential and other basic models
  • jwt — JSON Web Token signing and verification
  • authorizer — RBAC authorizer (with role hierarchy)
  • oauth2 — OAuth2 authorization code flow (RFC 6749)
  • mfa — Multi-factor authentication (TOTP, RFC 6238)
  • token_store — Refresh token storage (rotation + revocation + replay detection)

Re-exports§

pub use authorizer::Authorizer;
pub use authorizer::RbacAuthorizer;
pub use error::AuthError;
pub use mfa::MfaManager;
pub use mfa::MfaSecret;
pub use mfa::TotpVerifier;
pub use oauth2::AuthorizationCode;
pub use oauth2::AuthorizationRequest;
pub use oauth2::OAuth2Server;
pub use oauth2::TokenRequest;
pub use token_store::StoredToken;
pub use token_store::TokenFamilyError;
pub use token_store::TokenStore;
pub use auth::*;

Modules§

auth
authorizer
Role-Based Access Control (RBAC) authorizer.
error
jwt
Real JWT (HS256) implementation using RustCrypto audited crates.
mfa
多因素认证(MFA)框架
oauth2
OAuth2 授权码流程(Authorization Code Flow)
token_store
刷新令牌存储(Refresh Token Store)