Repository navigation
Conversation
New command 'jf access-token-verify' (alias 'atv') verifies a JFrog access token against the configured server and reports its type. The token comes from the argument, --token-file, or stdin (with a hidden prompt in a terminal); JSON input such as 'jf atc' output is read for its access_token value. Output is a table by default, or JSON with --format=json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mints tokens with 'jf atc' and verifies them with 'jf atv' against the configured default server: identity, admin, scoped, groups and non-expiring tokens, file and JSON input, and the reference, revoked, tampered, locally signed and unknown-server failures. Every case checks the token never appears in the output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mpty input The payload is printed even when verification fails, so control and format characters in claims are now escaped instead of reaching the terminal raw. An empty token argument or --token-file path is now an error instead of a silent switch to reading stdin. The help no longer says the profile's credentials are unused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… once The case revoked its token and the cleanup revoked it again, and the cleanup asserts HTTP 200. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dlers The verification error can quote token claims and server text. It is now escaped and logged by the command, which exits 1 without returning the message, so the JSON error handler can't parse it as an HTTP error and print a second, forged JSON object. JSON output also escapes DEL, C1 controls and Unicode format characters. The integration suite runs in the external Artifactory pipeline too, and checks that readiness rejects anonymous requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Command-line arguments are visible to other processes and kept in shell history, so atv now rejects any argument and reads the token only from --token-file or stdin. The integration tests pass tokens through --token-file. The anonymous readiness case is removed: Access readiness answers 200 to anonymous requests, so the revoked-token case is what shows that a presented token is checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output now starts with the token's format, JWT or Reference, and JSON output has a format field. For a reference token, the table lists the token details the server returned, with its epoch fields as dates. The help describes the tokens/me check and reference tokens, and the integration tests verify a reference token, a revoked reference token and a value that isn't a token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ixing input, output and help gaps - The hidden prompt reads its own line without x/term's 4096-character cap, discards whatever is left in the terminal so it can't reach the shell, and rejects multi-line pastes. - Git Bash and other Cygwin terminals, which can't hide input, get an error instead of an echoed prompt. - UTF-16 token files (Windows PowerShell 5.1 redirection) are decoded. - A non-object ext claim is shown in the table. - The help and --token-file text match the current behaviour. - tokenUnderTest is renamed to tokenUnderInvestigation, and non-critical comments are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g the INTERNAL column Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a single error line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olor version has Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…help Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n the atv help Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d fixing the revoked JWT test expectation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g Artifactory audience rejections Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se the configured server Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n atv output Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rence token without details Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng the expected messages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itespace in the token and showing less than a minute left Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch is waiting to be deployed
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.
TestAccessTokenVerifyintegration test is written but not yet run against a JPD.)masterbranch.go vet ./.... (Locally, withreplacedirectives pointing at the two PRs above.)go fmt ./....RTECO-2746 - Adding access-token-verify feature
Summary
Adds
jf access-token-verify(aliasjf atv). It verifies a JFrog access token against the configured server and reports what kind of token it is:GET /access/api/v1/tokens/mewith the token, and only a token the server accepts is valid.The output starts with the token's format,
JWTorReference, and JSON output has aformatfield.--token-fileor stdin (the default). JSON input is read for itsaccess_tokenvalue. An argument is rejected, because arguments are visible to other processes and kept in shell history.atvprompts on stderr and reads one line without echoing it, in raw mode and with its own reader, so long tokens aren't cut (no 1,024-byte canonical-mode limit, no 4,096-characterx/termlimit). Whatever is still in the terminal after that line is discarded before the terminal is restored, so a multi-line paste can never reach the shell as typed input; a multi-line paste is rejected.--token-fileor a pipe.Bearerand surrounding quotes. UTF-16 input with a BOM (Windows PowerShell 5.1 redirection) is decoded.--token-filepath is an error, not a silent fallback to stdin.--server-id,JFROG_CLI_SERVER_ID, or the default.--url, no credential flag and no--insecure-tls. Private CAs go in~/.jfrog/security/certs.http://servers get a warning.FIELD/VALUEtable by default, with aTYPEblock when the token is valid.--format=jsonwrites{valid, error, header, payload, types}.\uescapes.JFROG_CLI_ERROR_OUTPUT_FORMAT=jsonhandler can't parse a claim such astyp: "server response: 200 OK"as an HTTP error and print a second JSON object.Internal Tokenfor any otherinternal:scope. Quoted scopes and the legacymember-of-groups:andapi:*scopes are recognized.docs/general/tokenverify/help.gohas the usage and the AI description.Tests
general/token/verify_test.gocovers:server-id,token-file,format);main_test.go:TestAccessTokenVerifyRegistered.access_test.go:TestAccessTokenVerifymints tokens withjf atcand verifies them against the configured default server.Reference, itstoken_idmatching the minted one),--token-filewith a bare token and withjf atcJSON, and the revoked JWT, revoked reference token, non-token value, tampered, locally signed and unknown-server failures.--token-file. A separate case checks that a token passed as an argument is rejected and never echoed.skip_tests).jf atc's multi-line JSON is rejected, nothing is echoed, and the next program reading the terminal gets nothing (a plain line reader in the same setup leaks the token's line)."$TOKEN", exits 1 before stdin is read, without echoing the argument;JFROG_CLI_LOG_LEVEL=DEBUGoutput.🤖 Generated with Claude Code