Commit 2a4ac95
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 d0418b5 commit 2a4ac95
3 files changed
Lines changed: 34 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
214 | | - | |
| 212 | + | |
| 213 | + | |
215 | 214 | | |
216 | 215 | | |
217 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
374 | 379 | | |
375 | 380 | | |
376 | | - | |
377 | | - | |
378 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
379 | 398 | | |
380 | 399 | | |
381 | | - | |
382 | | - | |
383 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
384 | 403 | | |
385 | 404 | | |
386 | | - | |
| 405 | + | |
387 | 406 | | |
388 | 407 | | |
389 | 408 | | |
| |||
| 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