Skip to content

Admin single-token revocation through ClientAdminService, with the client row lock #363

Backlog

Description

@dfcoffin

Follow-up from the owner's design review of #361 (#344 part 3b).

Problem

Every admin change to a client goes through ClientAdminService: one transaction that locks the client's row first (SELECT ... FOR UPDATE by client_id), then writes and audits. Revoking one access token does not: OAuthAdminController.revokeToken (POST /admin/oauth2/tokens/revoke) calls Spring's OAuth2AuthorizationService.findByToken / remove directly, reads the client for the audit, and takes no lock. So:

  • it can interleave with a delete of the same client (the audit then records client_id (unknown));
  • admin writes have two paths, with the transaction, lock and audit rules kept in two places.

Proposed change

Move single-token revocation into ClientAdminService (e.g. revokeToken(token)), in one transaction that locks the token's client row by client_id first, as revokeTokens(clientId) does, then removes the authorization. The controller keeps only the HTTP rules of #360 (form body only, no query string) and the audit.

Acceptance

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions