Repository navigation
fix(api): answer a git-credentials repo_id of "org" with 404 instead of an assertion - #667
Conversation
…of an assertion Change-Id: I51476b40efd52f4264557870ace5b8debf2a8b48 Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
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. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…of an assertion Change-Id: I9081ddbfa93e114e5704174b123f6da7a29d5f35 Signed-off-by: Thomas Kosiewski <tk@coder.com>
…d-followup658 Change-Id: Id9dd94346e4963a193c3f344ac6911c37440c04c Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Why
Follow-up to #666 (issue #658, SDK 0.1.0 tokens). The clean-context review before that merge found two valid minor gaps, and this PR fixes both.
What changes
POST /api/v1/repos/git-credentialswith a bodyrepo_idof"org"hit the handler's repo-claim assertion. The handler panicked: the server answered500and logged a panic with a stack trace. That body value names no repository, so the handler now looks it up like any otherrepo_idand answers404. The assertion still guards the fallback to the token'srepoclaim, whichrequireAuthalready checks. This bug was older than fix(auth): accept any non-empty sub and treat a token without repo as org-wide #666.GET /repos,GET /api/repo-urls/{repo_id}andPUT/DELETE /repos/git-credentialsrows ofdocs/reference/http-api.mdand the intro ofdocs/reference/webhooks.mdnow say that an org-level route also accepts a token with norepoclaim. That rule is in effect since fix(auth): accept any non-empty sub and treat a token without repo as org-wide #666 and is described indocs/reference/authentication.md.Tests
TestCredentialCreate(pg and sqlite) now sendsrepo_id: "org"with a valid repo-scoped token and expects404. On main the same test fails: the handler panics withhandleCreateCredential: unusable repo key "org"and the client gets EOF.Refs #658
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high