feat: add auth login/logout/status commands (PROT-7)#8
Merged
Conversation
Member
Author
|
Added |
…he OS keychain The Windows Credential Manager caps a credential blob at 2560 bytes, which our JWT access token + refresh token exceeds, so saves failed. Switch to an owner-only file store (0600 on Unix, profile ACL on Windows), overridable via PROTOSTAR_CONFIG_DIR. Drops the Devlooped.CredentialManager dependency.
ljones491
previously approved these changes
Jun 2, 2026
Member
ljones491
left a comment
There was a problem hiding this comment.
Seeing the synchronous Executes for async commands thing in design notes and it works. I don't see why these can't be AsyncCommands, but it's not blocking.
Login and Status do genuinely async work; AsyncCommand<T> drops the sync-over-async GetAwaiter().GetResult() hop and cancellation flows through ExecuteAsync. Logout stays a sync Command<T> (file IO only).
Member
Author
|
Good call — done in 4fa26f4. |
ljones491
approved these changes
Jun 2, 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.
What
Adds the CLI side of PROT-7:
protostar auth login,logout, andstatus. This completes the authenticate-to-the-registry loop (the registry side shipped inprotostar-registry).auth login— OAuth Authorization Code + PKCE over a loopback redirect (RFC 8252). Opens the browser to the registry, which federates sign-in to GitHub; catches the code on an ephemeral127.0.0.1port, exchanges it for tokens, and stores the session in the OS credential store (Devlooped.CredentialManager, the same dependency the skills use).--no-browserprints the URL for headless use;--timeoutbounds the wait.auth status— reports the stored session and verifies it against the registry (refreshing an expired access token when possible). Works offline: no session → "Not logged in".auth logout— removes the stored session.--registry <url>orPROTOSTAR_REGISTRY_URL.GET /v1/meta), matching the registry's versioning policy.Design notes
Auth/helpers: PKCE, loopback listener, token store, registry HTTP client + DTOs, browser launcher, endpoint/compat resolution. Commands live underCommands/Auth/and mirror the existing Spectre.Console.Cli command style (syncExecutewrapping the async flow).Verification
dotnet testgreen — 9/9 acceptance scenarios (7 existing + 2 new inAuth.feature:auth --helplists the subcommands;auth statusreports not-logged-in with no session).protostar-registry: the compat check passes, and the authorization request the CLI builds is accepted by OpenIddict and 302-redirects to GitHub (https://github.com/login/oauth/authorize) — confirmingclient_id, the loopbackredirect_uri(port ignored as designed), PKCE, and scopes all line up. The GitHub consent + token-exchange leg requires a real GitHub OAuth app and an interactive browser, so it stays a manual smoke.Completes PROT-7.