Repository navigation
Add --output json to auth list and auth token, and --min-ttl to auth token - #29
Merged
Merged
Conversation
…token Programs that run the CLI for a user list and token need them in a form they can parse, and a token that lasts as long as their work does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edumansky
commented
Nov 17, 2026
edumansky
left a comment
Contributor
Author
There was a problem hiding this comment.
Codex review (gpt-6-astra, reasoning effort: high)
No actionable defects were identified in the diff. The new command JSON tests passed; minimum-TTL tests and broader suites could not complete because the sandbox prohibits local test-server listeners.
Contributor
Author
Codex review: outcomeCodex (
Elsewhere they pass:
🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
webex auth listandwebex auth tokencan now print JSON, andauth tokencan make sure its token lasts long enough for the work it's handed to.Webex Admin Studio runs both commands to get its users and tokens:
auth list --output jsonauth token --user <email> --organization <org> --output json --min-ttl <n>sNeither works on
main, so Studio can't sign in with a current CLI. #20 added both, and they went with its revert.Changes
auth list --output jsonprints one object per stored login, sorted by email. Each hasemail,name,orgId,orgName,status,default,readOnlyandexpiresAt. It never includes a token.auth token --output jsonprintstoken, plusexpiresAtandemailwhen the token comes from a stored login, plusorgId.auth token --min-ttl <duration>refreshes the stored token first when less than that time remains. It fails if even a fresh token wouldn't last that long. With--tokenor a token from the environment there's nothing to refresh, so--min-ttlis refused.--output jsonswitches to JSON. The flag's default is alsojson, so without it both commands print exactly what they print today.auth listtable is now built from the same list as the JSON. It is sorted by email, which before was random map order.auth.EnsureMinTTL. It refreshes through the existingrefreshStored, under the same lock that the other CLI processes use.skill/SKILL.md.This is #20's code for these two commands. #20's tidy-up of
auth statusand itsauth status --output jsonare not included.Checks
TestAuthUsersAreSortedAndCarryState,TestTokenJSONOmitsUnknownExpiry, and threeEnsureMinTTLtests (keeps, refreshes, refuses). They failed to compile before the change.go vet ./...andgo test -p 1 ./...pass.make codegenkeeps the skill edit.WebexUserandAccessTokenstructs (crates/studio-engine/src/webex_cli.rs).auth list --output jsonhas the fields above and no token.auth token --output json --min-ttl 30mhastoken,expiresAt,emailandorgId.auth tokenandauth listwithout the flags print as before, apart from the table's new sort order.WEBEX_TOKENset,--min-ttlis refused, and--output jsongivestokenandorgId.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.