Skip to content

All web configuration lives under the web key in application.yaml. The provider auto-injects the typed WebConfig — no manual loading needed.

Env prefix: QK_WEB__ | Nested delimiter: __

web:
enabled: true
env: development
server:
host: 0.0.0.0
port: 8000
workers: 1
reload: false
debug: false
openapi_title: "My API"
openapi_version: "1.0.0"
Terminal window
export QK_WEB__SERVER__HOST=0.0.0.0
export QK_WEB__SERVER__PORT=8080

KeyTypeDefaultEnv VarDescription
enabledboolTrueQK_WEB__ENABLEDEnable the web module
envstr | NoneNoneQK_WEB__ENVEnvironment name (development/staging/production)
openapi_titlestr"API"QK_WEB__OPENAPI_TITLEOpenAPI title
openapi_versionstr"1.0.0"QK_WEB__OPENAPI_VERSIONOpenAPI version
openapi_urlstr | None"/openapi.json"QK_WEB__OPENAPI_URLOpenAPI schema path
swagger_ui_urlstr | None"/docs"QK_WEB__SWAGGER_UI_URLSwagger UI path
redoc_urlstr | None"/redoc"QK_WEB__REDOC_URLReDoc path
compression_enabledboolTrueQK_WEB__COMPRESSION_ENABLEDEnable response compression
debug_routesboolFalseQK_WEB__DEBUG_ROUTESEnable /debug/* endpoints
debug_routes_tokenSecretStr | NoneNoneQK_WEB__DEBUG_ROUTES_TOKENToken for debug routes (X-Debug-Token header)
enable_authboolFalseQK_WEB__ENABLE_AUTHEnable built-in auth middleware
enable_identity_resolutionboolFalseQK_WEB__ENABLE_IDENTITY_RESOLUTIONResolve OAuth external IDs
max_body_sizeint | None10485760 (10 MiB)QK_WEB__MAX_BODY_SIZEMax request body size (None = disabled)
auth_exclude_pathslist[str]["/health", "/health/", "/docs", "/redoc", "/openapi.json"]QK_WEB__AUTH_EXCLUDE_PATHSPaths excluded from auth

When enable_auth is true, the local Web integration requires at least one resolved AuthenticatorProtocol whose authenticate method can be called with one positional request; otherwise startup raises ConfigurationError. Uninspectable signatures are rejected; wrap them in an inspectable method if necessary. This checks the call shape, not whether the implementation is secure or correctly returns an awaitable. An empty identity is treated as unauthenticated. Configured exclusion paths remain public. Direct use of AuthenticationMiddleware with an empty authenticator list still passes requests through. Older published Web releases may not enforce these local integration checks.


KeyTypeDefaultEnv VarDescription
hoststr"127.0.0.1"QK_WEB__SERVER__HOSTBind host
portint8000QK_WEB__SERVER__PORTBind port
workersint1QK_WEB__SERVER__WORKERSNumber of workers
reloadboolFalseQK_WEB__SERVER__RELOADEnable auto-reload
debugboolFalseQK_WEB__SERVER__DEBUGEnable debug mode

KeyTypeDefaultEnv VarDescription
enabledboolTrueQK_WEB__RATE_LIMIT__ENABLEDEnable rate limiting
default_limitint100QK_WEB__RATE_LIMIT__DEFAULT_LIMITMax requests per window
default_windowint60QK_WEB__RATE_LIMIT__DEFAULT_WINDOWWindow in seconds
whitelist_ipslist[str][]QK_WEB__RATE_LIMIT__WHITELIST_IPSExempt IPs
storage_backendstr"memory"QK_WEB__RATE_LIMIT__STORAGE_BACKENDBackend (memory/redis)

Per-path rules in rules:

web:
rate_limit:
rules:
"/api/auth/login":
requests: 10
window: 60
"/api/health":
requests: 1000
window: 60

KeyTypeDefaultEnv VarDescription
enabledboolFalseQK_WEB__STATIC__ENABLEDEnable static file serving
directorystr"static"QK_WEB__STATIC__DIRECTORYDirectory to serve
prefixstr"/static"QK_WEB__STATIC__PREFIXURL prefix
htmlboolFalseQK_WEB__STATIC__HTMLServe HTML (SPA mode)

KeyTypeDefaultEnv VarDescription
enabledboolFalseQK_WEB__API_DOCS__ENABLEDEnable API docs endpoints
providerstr"both"QK_WEB__API_DOCS__PROVIDER”swagger”, “redoc”, or “both”

KeyTypeDefaultEnv VarDescription
allowed_originslist[str]["http://localhost:3000", "http://localhost:8001"]QK_WEB__SECURITY__CORS__ALLOWED_ORIGINSAllowed origins
allow_methodslist[str]["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]QK_WEB__SECURITY__CORS__ALLOW_METHODSAllowed HTTP methods

In production, QK_WEB__SECURITY__CORS__ALLOWED_ORIGINS must be set to specific origins — wildcard * is rejected with a validation error.


Sub-keys: security.csrf, security.hsts, security.csp, security.cross_origin. Import the typed configs from quadkit.web.security.config for full field listings.

web:
security:
csrf:
enabled: true
excluded_paths: ["/api/", "/health", "/metrics"]
hsts:
max_age: 31536000
include_subdomains: true

application.yaml
web:
enabled: true
env: development
server:
host: 0.0.0.0
port: 8000
reload: true
cors:
allowed_origins:
- "http://localhost:3000"
rate_limit:
enabled: true
default_limit: 200
default_window: 60
openapi_title: "My API"
openapi_version: "0.1.0"

Environment override equivalent:

Terminal window
export QK_WEB__SERVER__HOST=0.0.0.0
export QK_WEB__SERVER__PORT=8080
export QK_WEB__SECURITY__CORS__ALLOWED_ORIGINS='["https://myapp.com"]'
export QK_WEB__RATE_LIMIT__DEFAULT_LIMIT=500