mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-29 00:01:22 +00:00
feat(api): error codes, idempotency keys, cursor pagination
- Stable machine-readable error codes alongside the error message (UNAUTHENTICATED, INVALID_TOKEN, ADMIN_REQUIRED, SCOPE_INSUFFICIENT, IDEMPOTENCY_IN_PROGRESS); CLI renders "CODE: message". - Idempotency middleware on authed/admin groups: POST requests with an Idempotency-Key header replay the first response for 24h (Redis-backed, caller-scoped); concurrent duplicates get 409. X-Idempotent-Replay header marks replays. - Shared pagination helpers: ?cursor= (opaque, preferred) alongside legacy ?page= on projects and deployments lists; pagination meta includes next_cursor; invalid cursors fail soft to page 1. - CLI --idempotency-key flag for safe scripted retries. - OpenAPI updated: error envelope, cursor params, idempotency contract. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
485e41a817
commit
18f78f00a3
15 files changed
+454
-56
No files matched your search
@@ -55,12 +55,14 @@ func init() {
|
||||
pf.StringP("profile", "p", "", "config profile to use (default current_profile)")
|
||||
pf.Bool("json", false, "machine-readable JSON output")
|
||||
pf.BoolP("yes", "y", false, "skip confirmation prompts (required for destructive ops in scripts)")
|
||||
pf.String("idempotency-key", "", "Idempotency-Key header for POST mutations (safe retries)")
|
||||
|
||||
viper.BindPFlag("api-url", pf.Lookup("api-url"))
|
||||
viper.BindPFlag("token", pf.Lookup("token"))
|
||||
viper.BindPFlag("profile", pf.Lookup("profile"))
|
||||
viper.BindPFlag("json", pf.Lookup("json"))
|
||||
viper.BindPFlag("yes", pf.Lookup("yes"))
|
||||
viper.BindPFlag("idempotency-key", pf.Lookup("idempotency-key"))
|
||||
|
||||
rootCmd.AddCommand(commands.AuthCmd)
|
||||
rootCmd.AddCommand(commands.TokensCmd)
|
||||
|
||||
Reference in new issue
Block a user