Class AuthorizedClientEntityValidator

java.lang.Object
com.broadleafcommerce.auth.server.validation.AuthorizedClientEntityValidator
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

public class AuthorizedClientEntityValidator extends Object implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validator targeting AuthorizationServer
  • Constructor Details

  • Method Details

    • supports

      public boolean supports(Class<?> serviceClass, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      supports in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validate

      public void validate(Object businessInstance, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      validate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validateForUpdate

      public void validateForUpdate(@NonNull Object updatedBusinessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      validateForUpdate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • hasApiKeys

      protected boolean hasApiKeys(AuthorizedClient authorizedClient)
      Parameters:
      authorizedClient - the client instance to check API key existence for
      Returns:
      true if the client has existing API keys (regardless of enabled/disabled status), false otherwise Authentication Service 3.0.0, Release Train 3.0.0
    • validateMutationRelatedToApiKeys

      protected void validateMutationRelatedToApiKeys(AuthorizedClient updatedInstance, AuthorizedClient originalInstance, org.springframework.validation.Errors errors)
    • validateApiKeyRules

      protected void validateApiKeyRules(Object businessInstance, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Validates rules when the client is defined as an API Key account.
      Parameters:
      businessInstance - instance to validate
      errors - object on which to register errors
      context - context information around multitenant state Authentication Service 3.0.0, Release Train 3.0.0
    • validateRequiredFields

      protected void validateRequiredFields(Object businessInstance, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • validateGrantTypes

      protected void validateGrantTypes(Object businessInstance, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • addRequiredField

      protected void addRequiredField(String name, String messageKey, String defaultMessage)
    • getApiKeyService

      protected ApiKeyService<ApiKey> getApiKeyService()
    • setApiKeyService

      @Autowired @Lazy public void setApiKeyService(ApiKeyService<ApiKey> apiKeyService)
    • getAuthorizedClientService

      protected AuthorizedClientService<AuthorizedClient> getAuthorizedClientService()
    • setAuthorizedClientService

      @Autowired @Lazy public void setAuthorizedClientService(AuthorizedClientService<AuthorizedClient> authorizedClientService)