Initial commit: API gateway with admin console
- FastAPI async gateway with httpx proxying to multiple upstreams - SQLite database with SQLAlchemy ORM - Admin console: manage services, users, API keys, endpoint access - Per-key, per-endpoint granular access control - OpenAPI document sync and caching (5-minute TTL) - Request/response logging with full transaction inspection - In-memory rate limiting (per-key, fixed-window) - Tiered log retention (7d payloads, 90d rows, incremental vacuum) - TLS verification toggle per service (for self-signed certificates) - Service connectivity validation with automatic endpoint refresh - Request browser with filters and deep-link inspection - Docker setup with persistent volume - Modal forms for create/edit flows Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
DATABASE_URL = os.environ.get("GATEWAY_DATABASE_URL", f"sqlite:///{BASE_DIR / 'gateway.db'}")
|
||||
SECRET_KEY = os.environ.get("GATEWAY_SECRET_KEY", "dev-secret-change-me")
|
||||
SESSION_COOKIE = "gw_session"
|
||||
SESSION_MAX_AGE = 60 * 60 * 8 # 8 hours
|
||||
|
||||
# Default admin credentials seeded on first startup (change after first login)
|
||||
DEFAULT_ADMIN_USERNAME = os.environ.get("GATEWAY_ADMIN_USER", "admin")
|
||||
DEFAULT_ADMIN_PASSWORD = os.environ.get("GATEWAY_ADMIN_PASSWORD", "admin")
|
||||
|
||||
PROXY_DEFAULT_TIMEOUT = 30.0
|
||||
API_KEY_HEADER = "X-API-Key"
|
||||
|
||||
# Retention (0 = keep forever). Payloads are blanked after the first window;
|
||||
# whole log rows are deleted after the second.
|
||||
PAYLOAD_RETENTION_DAYS = int(os.environ.get("GATEWAY_PAYLOAD_RETENTION_DAYS", "7"))
|
||||
LOG_RETENTION_DAYS = int(os.environ.get("GATEWAY_LOG_RETENTION_DAYS", "90"))
|
||||
Reference in New Issue
Block a user