{"repo":"emirror-de/axum-gate","free":true,"listed":false,"github":"https://github.com/emirror-de/axum-gate","clone":"git clone https://github.com/emirror-de/axum-gate.git","description":"Flexible authentication and authorization for Axum with JWT cookies or bearer tokens, optional OAuth2, and role/group/permission RBAC. Suitable for single-node and distributed systems.","language":"Rust","stars":106,"topics":["auth","axum","axum-middleware","role-based-access-control","bearer","cookie","distributed-systems","oauth2"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"axum-gate Flexible, type-safe authentication and authorization for Axum using JWTs and optional OAuth2. - Cookie and bearer authentication - OAuth2 Authorization Code + PKCE flow that issues first-party JWT cookies - Hierarchical roles, groups, and string-based permissions - Ready-to-use login/logout handlers - Optional anonymous user context and static-token mode for internal services - In-memory and optional database-backed repositories - Feature-gated audit logging and Prometheus metrics Install This crate re-exports jsonwebtoken, cookie, uuid, axum extra (and optionally prometheus) because those types appear in the public API, and it provides a convenience prelude via axum gate::prelude:: . Optional features: - storage-surrealdb — SurrealDB repositories - storage-seaorm — SeaORM repositories - audit-logging — structured audit events - prometheus — metrics for audit (implies audit-logging) - insecure-fast-hash — faster Argon2 preset for development only Core concepts - Gate layer - Gate::cookie(\"issuer\", codec): JWT via HTTP-only cookies (web apps) - Gate::bearer(\"issuer\", codec): JWT via Authorization: Bearer header (APIs) - Gate::bearer(...).with static token(\"...\"): shared-secret mode (internal services) - Gate::oauth2:: (): OAuth2 Authorization Code + PKCE flow builder; or use Gate::oauth2 with jwt(\"issuer\", codec, ttl secs) to also mint first-party JWT cookies - allow anonymous with optional user(): never block; inserts optional user context - require login(): allow b","default_branch":null,"files":null,"tree":[],"storefront":"/r/emirror-de","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/emirror-de/axum-gate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}