Skip to content

Add structured JSON output to logout command#297

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
json/logout-structured-output
Jun 27, 2026
Merged

Add structured JSON output to logout command#297
AndreyVMarkelov merged 1 commit into
masterfrom
json/logout-structured-output

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds --output=json support to logout with logged_out and already_logged_out statuses, reporting removed_saved_credentials and remote_token_revoked.
  • Rejects logout when DBXCLI_ACCESS_TOKEN is set with a new env_token_still_active error code.
  • Emits a token_revoke_failed warning when local credentials are removed but remote revocation fails.
  • Iterates tokens deterministically (sorted domains and token types) for reproducible output.
  • Adds long description to the logout command and updates generated docs.

Test plan

  • go test ./... -count=1 passes (7 new logout tests + contract audits)
  • golangci-lint run ./... clean
  • go build succeeds
  • Generated docs/commands/dbxcli_logout.md matches go run ./tools/gen-docs output
  • CI passes

Report credential removal, token-revoke status, and already-logged-out
state via --output=json. Reject logout when DBXCLI_ACCESS_TOKEN is set
with a new env_token_still_active error code. Emit a token_revoke_failed
warning when local credentials are removed but remote revocation fails.
@AndreyVMarkelov AndreyVMarkelov merged commit 19e525a into master Jun 27, 2026
8 checks passed
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.

1 participant