How iyed523/securevault works
SecureVault is a personal secrets-vault REST API. Its documented user workflow is registration or login, authenticated secret management with owner-only access, and revocable sessions maintained through refresh-token rotation; secret contents are encrypted while titles remain searchable in clear text. The graph includes authentication, rate limiting, persistence, readiness, and request observability. The supplied tree and excerpts do not include the documented secret CRUD/encryption implementation, so that capability is represented at the application level without inventing source modules or internal call paths.
Main entry points: auth.py Auth endpoints · login.py Login flow · refresh.py Refresh and replay control · users.py User repository
Components 28
HTTP API
- FastAPI application
app/main.py - API router
app/api/router.py - Auth endpoints
app/api/routes/auth.py - Health endpoint
app/api/routes/health.py - Readiness endpoint
app/api/routes/ready.py - Auth and user contracts
app/schemas/auth.py
Identity and security
- Registration and login
app/services/registration.py - Login flow
app/services/login.py - Refresh and replay control
app/services/refresh.py - Session logout
app/services/logout.py - Request authentication
app/api/dependencies.py - JWT access tokens
app/security/tokens.py - Refresh-token primitives
app/security/refresh_tokens.py - Rate limiting
app/security/rate_limit.py
Persistence
- User repository
app/repositories/users.py - Session repository
app/repositories/sessions.py - Refresh-token repository
app/repositories/refresh_tokens.py - User and session models
app/models/session.py - Database sessions
app/db/session.py - PostgreSQL
Runtime infrastructure
- Redis pool
app/infrastructure/redis.py - Dependency readiness
app/infrastructure/readiness.py - Request middleware
app/api/middleware.py - Structured logging
app/core/logging.py - Runtime configuration
app/core/config.py
Secret vault
Other components
- API client
- Redis service
Connections 43
- API client → FastAPI application: sends requests
- FastAPI application → API router: mounts routes
app/main.py - API router → Auth endpoints: dispatches auth
app/api/router.py - API router → Health endpoint: dispatches health
app/api/router.py - API router → Readiness endpoint: dispatches readiness
app/api/router.py - Auth endpoints → Auth and user contracts: validates and responds
app/api/routes/auth.py - Auth endpoints → Registration and login: registers users
app/api/routes/auth.py - Auth endpoints → Login flow: authenticates users
app/api/routes/auth.py - Auth endpoints → Refresh and replay control: rotates tokens
app/api/routes/auth.py - Auth endpoints → Session logout: revokes sessions
app/api/routes/auth.py - Auth endpoints → Rate limiting: enforces quotas
app/api/routes/auth.py - Auth endpoints → Database sessions: requests database session
app/api/routes/auth.py - Registration and login → User repository: stores users
app/services/registration.py - Login flow → User repository: looks up users
app/services/login.py - Login flow → Session repository: creates sessions
app/services/login.py - Login flow → Refresh-token repository: stores refresh tokens
app/services/login.py - Login flow → JWT access tokens: creates access tokens
app/services/login.py - Login flow → Refresh-token primitives: creates refresh tokens
app/services/login.py - Refresh and replay control → Refresh-token repository: checks and rotates
app/services/refresh.py - Refresh and replay control → Session repository: locks session
app/services/refresh.py - Refresh and replay control → User repository: checks account
app/services/refresh.py - Refresh and replay control → JWT access tokens: creates access tokens
app/services/refresh.py - Refresh and replay control → Refresh-token primitives: hashes tokens
app/services/refresh.py - Session logout → Refresh-token repository: revokes tokens
app/services/logout.py - Session logout → Session repository: revokes session
app/services/logout.py - Request authentication → JWT access tokens: decodes access tokens
app/api/dependencies.py - Request authentication → Session repository: checks session
- Request authentication → User repository: checks user
- User repository → User and session models: queries user model
app/repositories/users.py - Session repository → User and session models: queries session model
app/repositories/sessions.py - Refresh-token repository → User and session models: queries token model
app/repositories/refresh_tokens.py - Database sessions → Runtime configuration: uses database URL
app/db/session.py - Database sessions → PostgreSQL: opens database sessions
- Rate limiting → Redis pool: uses limiter pool
app/api/rate_limit.py - Redis pool → Redis service: connects to
- Readiness endpoint → Database sessions: checks database
app/api/routes/ready.py - Readiness endpoint → Redis pool: checks Redis
app/api/routes/ready.py - FastAPI application → Request middleware: installs middleware
app/main.py - Request middleware → Structured logging: emits request logs
app/api/middleware.py - Request middleware → Runtime configuration: uses settings
- API client → Encrypted secret CRUD: manages owned secrets
- Encrypted secret CRUD → PostgreSQL: stores encrypted content
- Encrypted secret CRUD → Runtime configuration: uses encryption keyring
app/main.py