Class AuthRequestValidator
- java.lang.Object
-
- io.mosip.authentication.common.service.validator.IdAuthValidator
-
- io.mosip.authentication.common.service.validator.BaseAuthRequestValidator
-
- io.mosip.authentication.common.service.validator.AuthRequestValidator
-
- All Implemented Interfaces:
org.springframework.validation.Validator
@Component @Primary public class AuthRequestValidator extends BaseAuthRequestValidator
This class validates the parameters for Authorization Request. The classAuthRequestValidatorvalidates AuthRequestDTO- Author:
- Manoj SP, Rakesh Roshan
-
-
Field Summary
-
Fields inherited from class io.mosip.authentication.common.service.validator.BaseAuthRequestValidator
idInfoFetcher, idInfoHelper
-
Fields inherited from class io.mosip.authentication.common.service.validator.IdAuthValidator
MISSING_INPUT_PARAMETER, VALIDATE
-
-
Constructor Summary
Constructors Constructor Description AuthRequestValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetMaxFingerCount()Gets the max finger count.voidinitialize()protected booleannullCheckDigitalIdAndTimestamp(DigitalId digitalId, org.springframework.validation.Errors errors, String field)booleansupports(Class<?> clazz)Supports.voidvalidate(Object target, org.springframework.validation.Errors errors)Validate.protected voidvalidateBiometrics(List<BioIdentityInfoDTO> biometrics, String authTxnId, org.springframework.validation.Errors errors)Validate biometric timestamps.voidvalidateDeviceDetails(AuthRequestDTO authRequest, org.springframework.validation.Errors errors)Validate device details.protected voidvalidateDigitalIdTimestamp(DigitalId digitalId, org.springframework.validation.Errors errors, String field)Validate digital id timestamp.protected voidvalidateReqTime(String reqTime, org.springframework.validation.Errors errors, String paramName)Validate req time.protected voidvalidateReqTime(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.protected voidvalidateSuccessiveDigitalIdTimestamp(List<BioIdentityInfoDTO> biometrics, org.springframework.validation.Errors errors, int index, BioIdentityInfoDTO bioIdentityInfoDTO, Long allowedTimeDiffInSeconds)-
Methods inherited from class io.mosip.authentication.common.service.validator.BaseAuthRequestValidator
checkDemoAuth, getMaxIrisCount, validateAdditionalFactorsDetails, validateAllowedAuthTypes, validateAuthType, validateBioMetadataDetails, validateLangCode
-
Methods inherited from class io.mosip.authentication.common.service.validator.IdAuthValidator
getAllowedAuthTypeProperty, getAllowedAuthTypes, getAllowedIdTypes, getAllowedIdTypesConfigVal, requestTimeParser, validateConsentReq, validateId, validateIdvId, validateIdvId, validateRequestTimedOut, validateRequestTimedOut, validateTxnId, validateTxnId
-
-
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
-
supports
public boolean supports(Class<?> clazz)
Supports.- Specified by:
supportsin interfaceorg.springframework.validation.Validator- Overrides:
supportsin classBaseAuthRequestValidator- Parameters:
clazz- the clazz- Returns:
- true, if successful
-
validate
public void validate(Object target, org.springframework.validation.Errors errors)
Validate.- Specified by:
validatein interfaceorg.springframework.validation.Validator- Overrides:
validatein classBaseAuthRequestValidator- Parameters:
target- the targeterrors- the errors
-
validateBiometrics
protected void validateBiometrics(List<BioIdentityInfoDTO> biometrics, String authTxnId, org.springframework.validation.Errors errors)
Validate biometric timestamps.- Parameters:
biometrics- the biometricsauthTxnId-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 iderrors- the errorsfield- 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:
validateReqTimein classIdAuthValidator- Parameters:
reqTime- the req timeerrors- the errorsparamName- 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:
validateReqTimein classIdAuthValidator- Parameters:
reqTime- the req timeerrors- the errorsparamName- the param namedateTimeParser- the date time parser
-
getMaxFingerCount
protected int getMaxFingerCount()
Gets the max finger count.- Specified by:
getMaxFingerCountin classBaseAuthRequestValidator- Returns:
- the max finger count
-
validateDeviceDetails
public void validateDeviceDetails(AuthRequestDTO authRequest, org.springframework.validation.Errors errors)
Validate device details.- Parameters:
authRequest- the auth requesterrors- the errors
-
-