digital-identity-platform-docs
digital-identity-platform-docs / supabase/functions/container-config
supabase/functions/container-config
Fileoverview
Container Config Edge Function (Fallback Origin)
Serves container runtime configuration to Cloudflare Workers when KV cache misses. This is the fallback origin for the EDGE_CONFIG KV namespace.
Cloudflare Architecture Context
| Attribute | Value |
|---|---|
| Classification | 🟢 ACTIVE (FALLBACK ORIGIN) |
| Position | Behind Cloudflare Workers (KV miss → THIS FUNCTION) |
| Receives Public Traffic | No (Cloudflare Workers only, via X-Edge-Auth) |
| Latency Sensitive | Yes (blocks Worker request on cache miss) |
| Safe to Retry | Yes (read-only operation) |
| Failure Behavior | Fail-closed (Workers receive error, may retry) |
Security Model:
- Uses shared secret authentication via
X-Edge-Authheader - JWT verification is DISABLED (verify_jwt = false in config.toml)
- The EDGE_AUTH_SECRET is shared between CF Workers and this function
When Called:
- Cloudflare Router Worker experiences KV cache miss
- Worker calls this function to fetch config from Supabase
- Response is cached in EDGE_CONFIG KV for future requests
Endpoint
GET /container-config?host=hostname
Auth
X-Edge-Auth header with shared secret (not JWT)