Conversation
…ation flow Redesign authentication logic to support both Service Account and Browser-based workflows. Replace `ServiceAccountToken` with a more generic `AuthMethod` enum, and introduce OAuth PKCE flow for browser authentication. Add support for token caching and management via keyring or file-based storage. Update CLI commands to include token functionalities and adapt help messages accordingly.
- Separate keyring keys for browser (browser_access_token/browser_refresh_token) and service account (sa_access_token) to prevent cross-flow token collisions - Add pre-refresh check: return friendly "Session expired" if refresh token missing - Enable apple-native and linux-native keyring features so tokens persist across process invocations (previously used in-memory mock backend with no persistence) - clear_auth now also cleans up legacy access_token/refresh_token keys for migration
tobias-fire
approved these changes
Mar 25, 2026
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.
Summary
Adds browser-based OAuth PKCE authentication as an alternative to Service Account login, migrates secret storage to the OS keychain, and fixes several bugs discovered during implementation.
What changed
New authentication flow (
src/auth.rs,src/context.rs)fb authnow offers a choice: Browser login (PKCE) or Service AccountGET /web/v3/myAccounts) — auto-selects if only one account existsKeyring-based secret storage
keyringcrate--no-keyringflag falls back to~/.firebolt/fb_secrets(YAML file)apple-nativeandlinux-nativekeyring features — without these the crate compiled with an in-memory mock backend, losing tokens between invocationsbrowser_access_token/browser_refresh_tokenfor browser flow,sa_access_token/sa_secretfor SA flow — prevents cross-flow token collisionsNew subcommands
fb auth token— prints current access token to stdout, refreshes if expired