Skip to content

Follow-ups from Spec 108-c client credentials review (#1389) #1395

Closed

Description

@Dumbris

Follow-up findings from the zcode (GLM-5.3) review of #1389 that were below the merge bar (no critical/high). Each was verified against the code; fix in small PRs.

  • low — internal/storage/client_credentials.go:190-192: StageClientCredentialRotation returns ErrClientCredentialActive ("client credential is active; use rotation instead of mint") when the target record is actually revoked/expired — the inverse of what the sentinel text asserts and the wrong classification for a caller that branches on it to decide mint-vs-rotate remediation.
  • low — internal/storage/client_credentials.go:391-408: ForgetClientCredential is the one client-credential mutation that is not a single bbolt transaction: it reads the record via GetAgentTokenByName (a separate RLock/View) and revokes by name via RevokeAgentToken (a separate Lock/Update, re-resolved by name). A concurrent MintClientCredential replacing an expiring record between the two locks makes the second call revoke the newer record while the function returns the caller stale TokenHash/TokenPrefix from the record it originally inspected.
  • low — internal/storage/client_credentials_test.go:67-93: T028's claim 'mint replaces an existing revoked OR expired kind=client record' is only tested for the revoked variant (TestMintClientCredential_ReplacesRevokedOrExpired revokes, never lets a record actually expire before re-minting).
  • low — internal/server/session_store.go:449-483: FR-028 ('sessions MUST record the authenticating token name and client id at initialize') has SetSessionIdentity/UpdateSessionProfile/SessionsForToken implemented and unit-tested, but zero production callers anywhere in the repo — nothing stamps TokenName/ClientID at session initialize. The commit message names only the 'session→server-instance map' as deferred, which reads as though identity-stamping itself landed; tasks.md's own ledger is more honest (T039 is left unchecked). Downgraded from zcode's 'medium': this is staged-PR practice consistent with the rest of this PR (ResolveProfileV3 is likewise unwired and explicitly not to be treated as a defect), not a new inconsistency, so I file it as a low completeness note rather than a functional gap.

Activity

  1. added
    kind/bug
    priority/low
    triage/accepted
    on Sep 26, 2026
  2. Dumbris commented on Sep 29, 2026

    @Dumbris
    MemberAuthor

    Items 1-3 (stage error classification, atomic forget, expired-variant mint test) are addressed in #1419. Remaining: item 4 (FR-028, stamping token name/client id at MCP session initialize) is still open; nothing in production calls SetSessionIdentity yet.

  3. Dumbris commented on Oct 6, 2026

    @Dumbris
    MemberAuthor

    Triage on 2026-10-05 against main 8442428: All 4 items fixed. Items 1-3 by #1419 (client_credentials.go single-tx forget, ReplacesExpired test). FR-028 SetSessionIdentity is now called in the initialize hook at internal/server/mcp.go:541 (#1430). The maintainer comment saying item 4 was still open predates that merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugpriority/lowtriage/accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions