Repository navigation
fix(auth): logout revokes the key browser sign-in made; credentials file is created owner-only - #438
Merged
Merged
Conversation
…ile is created owner-only `floo auth logout` only deleted the local file, so the key minted by browser sign-in stayed valid on the server. Logout now revokes that key first. A key pasted with --api-key is left alone, since it may also run in CI. If the revoke fails, logout still signs out here and says the key still works. The credentials file is created 0600 instead of written and then narrowed. Refs getfloo/floo#4711 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Eufw46LbCK8k4xKuhXxdYW
Contributor
Author
|
@codex review Generated by Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ed6e3e8ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The warning for a failed revoke is not printed in JSON mode, so a script could not tell a revoked key from one still valid. The logout result now carries key_revoked and the warning. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Eufw46LbCK8k4xKuhXxdYW
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.
Requested by Patrick · project thread
Do not merge without Patrick's OK. Security fix from the 2026-11-19 identity and credentials review. Reaches users only with a CLI release, which needs his separate approval.
Summary
floo auth logoutrevokes the API key that browser sign-in minted, then clears the local file. Before, the key stayed valid on the server, so a copy taken from the laptop kept working after logout.--api-keyis left alone, because it may also run in CI. The config records which kind it holds (browser_login).0600instead of written and then narrowed, and a file an older CLI left wider is narrowed on the next write.Issue Closure (Required)
Closes getfloo/floo#4711
Changes
src/commands/auth.rs: logout revokes first; login records where the key came from.src/api_client.rs:revoke_own_api_keyfinds the key by the two ends the API shows (GET /v1/auth/api-keys), thenDELETE /v1/auth/api-keys/{id}. No API change needed.src/config.rs:browser_loginflag (omitted when false); owner-only create.src/cli.rs: help text forauth logout.Existing sign-ins have no flag, so their first logout after upgrading does not revoke; the next browser sign-in sets it.
Test Plan
cargo test: all suites pass, including 4 new tests intests/mock_api_tests.rs(revokes the browser key, leaves a pasted key, still signs out when the API errors, file mode is0600).cargo clippy --all-targets -- -D warnings: clean.cargo fmt.Discovered Issues
None. Follow-up at release: one sentence in
cli/auth.mdx(floo-docs) for the new logout behavior.Generated by Claude Code