Skip to content

ClientMetadataValidator owns the update rule: one validateUpdate method #364

Backlog

Description

@dfcoffin

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

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