Skip to content

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

AttributeValue
Classification🟢 ACTIVE (FALLBACK ORIGIN)
PositionBehind Cloudflare Workers (KV miss → THIS FUNCTION)
Receives Public TrafficNo (Cloudflare Workers only, via X-Edge-Auth)
Latency SensitiveYes (blocks Worker request on cache miss)
Safe to RetryYes (read-only operation)
Failure BehaviorFail-closed (Workers receive error, may retry)

Security Model:

  • Uses shared secret authentication via X-Edge-Auth header
  • 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)

Released under proprietary license.