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
Admin single-token revocation through ClientAdminService, with the client row lock #363
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
Single-token revocation locks the client's row like the other admin writes, and the docs' locking paragraph (OAUTH2_CLIENT_MANAGEMENT_API.md) covers it again.
Activity