-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Problem
When deploying pgflow to Supabase production, the ensure_workers cron function fails to authenticate with the EdgeWorker.
Details
ensure_workersretrieves the service role key from vault (supabase_service_role_key) and sends it asAuthorization: Bearer {key}- The vault stores the JWT format key (starts with
eyJhbG...) - The EdgeWorker's
validateServiceRoleAuthfunction compares againstenv['SUPABASE_SERVICE_ROLE_KEY'] - Inside Edge Functions,
SUPABASE_SERVICE_ROLE_KEYis in the internal format (starts withsb_secret_...) - These don't match → 401 Unauthorized
Test Results
Using a test edge function, I confirmed:
{
"serviceRoleKeyPrefix": "sb_secret_...",
"authHeader": "Bearer eyJhbG...",
"match": false
}Environment
- @pgflow/edge-worker: 0.13.2
- Supabase hosted (supabase.co)
- Using
EdgeWorker.start(MyFlow)
Expected Behavior
The ensure_workers SQL function should be able to trigger the EdgeWorker successfully, or there should be documentation on how to configure this correctly.
Questions
- Is this a known limitation?
- Should the EdgeWorker validate against the JWT format key instead?
- Is there a workaround we're missing?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels