How tusharanand767/auth_demo_library works
Auth_Demo_Library is a demonstration library for authentication and authorization mechanisms, exposed through both a FastAPI server and a command-line demo runner. The CLI exercises JWT, password hashing, OAuth PKCE, MFA, RBAC, rate limiting, sessions, and API keys; the HTTP routes expose corresponding workflows for most features. Several services persist state through SQLite, while JWT, rate limiting, and session behavior use centralized configuration. The README provides no further capability details; edges for unsampled modules are limited to relationships shown in the source index.
Main entry points: main.py CLI demo runner · server.py FastAPI server · oauth/service.py OAuth PKCE · sessions/service.py Session management
Components 23
Entry points
- CLI demo runner
main.py - FastAPI server
server.py - Dashboard
dashboard.py
Identity workflows
- JWT routes
src/jwt/routes.py - JWT tokens
src/jwt/service.py - Password hashing
src/password/service.py - OAuth routes
src/oauth/routes.py - OAuth PKCE
src/oauth/service.py - MFA routes
src/mfa/routes.py - MFA verification
src/mfa/service.py - Session routes
src/sessions/routes.py - Session management
src/sessions/service.py
Access controls
- API key routes
src/api_keys/routes.py - API key management
src/api_keys/service.py - RBAC routes
src/rbac/routes.py - Permission engine
src/rbac/service.py - Rate-limit routes
src/rate_limiting/routes.py - Rate limiting
src/rate_limiting/service.py - Auth middleware
middleware/auth_middleware.py
Shared services
- Auth configuration
config/auth_config.py - SQLite database
db.py
Other components
- Demo operator
- HTTP client
Connections 33
- Demo operator → CLI demo runner: runs demo
- HTTP client → FastAPI server: sends requests
- FastAPI server → Auth middleware: uses middleware
server.py - FastAPI server → JWT routes: registers routes
server.py - FastAPI server → OAuth routes: registers routes
server.py - FastAPI server → MFA routes: registers routes
server.py - FastAPI server → RBAC routes: registers routes
server.py - FastAPI server → Rate-limit routes: registers routes
server.py - FastAPI server → Session routes: registers routes
server.py - FastAPI server → API key routes: registers routes
server.py - CLI demo runner → JWT tokens: exercises tokens
main.py - CLI demo runner → Password hashing: exercises hashing
main.py - CLI demo runner → OAuth PKCE: exercises PKCE
main.py - CLI demo runner → MFA verification: exercises MFA
main.py - CLI demo runner → Permission engine: checks permissions
main.py - CLI demo runner → Rate limiting: checks limits
main.py - CLI demo runner → Session management: manages sessions
main.py - CLI demo runner → API key management: manages keys
main.py - JWT routes → JWT tokens: delegates to
src/jwt/routes.py - OAuth routes → OAuth PKCE: delegates to
src/oauth/routes.py - MFA routes → MFA verification: delegates to
src/mfa/routes.py - Session routes → Session management: delegates to
src/sessions/routes.py - API key routes → API key management: delegates to
src/api_keys/routes.py - RBAC routes → Permission engine: delegates to
src/rbac/routes.py - Auth middleware → Rate limiting: checks limits
middleware/auth_middleware.py - JWT tokens → Auth configuration: reads settings
src/jwt/service.py - OAuth PKCE → Auth configuration: reads settings
src/oauth/service.py - Session management → Auth configuration: reads settings
src/sessions/service.py - Rate limiting → Auth configuration: reads settings
src/rate_limiting/service.py - MFA verification → SQLite database: reads and writes
src/mfa/service.py - OAuth PKCE → SQLite database: reads and writes
src/oauth/service.py - Session management → SQLite database: reads and writes
src/sessions/service.py - API key management → SQLite database: reads and writes
src/api_keys/service.py