To make the validation API:s more consistent, I suggest that they use validation contexts instead of multiple parameters where applicable. When reviewing the current code base that means to change the following (breaking change):
- IAuthorizeRequestValidator.ValidateAsync (two parameters -> AuthorizeRequestValidationContext)
- IDeviceAuthorizationRequestValidator.ValidateAsync (two parameters -> DeviceAuthorizationRequestValidationContext)
- IEndSessionRequestValidator.ValidateAsync (two parameters -> EndSessionRequestValidationContext)
- IEndSessionRequestValidator.ValidateCallbackAsync (single parameter, but for consistency ->EndSessionRequestValidationContext with Subject null (or include the Subject even if it isn't used))
- IIntrospectionRequestValidator.ValidateAsync (two parameters -> IntrospectionRequestValidationContext)
- JwtRequestValidator.ValidateAsync (two parameters -> JwtRequestValidationContext)
- Also add interface for consistency
- IRedirectUriValidator.IsRedirectUriValidAsync (two parameters ->RedirectUriValidationContext)
- IRedirectUriValidator.IsPostLogoutRedirectUriValidAsync (two parameters -> RedirectUriValidationContext)
- ITokenRequestValidator.ValidateRequestAsync (two parameters -> TokenRequestValidationContext)
- ITokenRevocationRequestValidator.ValidateRequestAsync (two parameters -> TokenRevocationRequestValidationContext)
- ITokenValidator.ValidateAccessTokenAsync (two paramters -> AccessTokenValidationContext)
- ITokenValidator.ValidateIdentityTokenAsync (three parameters -> IdentityTokenValidationContext)
To be completly constistent the ISecretValidator (and ISecretsListValidator) should also be changed, but I suspect a bigger risk for breaking implementations so maybe leave them for now.
I can make this re-factoring if you find the suggestions to be good.
To make the validation API:s more consistent, I suggest that they use validation contexts instead of multiple parameters where applicable. When reviewing the current code base that means to change the following (breaking change):
To be completly constistent the ISecretValidator (and ISecretsListValidator) should also be changed, but I suspect a bigger risk for breaking implementations so maybe leave them for now.
I can make this re-factoring if you find the suggestions to be good.