Repository navigation
feat: add AI Gateway coderd key CRUD endpoints - #25565
Conversation
Docs preview📖 View docs preview for |
07965bc to
4809647
Compare
0815067 to
a5a848b
Compare
4809647 to
68caa22
Compare
a5a848b to
67fff61
Compare
68caa22 to
09af228
Compare
67fff61 to
7d951c2
Compare
09af228 to
9851434
Compare
e6e5378 to
3649959
Compare
2702dec to
ae89f52
Compare
3649959 to
6bb4bb7
Compare
ae89f52 to
56911cf
Compare
6bb4bb7 to
03d293f
Compare
56911cf to
4a8ae2b
Compare
cbb96c5 to
575f979
Compare
4c654bf to
f397e3c
Compare
575f979 to
eae6f67
Compare
f397e3c to
b932b20
Compare
eae6f67 to
cf66448
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.6.1 | Round 6 | Last posted: Round 6, 15 findings (1 P1, 4 P2, 4 P3, 6 Nit), APPROVE. Review Finding inventoryFindings
Contested and acknowledged(none) Round logRound 1Netero-only. 1 P1, 1 P2, 1 Nit. Reviewed against 535c9cda87bd..13719f7701b9. Round 2Netero-only. CRF-1, CRF-2, CRF-3 addressed. 1 P2, 1 Nit new. Reviewed against 535c9cda87bd..225e14577f3d. Round 3Panel (20 reviewers). CRF-4, CRF-5 addressed. 2 P2, 3 P3, 2 Nit new. Reviewed against f412d7fc42c8..e2e898d184d2. Round 4Panel (6 reviewers). CRF-6 through CRF-12 addressed. 1 P3, 1 Nit new. No open P0-P2. Reviewed against 9275dcf..a3c0764. Round 5BLOCKED. CRF-13 (P3) and CRF-14 (Nit) silent. No review. Round 6Panel (4 reviewers). CRF-13 and CRF-14 addressed. 1 Nit new (Netero). No open P0-P3. Reviewed against 32aee9e..03eddf07cf22. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
0fa846e to
889b7a6
Compare
27909af to
e08ef69
Compare
889b7a6 to
324ac9d
Compare
e08ef69 to
bc98d05
Compare
bc98d05 to
c6ab060
Compare
|
/coder-agents-review |
There was a problem hiding this comment.
Round 5 blocked. Two findings from R4 have no author response or code fix.
CRF-13 (P3): ListResponseDoesNotLeakSecrets checks for "secret" and "hashed_secret" but not "key" (the actual JSON field for the plaintext key). The rename commit (c6ab0602) updated types but did not modify the leak test assertions.
CRF-14 (Nit): preExsiting typo in querier_test.go. The rename commit changed the type name but left the misspelled variable name across five references.
Further review is blocked until the author responds to or addresses these findings. A reply acknowledging, contesting, or fixing each is sufficient to unblock.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
Round 6 panel review (4 reviewers). All 14 prior findings verified fixed. CRF-13 and CRF-14 (which blocked R5) confirmed resolved in 03eddf07.
The PR has been through 6 rounds of review across 4 panel sessions (20, 6, 6, and 4 reviewers). 14 findings raised and addressed, including a P1 key-length/hash mismatch (CRF-1), missing audit events (CRF-4/CRF-7), an implicit hash contract that 8 reviewers converged on (CRF-6), and an RFC 7231 violation (CRF-9). The author adopted Razor's structural alternative for the hash contract, eliminating the prefix-stripping ambiguity entirely. Test coverage is thorough: unit test for key generation with positive and negative hash validation, audit test with real Postgres backend and diff-level assertions, RBAC/feature-gate/validation/leak-detection integration tests.
1 Nit remaining (CRF-15, swagger operation ID inconsistency). Non-blocking.
"This is a genuine test suite. Every test proves behavior. Nothing is costume jewelry." Bisky, admiring the stones.
🤖 This review was automatically generated with Coder Agents.
Adds POST / GET / DELETE handlers for /api/v2/aibridge/coderd-keys under the existing AI Bridge feature gate. Create returns the plaintext secret exactly once (cgw_<random>... format); list returns metadata plus a short non-secret token_prefix so admins can correlate keys with the daemons presenting them. Delete identifies keys by UUID in the path and is idempotent.
d365992 to
2f6ac7f
Compare
| require.Equal(t, http.StatusBadRequest, resp.StatusCode) | ||
|
|
||
| // Delete existing key -> 204 (SDK returns nil error on 204). | ||
| created, err := ownerClient.CreateAIGatewayKey(ctx, codersdk.CreateAIGatewayKeyRequest{ |
There was a problem hiding this comment.
Also missing the status code assertions here.
There was a problem hiding this comment.
You could also add a 204 check here to match the comment.
| require.Equal(t, http.StatusBadRequest, resp.StatusCode) | ||
|
|
||
| // Delete existing key -> 204 (SDK returns nil error on 204). | ||
| created, err := ownerClient.CreateAIGatewayKey(ctx, codersdk.CreateAIGatewayKeyRequest{ |
There was a problem hiding this comment.
You could also add a 204 check here to match the comment.

Adds create, list and delete endpoints for AI Gateway keys used to authenticate into Coderd.
All endpoints require Owner permission.