Repository navigation
Exit 3 from whoami when the API rejects the stored sign-in - #262
Merged
Merged
Conversation
whoami asked the API who the credential is and, when that failed for any reason, printed a warning and exited 0. A script checking whether a profile is signed in could not tell a revoked or rejected sign-in from an API that cannot be reached. When GET /v1/me answers that the credential is not accepted (401, or a refused refresh), whoami now still prints the local details and the warning, leaves the API fields null, and exits 3 with the same sign-in hint as every other command. An API that is unreachable or fails on its side (network, 5xx, timeout) still gives exit 0. The README and the changelog describe both cases. Closes #258 Signed-off-by: d0ubl3g <48954024+d0ubl3g@users.noreply.github.com>
Merged
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.
hodeishield whoamiexited 0 when the API rejected the stored sign-in, so a script could not tell that it was signed out.Change
GET /v1/me, or a failed token refresh, now ends with the existing not-authenticated exit code (3) and its sign-in hint.--jsonkeeps the API fields asnull.whoamiparagraph and the exit-code table) and CHANGELOG updated.Tests
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo xtask codegen --checkandcargo test --workspacepass (378 tests).