Skip to content

fix: stop overwriting verify_jwt setting on function deploy - #6197

Closed
deepshekhardas wants to merge 1 commit into
supabase:developfrom
deepshekhardas:fix/verify-jwt-deploy-preserve
Closed

deepshekhardas wants to merge 1 commit into
supabase:developfrom
deepshekhardas:fix/verify-jwt-deploy-preserve

Conversation

@deepshekhardas

Copy link
Copy Markdown

The �erify_jwt setting is silently overwritten when deploying functions. This fix preserves the existing verify_jwt value.

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
@github-actions

Copy link
Copy Markdown
Contributor

👋 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 open-for-contribution label, then open a pull request that links the issue with a closing keyword (e.g. Closes #123).
See CONTRIBUTING.md for the full workflow. Once a maintainer adds the open-for-contribution label to a linked open issue, reopen or open a new pull request and it will be accepted.

@github-actions github-actions Bot closed this Aug 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant