You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4a24c48
Browse filesBrowse the repository at this point in the historyBrowse files
fix(auth): address Copilot review round 2 on the RFC 7009 revocation (#2144)
- `revokeStoredKeys`' pre-read of `getTokens` sat outside the best-effort
catch. `getTokens` parses through `OAuthTokensSchema`, so a persisted token
that no longer validates rejected and abandoned the local delete `--relogin`
promises — over a grant that could not have been revoked anyway. Caught and
retained as a failed outcome; the clear proceeds.
- The multi-key bookkeeping was wrong twice. A token is now marked spent only
on a `revoked` outcome, so a failed or unsupported attempt no longer skips a
duplicate entry under the other key that may hold the credentials or metadata
that would have worked. And a failure now outranks an earlier success for
reporting, so a stale grant left live cannot be hidden behind the first key's
200.
- `--no-revoke` is now rejected without `--relogin`, ahead of the short-circuit
returns, matching the parser's existing stance on accepted-but-inert flags
(`--strict`). On its own it reads as "this run will not revoke anything",
true only because nothing was being cleared.
- Extracted the App draft merge as `utils/serverWithDraftSettings`, so the rule
has a test. The hook tests receive whatever they are handed and cannot tell a
draft from a persisted entry, and `App.test.tsx`'s settings harness connects
a stdio server where the OAuth section never renders.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh
Signed-off-by: cliffhall <cliff@futurescale.com>
Copy file name to clipboardExpand all lines: clients/cli/src/cli.ts
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -780,7 +780,7 @@ async function parseArgs(argv?: string[]): Promise<ParseResult> {
780
780
)
781
781
.option(
782
782
"--no-revoke",
783
-
"With --relogin, skip the RFC 7009 revocation request that would otherwise end the grant at the authorization server before the local state is deleted. Also skipped when the server entry sets oauth.revokeOnClear to false.",
783
+
"Requires --relogin. Skips the RFC 7009 revocation request that would otherwise end the grant at the authorization server before the local state is deleted. Also skipped when the server entry sets oauth.revokeOnClear to false.",
784
784
)
785
785
.option(
786
786
"--wait-for-auth <sec>",
@@ -867,6 +867,15 @@ async function parseArgs(argv?: string[]): Promise<ParseResult> {
867
867
}
868
868
}
869
869
870
+
// `--no-revoke` only means anything alongside `--relogin` — it suppresses the
871
+
// RFC 7009 request that clear makes. Accepted on its own it is inert, and
872
+
// worse than inert: it reads as "this run will not revoke anything", which is
873
+
// true only because nothing was going to be cleared. Rejected here, ahead of
874
+
// the short-circuit returns, for the same reason `--strict` is (#2144).
875
+
if(options.revoke===false&&!options.relogin){
876
+
thrownewError("--no-revoke requires --relogin (it has no other effect).");
877
+
}
878
+
870
879
// `--strict` is checked HERE, ahead of every short-circuit return below
0 commit comments