Repository navigation
[TW-6922] fix(cli): address remaining OAuth review items (#14, #15, #21, #22, #24, N11) - #126
Open
radenkovic wants to merge 1 commit into
Open
radenkovic wants to merge 1 commit into
radenkovic wants to merge 1 commit into
Conversation
…N11) #14: isOAuthSession returns (bool, error). A keyring read error is reported instead of being read as "not an OAuth session", so refresh no longer calls account.Refresh on an OAuth session, a failed read no longer counts as "no dashboard login session", and `orgs switch` reports it. #15: dpop.New reports a malformed or wrong-length stored seed instead of replacing it. `oauth logout` checks the dashboard session's origin before it builds the DPoP service, so it never creates a key when there is no OAuth dashboard session. #21: the oauth package no longer wires the dashboard hooks from init(); main.go calls oauth.WireDashboard explicitly. #22: `oauth status`, `login` and `logout` honour --json, --format yaml and --quiet through common.GetOutputWriter. Structured output never carries a token. #24: ARCHITECTURE.md lists the new ports (oauthas, lock, mcp credentials) and the oauthas and filelock adapters. N11: the "kept your dashboard login session" message says to run `nylas dashboard logout` if that session has expired. Oversized test files touched by this PR are split under 600 lines with no test changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why this PR exists
These are the last review fixes from the TW-6922 CLI OAuth work. The commit (
5ce9a94, 2026-10-08) was made ontw-6922-cli-oauthafter #123 had been squash-merged, so it never reachedmain. GitHub had already auto-deleted the remote branch, which left the local branch as its only copy. This PR cherry-picks it onto currentmainunchanged; it applied with no conflicts.What it changes
isOAuthSessionreturns(bool, error). A keyring read error is now reported instead of being treated as "not an OAuth session". Sorefreshno longer callsaccount.Refreshon an OAuth session, a failed read no longer counts as "no dashboard login session", andorgs switchreports the error.dpop.Newreports a malformed or wrong-length stored seed instead of silently replacing it.oauth logoutchecks the dashboard session's origin before building the DPoP service, so it never creates a key when there is no OAuth dashboard session.init().main.gocallsoauth.WireDashboard()explicitly.oauth status,loginandlogouthonour--json,--format yamland--quietthroughcommon.GetOutputWriter. Structured output never carries a token, and in structured mode the browser prompt goes to stderr.ARCHITECTURE.mdlists the new ports (oauthas,lock, MCP credentials) and adapters.Verification
On this branch rebased onto
main:go build,go vet,make lint(0 issues) andgo test -race ./...all pass.There's one small hunk in
internal/cli/oauth/login.go, around the pre-login prompt. Whichever PR merges second needs a rebase. When resolving it, apply #22's rule to the device prompt too: in structured output (--json/--format yaml), the device code and verification URL go to stderr so stdout carries only the report, and--quietmust not hide the code, since the user can't sign in without it.🤖 Generated with Claude Code