Skip to content

feat(decoys): add first-class decoys command group - #304

Draft
cvkramer wants to merge 1 commit into
mainfrom
feat/decoys
Draft

cvkramer wants to merge 1 commit into
mainfrom
feat/decoys

Conversation

@cvkramer

Copy link
Copy Markdown

What

Adds a first-class c1i decoys command group: list, get, search, create, update, rotate, delete, covering /api/v1/decoys, /api/v1/decoys/search, /api/v1/decoys/{id} and /api/v1/decoys/{id}/rotate.

  • create takes exactly one decoy type: --user-client-credential-user-id, --access-token-subject-user-id [+ --access-token-expires], --connector-client, or --workload-fed-provider-id + --workload-fed-condition. It also accepts a verbatim --body-file. User ids are checked to exist before sending.
  • create and rotate print the one-time credential under .material exactly once. It is never logged, and the help states it cannot be retrieved again.
  • update --annotation key=value follows the server's per-key PATCH semantics.

Why

Planting and managing decoys required raw c1i api calls (observed while building a Decoys demo on 2026-11-23).

Bead: global-w291.5
Fixes #298

Verification

  • go build ./..., go vet ./..., gofmt -l ., go mod tidy (no diff): clean
  • golangci-lint run (v2.15.0): 0 issues; gosec: clean
  • go test -p 1 -parallel 1 ./...: all packages pass. A parallel run on the shared dev host hit pre-existing ephemeral-port-exhaustion failures that reproduce identically on bare origin/main; they are unrelated to this change.
  • Targeted go test ./cmd -run Decoys and the shared mutation-table, dry-run-parity, user-ref and flag-docs suites pass. The decoys commands are wired into those cross-command suites.

Limitation: the generic dry-run preview row uses the workload-federation variant. The existing redact.IsSecretKey rule masks the userClientCredential and accessToken field names in --dry-run previews. This is pre-existing over-redaction: those objects hold ids, not secrets. Real requests are unaffected and covered in decoys_cmd_test.go.

Adds c1i decoys list/get/search/create/update/rotate/delete for managing
decoy credentials (honeytokens). create takes exactly one selector flag
(user-client-credential-user-id, access-token-subject-user-id,
connector-client, or workload-fed-provider-id+condition) or a complete
--body-file. create/rotate print the vended secret material under
.material exactly once; it is never logged and cannot be retrieved again.
update's --annotation key=value follows the server's per-key PATCH
semantics. Wires into the shared mutation table, dry-run parity, user-ref
check, and flag-doc coverage test suites.

Fixes #298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no first-class 'decoys' command (create/list/delete)

2 participants