Class AuthRequestValidator

  • All Implemented Interfaces:
    org.springframework.validation.Validator

    @Component
    @Primary
    public class AuthRequestValidator
    extends BaseAuthRequestValidator
    This class validates the parameters for Authorization Request. The class AuthRequestValidator validates AuthRequestDTO
    Author:
    Manoj SP, Rakesh Roshan
    • Constructor Detail

      • AuthRequestValidator

        public AuthRequestValidator()
    • Method Detail

      • initialize

        @PostConstruct
        public void initialize()
      • supports

        public boolean supports​(Class<?> clazz)
        Supports.
        Specified by:
        supports in interface org.springframework.validation.Validator
        Overrides:
        supports in class BaseAuthRequestValidator
        Parameters:
        clazz - the clazz
        Returns:
        true, if successful
      • validate

        public void validate​(Object target,
                             org.springframework.validation.Errors errors)
        Validate.
        Specified by:
        validate in interface org.springframework.validation.Validator
        Overrides:
        validate in class BaseAuthRequestValidator
        Parameters:
        target - the target
        errors - the errors
      • validateBiometrics

        protected void validateBiometrics​(List<BioIdentityInfoDTO> biometrics,
                                          String authTxnId,
                                          org.springframework.validation.Errors errors)
        Validate biometric timestamps.
        Parameters:
        biometrics - the biometrics
        authTxnId -
        errors - the errors
      • validateSuccessiveDigitalIdTimestamp

        protected void validateSuccessiveDigitalIdTimestamp​(List<BioIdentityInfoDTO> biometrics,
                                                            org.springframework.validation.Errors errors,
                                                            int index,
                                                            BioIdentityInfoDTO bioIdentityInfoDTO,
                                                            Long allowedTimeDiffInSeconds)
      • validateDigitalIdTimestamp

        protected void validateDigitalIdTimestamp​(DigitalId digitalId,
                                                  org.springframework.validation.Errors errors,
                                                  String field)
        Validate digital id timestamp.
        Parameters:
        digitalId - the digital id
        errors - the errors
        field - the field
      • nullCheckDigitalIdAndTimestamp

        protected boolean nullCheckDigitalIdAndTimestamp​(DigitalId digitalId,
                                                         org.springframework.validation.Errors errors,
                                                         String field)
      • validateReqTime

        protected void validateReqTime​(String reqTime,
                                       org.springframework.validation.Errors errors,
                                       String paramName)
        Validate req time.
        Overrides:
        validateReqTime in class IdAuthValidator
        Parameters:
        reqTime - the req time
        errors - the errors
        paramName - the param name
      • validateReqTime

        protected void validateReqTime​(String reqTime,
                                       org.springframework.validation.Errors errors,
                                       String paramName,
                                       io.mosip.kernel.core.function.FunctionWithThrowable<Date,​String,​io.mosip.kernel.core.exception.ParseException> dateTimeParser)
        Validate req time.
        Overrides:
        validateReqTime in class IdAuthValidator
        Parameters:
        reqTime - the req time
        errors - the errors
        paramName - the param name
        dateTimeParser - the date time parser
      • validateDeviceDetails

        public void validateDeviceDetails​(AuthRequestDTO authRequest,
                                          org.springframework.validation.Errors errors)
        Validate device details.
        Parameters:
        authRequest - the auth request
        errors - the errors