config push: changing auth.oauth_server.authorization_url_path fails with 400 (enabled and path must be sent together)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- supabase, typescript
调研方向
阅读 apps/cli/src/commands/config/push/push.encoders.ts 中 OAuth 服务器条目附近的内容,并将它们与 captcha、SMTP 或 auth hooks 必须一起处理的分组进行比较。重现 issue 中仅推送路径的操作,然后检查编码后的请求体是否包含当前的 enabled 值以及更改后的路径。更新成功且没有关闭 OAuth 服务器时即为完成;也要验证反向情况,即仅更改 enabled。
由索引模型根据 Issue 内容生成。
描述
Follow-up to #6367, which was closed as completed. On the new TypeScript CLI the diff half is fixed, but the push half still cannot change authorization_url_path on a project where the OAuth server is already enabled: the plan is correct, the request is rejected with a 400.
Version
supabase@next = 3.0.0-next.4 (via npx), Windows 11. Hosted project with oauth_server_enabled = true and oauth_server_authorization_path = "/oauth/consent".
Reproduce
supabase/config.toml, nothing else declared:
project_id = "<ref>"
[auth.oauth_server]
enabled = true
authorization_url_path = "/.lovable/oauth/consent"
supabase config push --project-ref <ref> --yes
Actual
Updating Auth service with config:
auth.oauth_server.authorization_url_path [update]
local: "/.lovable/oauth/consent"
remote: "/oauth/consent"
HTTP PATCH: https://api.supabase.com/v1/projects/<ref>/config/auth
ConfigPushAuthUpdateStatusError: unexpected status 400:
{"message":"Both OAUTH_SERVER_ENABLED and OAUTH_SERVER_AUTHORIZATION_PATH must be provided together when updating OAuth configuration"}
Nothing is written. config diff afterwards still reports the same update.
Expected
The path is updated. enabled is declared in the file and equals the remote value, so it is (correctly) not a change, but the Management API wants it in the same body as the path.
Likely cause
config push is diff-first and sends only changed fields. In apps/cli/src/commands/config/push/push.encoders.ts the three auth.oauth_server.* entries are plain scalar rows (source), not a required-together group like captcha, SMTP or the auth hooks, where an unchanged member is sent along with its current value. So a path-only change produces a body with oauth_server_authorization_path and no oauth_server_enabled.
Treating oauth_server_enabled + oauth_server_authorization_path as a required-together group should fix it. I have not checked whether the reverse case (changing only enabled) is rejected the same way; the error message suggests it is.
Why it matters
There is no CLI workaround that keeps the server up: the only way to make enabled part of the diff is to flip it, which takes the OAuth server down. On our project this path resets to /oauth/consent on its own from time to time (described in #6367), so being able to pin it from config.toml is the whole point.
Minor, related: with only authorization_url_path declared (no enabled = true), config diff lists the path under unmanaged and compares nothing. That follows ADR 0022, but the message does not say that declaring enabled = true is what makes it comparable.
Happy to test a build against a live project.
- 主要语言
- TypeScript
- 星标
- 2.4k
- 派生
- 533
- 平均合并
- 21 小时 24 分钟
- 30 天内合并 PR
- 378
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
supabase/cli 的其他 Issue
-
db schema declarative sync: no way to fail (non-zero exit) when the generated migration is destructive可能重新可做 关联的 PR 已关闭且未合并。 未关闭✨ Feature supabase/cli
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
stack: the HTTP gateway closes idle keep-alive connections after 5 s, so a client whose event loop is blocked gets ECONNRESET (`fetch failed`) on its next request可能已有人在做 @7ttp 于 13 天前认领。 未关闭🐛 Bug supabase/cli
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
📘 Docs supabase/cli
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
🐛 Bug supabase/cli
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
🐛 Bug supabase/cli
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
agilepathway/label-checker#739 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
CopilotKit/OpenBot#800 ·
维护者通常 1 天内回复
-
Endpoint links in the tag operations list are below the 24px target size可能已有人在做 @AdzerKI 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复