Skip to content

Commit 63221b5

Browse files
Sophclaude
andcommitted
logout: rename revokeCurrentFunc -> boundRevokeFunc
The single revoke func runLogout takes can now represent either the current session or every session on the core (--everywhere), so the old "Current" name was misleading. Rename to boundRevokeFunc and note the current-or-all semantics — it contrasts with the unbound revokeTargetFunc (coreURL + token still open) used by the --all-contexts sweep. Addresses PR #1360 review feedback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 1e0358381bae
1 parent 1ea54e2 commit 63221b5

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

cmd/entire/cli/logout.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ type tokenStore interface {
2020
DeleteToken(baseURL string) error
2121
}
2222

23-
// revokeCurrentFunc revokes the CLI's current login session server-side.
24-
// The caller resolves the active context's core URL + bearer up-front and
25-
// binds them into the closure, so the revocation hits the same core that
26-
// `auth status` lists.
27-
type revokeCurrentFunc func(ctx context.Context) error
23+
// boundRevokeFunc revokes login session(s) server-side — either just the
24+
// current session or every session on the core, depending on which the caller
25+
// selected (--everywhere). The caller resolves the active context's core URL +
26+
// bearer up-front and binds them into the closure, so the revocation hits the
27+
// same core that `auth status` lists.
28+
type boundRevokeFunc func(ctx context.Context) error
2829

2930
// clearContextFunc removes the active contexts.json context (and its
3031
// keyring token) so logout actually logs out under the contexts model.
@@ -147,7 +148,7 @@ func revokeAllAuthSessions(ctx context.Context, coreURL, token string) error {
147148
// when --everywhere is set. Either way the local keyring entry and active
148149
// context are removed, so the CLI reports logged-out even if the server call
149150
// fails.
150-
func runLogout(ctx context.Context, outW, errW io.Writer, store tokenStore, revoke revokeCurrentFunc, clearContext clearContextFunc, baseURL string) error {
151+
func runLogout(ctx context.Context, outW, errW io.Writer, store tokenStore, revoke boundRevokeFunc, clearContext clearContextFunc, baseURL string) error {
151152
token, err := store.GetToken(baseURL)
152153
if err != nil {
153154
// Fall through to the local delete: we still want the keyring entry

0 commit comments

Comments
 (0)