Commit 4c4956e
committed
admin: address Gemini + Codex review (write endpoints)
- adapter/dynamodb_admin.go: drop the redundant empty-table-name check
in AdminCreateTable. buildLegacyCreateTableInput already rejects an
empty TableName, so the second guard was dead code that just
shifted the error path.
- internal/admin/dynamo_handler.go: reject trailing JSON tokens after
the create-table body (Codex P2). `decodeCreateTableRequest` now
calls dec.More() after the first Decode() and returns 400 if the
client sent additional values; previously a `{...}{garbage}` body
silently used the first object and ignored the rest.
- Split out validateCreateTableRequest so the decoder + validator
each stay under cyclop=10 after adding the dec.More() check.
- Tests: extend TestDynamoHandler_CreateTable_RejectsBadJSON to cover
both trailing JSON object and trailing scalar.1 parent 1f65c91 commit 4c4956e
3 files changed
Lines changed: 34 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
| 205 | + | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
368 | 373 | | |
369 | 374 | | |
370 | | - | |
371 | | - | |
372 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
373 | 392 | | |
374 | 393 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
378 | 397 | | |
379 | 398 | | |
380 | | - | |
| 399 | + | |
381 | 400 | | |
382 | 401 | | |
383 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
| |||
0 commit comments