Repository navigation
fix(platform): isolate email signing and provision gateway secrets - #333
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e8d63020e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2522b1eac3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| emailEnabled: plan.deployment.capabilities.email, | ||
| emailSigningSecret: process.env.VOID_PLATFORM_EMAIL_SIGNING_SECRET || '', | ||
| existingEmailEnabled: existing.deployment.capabilities.email, |
There was a problem hiding this comment.
Upload the email key when a resumed install enables email
When --resume targets an in-progress installation whose recorded deployment did not enable email, the planner explicitly permits adding the email capability, and this call generates a new signing key. However, it does not set updateExistingWorkers, so createPlatformInstallationSecrets discards the corresponding workerSecretUpdates; any API or proxy Worker created before the interruption is redeployed without EMAIL_SIGNING_SECRET, while the newly created gateway receives it. The resumed installation can therefore complete with email requests failing between Workers; enable existing-worker secret updates for this capability transition.
Useful? React with 👍 / 👎.
The first production email gateway deployment failed because its required signing secret was not provisioned when the Worker was created. Give email its own
EMAIL_SIGNING_SECRETacross the API, proxy and gateway, and upload that secret with each standard Worker deployment after a preflight that runs before migrations. Login sessions and project authentication retainJWT_SECRET.Self-hosted email installations generate and checkpoint an independent key, preserve it across interrupted setup and upgrades, and require the original key when recovery state is missing. An interrupted email credential update cannot be replaced with unrelated credentials, including by an email-disable plan. Recovered email identity stays authoritative over conflicting environment input. Core-only installations and direct Cloudflare app deployments gain no new secret requirement.
Automatic deployment-key injection is restricted to the three known first-party Worker directories and standard deployment options. Alternate configs, entrypoints, targets and other custom options receive no automatic email key. Local platform setup, recovery guidance and the existing email design are updated.
Validation:
Deployment requires one stable
EMAIL_SIGNING_SECRETin each GitHub deployment environment; production and staging use different values. The documented first cutover is coordinated across all three Workers without a JWT compatibility fallback. Remove any old JWT binding from the gateway after cutover while preserving API/proxy login keys.