Repository navigation
fix: stop overwriting verify_jwt setting on function deploy - #6197
deepshekhardas wants to merge 1 commit into
Conversation
Changes VerifyJWT field from bool to *bool so the CLI can distinguish between 'not configured' and 'explicitly set to false'. When verify_jwt is not present in config.toml, the field is omitted from deploy metadata (nil), allowing the API to preserve the existing server-side setting instead of defaulting to true and overwriting the dashboard value. Fixes #43608
|
👋 Thanks for the contribution! This pull request isn't linked to a tracked issue, so it's being closed automatically. Please open an issue first, wait for a maintainer to add the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3136caa5ae
ℹ️ 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".
| function struct { | ||
| Enabled bool `toml:"enabled" json:"enabled"` | ||
| VerifyJWT bool `toml:"verify_jwt" json:"verify_jwt"` | ||
| VerifyJWT *bool `toml:"verify_jwt" json:"verify_jwt"` |
There was a problem hiding this comment.
Preserve omitted verify_jwt in function config
When a user has a [functions.foo] block only for import_map, entrypoint, or static files and omits verify_jwt, load still injects functions.foo.verify_jwt=true before unmarshalling, so this pointer is non-nil and deploy still sends verify_jwt=true. That continues to re-enable JWT verification for remote functions that had it disabled, except for functions with no local config block at all; omitted per-function verify_jwt needs to remain nil to preserve the server-side setting.
Useful? React with 👍 / 👎.
| if i, exists := slugToIndex[slug]; exists && i >= 0 && | ||
| result[i].EzbrSha256 != nil && *result[i].EzbrSha256 == meta.SHA256 && | ||
| result[i].VerifyJwt != nil && *result[i].VerifyJwt == function.VerifyJWT { | ||
| result[i].VerifyJwt != nil && function.VerifyJWT != nil && *result[i].VerifyJwt == *function.VerifyJWT { |
There was a problem hiding this comment.
Skip unchanged deploys when verify_jwt is nil
For functions without an explicit verify_jwt, function.VerifyJWT is nil by design, but this unchanged check then fails even when the SHA matches the remote function. In that case every deploy goes through PATCH/POST and can create a new deployment/version despite no code or auth-setting change; treat nil as “do not compare this field” so a matching hash can still be skipped.
Useful? React with 👍 / 👎.
The �erify_jwt setting is silently overwritten when deploying functions. This fix preserves the existing verify_jwt value.