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
ClientMetadataValidator owns the update rule: one validateUpdate method #364
Follow-up from the owner's design review of #361 (#344 part 3b).
Problem
ClientMetadataValidator owns the client-metadata rules shared by the admin API and /oauth2/register (#344, D2). For an update, though, the controller decides how they apply: OAuth2ClientManagementController.validated(client, request) merges the request's redirect URIs and scopes into the current client's metadata and picks which checks to run (validateRedirectUris only when redirect URIs are set, validateScopes only when scopes are set). The rule "an update checks only what it sets, against the client's grant types" lives outside the class that owns the rules, and the validator exposes two partial-check methods for it.
Proposed change
Give the validator one method for an update, e.g. validateUpdate(ClientMetadata current, List<String> redirectUris, List<String> scopes) (null = unchanged), that does the merge and chooses the checks. The controller calls only that; validateRedirectUris / validateScopes become private.
Acceptance
No behaviour change: the existing controller and validator tests pass unchanged, and the update tests move to the validator where they test rules.
The validator's public API is validate(metadata, policy) and validateUpdate(...).
Activity