How flaviocavalcantet/vaultgate works
VaultGate is a self-hosted organizational file vault. Users authenticate through an identity provider and use the API to register files, obtain transfer intents, manage folders and shares, and apply access policies; file bytes flow through a separate streaming gateway for encryption and object storage. Uploaded files are scanned asynchronously, with verdicts reported to the API, while security actions are recorded in an append-only audit log. The README documents the service-level flow; source excerpts and the index support the shown internal links, but not every unsampled subsystem’s wiring.
Main entry points: app.py Streaming gateway · main.py FastAPI control plane · files.py File routes · worker.go Scan worker
Components 23
Control plane
- FastAPI control plane
api/src/vaultgate_api/main.py - File routes
api/src/vaultgate_api/routers/files.py - Share routes
api/src/vaultgate_api/routers/shares.py - Folder management
api/src/vaultgate_api/folders.py - Access policies
api/src/vaultgate_api/policies.py - Metadata models
api/src/vaultgate_api/models.py - PostgreSQL
api/src/vaultgate_api/db.py - Internal scan reporting
api/src/vaultgate_api/scans.py
Encrypted transfers
- Streaming gateway
gateway/src/vaultgate_gateway/app.py - Stream encryption
gateway/src/vaultgate_gateway/crypto.py - Object storage access
gateway/src/vaultgate_gateway/storage.py - S3
- Data key handling
gateway/src/vaultgate_gateway/keys.py - AWS KMS
PII scanning
- Scan worker
scanner/internal/worker/worker.go - Extraction and scanning
scanner/internal/scan/scan.go - Document extraction
scanner/internal/extract/extract.go - PII detectors
scanner/internal/detect/detect.go - SQS scan queue
Identity and audit
- OIDC token validation
api/src/vaultgate_api/auth.py - Identity provider
- Append-only audit
api/src/vaultgate_api/audit.py
Other components
- User / browser
Connections 27
- User / browser → FastAPI control plane: calls JSON API
- User / browser → Identity provider: signs in
- FastAPI control plane → OIDC token validation: validates requests
api/src/vaultgate_api/main.py - OIDC token validation → Identity provider: fetches signing keys
api/src/vaultgate_api/auth.py - FastAPI control plane → File routes: mounts routes
api/src/vaultgate_api/main.py - FastAPI control plane → Share routes: mounts routes
api/src/vaultgate_api/main.py - File routes → Folder management: uses folder checks
api/src/vaultgate_api/routers/files.py - File routes → Metadata models: reads and writes
api/src/vaultgate_api/routers/files.py - Share routes → Metadata models: reads and writes
api/src/vaultgate_api/routers/shares.py - Access policies → Metadata models: evaluates against
- FastAPI control plane → PostgreSQL: serves metadata
- User / browser → Streaming gateway: streams file bytes
- Streaming gateway → FastAPI control plane: validates upload intent
- Streaming gateway → Stream encryption: encrypts chunks
gateway/src/vaultgate_gateway/app.py - Streaming gateway → Object storage access: writes and reads objects
gateway/src/vaultgate_gateway/app.py - Object storage access → S3: stores ciphertext
- Streaming gateway → Data key handling: generates data key
gateway/src/vaultgate_gateway/app.py - Data key handling → AWS KMS: wraps data key
- Streaming gateway → SQS scan queue: publishes upload event
- SQS scan queue → Scan worker: provides scan requests
- Scan worker → Object storage access: reads encrypted objects
- Scan worker → Extraction and scanning: scans file content
scanner/internal/worker/worker.go - Extraction and scanning → Document extraction: extracts text
scanner/internal/scan/scan.go - Extraction and scanning → PII detectors: detects PII
scanner/internal/scan/scan.go - Scan worker → Internal scan reporting: reports verdict
- File routes → Append-only audit: records actions
api/src/vaultgate_api/routers/files.py - Share routes → Append-only audit: records share events
api/src/vaultgate_api/routers/shares.py