How simplyy-shadin/secure-flask-auth-api works
This is a Flask identity and API-security service. The principal workflow is registration or password login, optional MFA challenge completion, server-side session creation, and access/refresh-token use; protected user and session operations enforce authorization and step-up freshness. MFA enrollment and recovery, security-event history, and defensive request handling are separate capabilities. The excerpts show key route and model behavior, but not every auth branch or route, so unsampled links are limited to README-documented relationships.
Main entry points: __init__.py Flask app · auth.py Auth and session routes · models.py Identity and event models · mfa_routes.py MFA routes
Components 15
API entry and policy
- Flask app
secure_api/__init__.py - Runtime config
config.py - JWT and request policy
secure_api/__init__.py - Flask extensions
secure_api/extensions.py
Identity and sessions
- Auth and session routes
secure_api/auth.py - Credential and abuse rules
secure_api/security.py - Session and token service
secure_api/session_service.py - User and authorization routes
secure_api/users.py
Multi-factor authentication
- MFA routes
secure_api/mfa_routes.py - MFA verification
secure_api/mfa.py
User and security data
- Security-event history
secure_api/security_events.py - Audit recording
secure_api/audit.py - Identity and event models
secure_api/models.py - Application database
Other components
- API client
Connections 26
- API client → Flask app: sends requests
readme.md - Flask app → Runtime config: loads settings
secure_api/__init__.py - Flask app → Auth and session routes: registers routes
secure_api/__init__.py - Flask app → MFA routes: registers routes
secure_api/__init__.py - Flask app → User and authorization routes: registers routes
secure_api/__init__.py - Flask app → Security-event history: registers routes
secure_api/__init__.py - Flask app → Flask extensions: initializes
secure_api/__init__.py - Flask app → JWT and request policy: configures handlers
secure_api/__init__.py - API client → Auth and session routes: registers and logs in
readme.md - Auth and session routes → Credential and abuse rules: validates credentials
secure_api/auth.py - Auth and session routes → Session and token service: issues sessions
readme.md - Auth and session routes → MFA verification: starts MFA challenge
secure_api/auth.py - API client → MFA routes: completes challenge
readme.md - MFA routes → MFA verification: verifies factors
secure_api/mfa_routes.py - MFA routes → Session and token service: creates session
readme.md - Auth and session routes → Audit recording: records auth events
secure_api/auth.py - MFA routes → Audit recording: records MFA events
secure_api/mfa_routes.py - User and authorization routes → Audit recording: records access events
secure_api/users.py - Security-event history → Identity and event models: reads event history
secure_api/security_events.py - Audit recording → Identity and event models: creates audit records
secure_api/audit.py - Auth and session routes → Identity and event models: reads and updates identity
secure_api/auth.py - User and authorization routes → Identity and event models: reads and updates users
secure_api/users.py - MFA routes → Identity and event models: reads and updates MFA state
secure_api/mfa_routes.py - Session and token service → Identity and event models: manages sessions
secure_api/session_service.py - Identity and event models → Flask extensions: uses ORM
secure_api/models.py - Flask extensions → Application database: connects ORM
secure_api/extensions.py