Skip to content

AccountScope: let internal-ID callers match groups that store registered accounts' external IDs #1868

Closed

Description

@cristim

Found in the review of #1858 (CodeRabbit thread on the direct RI-exchange list scope).

AccountScope.Allows(id, name) (internal/auth/account_scope.go:190-202) matches a registered account by its internal ID, or by a unique name whose external ID equals the id. A group whose allowed_accounts holds only a registered account's external (provider) ID, kept verbatim by bindGroupAccounts (internal/api/handler_groups.go:167), therefore does not match handlers that pass the internal ID (RI exchange reshape handler_ri_exchange.go:1416, revoke handler_purchases_revoke.go:556, the direct-exchange list and resolve). It fails closed (the row reads as missing), so it is a usability gap, not a leak.

Expected: decide whether groups may store external IDs for registered accounts; if so, make Allows resolve an internal ID through its account's external ID (with the existing guard against an external ID that is also an internal ID), with tests for each handler; if not, reject or normalise external IDs when the group is saved.

Severity: low.

Activity

  1. cristim commented on Nov 12, 2026

    @cristim
    MemberAuthor

    Claimed by claude-platform under the owner rule. Decision (owner-decisions 28, recommended default): normalise external IDs to internal IDs when a group is saved, so the stored allowed_accounts holds internal IDs and AccountScope.Allows is unchanged. Existing groups are not rewritten; they keep failing closed as today. Implementation in progress.

  2. added a commit that references this issue on Nov 12, 2026
    8ef9942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions