Skip to content

fix(auth): logout revokes the key browser sign-in made; credentials file is created owner-only - #438

Merged
pdonohoe02 merged 2 commits into
mainfrom
claude/project-thread-mkb2s7
Nov 19, 2026
Merged

pdonohoe02 merged 2 commits into
mainfrom
claude/project-thread-mkb2s7

Conversation

@pdonohoe02

Copy link
Copy Markdown
Contributor

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 logout revokes 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.
  • A key pasted with --api-key is left alone, because it may also run in CI. The config records which kind it holds (browser_login).
  • If the revoke fails, logout still signs out locally and says the key still works and where to revoke it.
  • The credentials file is created 0600 instead 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_key finds the key by the two ends the API shows (GET /v1/auth/api-keys), then DELETE /v1/auth/api-keys/{id}. No API change needed.
  • src/config.rs: browser_login flag (omitted when false); owner-only create.
  • src/cli.rs: help text for auth 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 in tests/mock_api_tests.rs (revokes the browser key, leaves a pasted key, still signs out when the API errors, file mode is 0600).
  • 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

…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
@pdonohoe02 pdonohoe02 self-assigned this Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T04:38:20.906324Z 7ae1dc0 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/commands/auth.rs Resolved
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
@pdonohoe02
pdonohoe02 marked this pull request as ready for review November 19, 2026 04:36
@pdonohoe02
pdonohoe02 merged commit d3598db into main Nov 19, 2026
7 checks passed
@pdonohoe02
pdonohoe02 deleted the claude/project-thread-mkb2s7 branch November 19, 2026 04:44
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.

2 participants