feat: add DB queries for ai_gateway_coderd_keys#25564
Conversation
884d73a to
07965bc
Compare
07965bc to
4809647
Compare
f842713 to
3248cc3
Compare
4809647 to
68caa22
Compare
056ea4d to
ea066e6
Compare
09af228 to
9851434
Compare
3c2624b to
ca08383
Compare
56911cf to
4a8ae2b
Compare
|
/coder-agents-review |
There was a problem hiding this comment.
Solid query-layer PR. The three queries are well-structured: explicit column subsets that exclude hashed_secret from return types (structural security boundary enforced at the SQL level, not caller discipline), correct RBAC resource/action pairing, and thorough constraint tests covering all six DB constraints. Pariston tried to build a case against the design and couldn't. Kite praised the secret-exclusion pattern specifically. Mafuuu traced the full contract chain and confirmed correctness.
3 P3, 2 Nit. No blockers.
Process note: the PR title says aibridge_coderd_keys but the actual table is ai_gateway_coderd_keys. When this squash-merges, git log --grep ai_gateway_coderd_keys won't find it. Worth fixing the title before merge.
"I tried to build a case against this change and couldn't. The problem is correctly understood, the solution is proportional, and the fix is at the right level of the stack." (Pariston)
🤖 This review was automatically generated with Coder Agents.
4c654bf to
f397e3c
Compare
2a07176 to
d2a7b79
Compare
f397e3c to
b932b20
Compare
1adb398 to
f9c6e92
Compare
b932b20 to
535c9cd
Compare
3fedbd0 to
267827f
Compare
8239275 to
ab58a2f
Compare
6405f23 to
dad326f
Compare
335b73d to
13dd6ae
Compare
74ac18e to
6ce1b97
Compare
1bfe3cc to
37daa9f
Compare
328502b to
d5c8d95
Compare
318ebc9 to
06ad9f0
Compare
d5c8d95 to
1873fdc
Compare
0fa846e to
889b7a6
Compare
Adds Insert / List / Delete queries on aibridge_coderd_keys plus the
ResourceAIGatewayCoderdKey RBAC object (Create / Read / Delete actions).
The hashed_secret column is intentionally excluded from every query's
RETURNING / SELECT list, so generated row types never carry it.
Also extends the migration with token_prefix (varchar(11)), the
'aibridge_coderd_key' resource_type enum value for audit support, and
ai_gateway_coderd_key:{*,create,delete,read} api_key_scope values.
889b7a6 to
324ac9d
Compare

Adds Insert, List and Delete queries for
ai_gateway_coderd_keystable.