Skip to content

feat(auth): login, logout, whoami, token storage and client credentials - #17

Closed
bobbyg603 wants to merge 1 commit into
feat/scaffoldfrom
feat/auth
Closed

bobbyg603 wants to merge 1 commit into
feat/scaffoldfrom
feat/auth

Conversation

@bobbyg603

Copy link
Copy Markdown
Member

Adds sign-in to the bugsplat-auth crate and the login, logout and whoami commands: the browser OAuth flow MCP clients use (discovery, dynamic client registration cached per API URL, PKCE S256, loopback callback), refresh under a file lock that re-reads the store first because refresh tokens rotate, client credentials for CI, and session storage in the OS keychain with a 0600 file fallback, selectable with BUGSPLAT_TOKEN_STORE (debug builds default to the file so tests and rebuilt binaries never touch a developer's keychain). Tested with 51 wiremock unit tests and 6 tests of the built binary, plus an ignored end-to-end test that passed against LocalStack (sign-in through the form, whoami, a rotated refresh, two commands refreshing at once, client reuse, logout); the keychain store itself was not run, and nothing was compiled for Linux or Windows. whoami shows the email only when the access token names one, which LocalStack's tokens do not. Closes #3

🤖 Generated with Claude Code

`bugsplat login` runs the OAuth flow MCP clients use: discovery, dynamic
client registration (cached per API URL), PKCE S256 and a loopback
callback. `access_token` returns BUGSPLAT_ACCESS_TOKEN, then a token from
a Client ID and Client Secret, then the stored session, which it refreshes
under a file lock and re-reads first because the server rotates refresh
tokens.

Sessions live in the OS keychain, one item per API URL, with a 0600 file
under the config directory when there is no keychain. BUGSPLAT_TOKEN_STORE
(auto, keychain, file) picks the store; debug builds default to the file
so tests and rebuilt binaries never touch the developer's keychain.

Closes #3

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bobbyg603 bobbyg603 mentioned this pull request Nov 24, 2026
@bobbyg603

Copy link
Copy Markdown
Member Author

Closing in favor of #21, which contains this branch together with the other phase 1 streams and the fixes made when they were combined. This pull request's diff is still here for reviewing this stream on its own; the branch is not deleted.

@bobbyg603 bobbyg603 closed this Nov 24, 2026
@bobbyg603
bobbyg603 deleted the feat/auth branch November 25, 2026 22:19
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.

1 participant