Class IdInfoHelper
- java.lang.Object
-
- io.mosip.authentication.common.service.helper.IdInfoHelper
-
@Component public class IdInfoHelper extends Object
Helper class to build Authentication request.- Author:
- Dinesh Karuppiah.T
-
-
Constructor Summary
Constructors Constructor Description IdInfoHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>buildBioFilters(AuthRequestDTO authRequestDTO)To build the bio filters.Set<String>buildDemoAttributeFilters(AuthRequestDTO authRequestDTO)Builds the demo attribute filters.booleancontainsPhotoKYCAttribute(AuthRequestDTO authRequestDTO)Map<String,String>getAuthReqestInfo(MatchType matchType, AuthRequestDTO authRequestDTO)Get Authrequest Info.List<String>getBioSubTypes(io.mosip.kernel.biometrics.constant.BiometricType type)to get all bio subtypes for given type.List<String>getDataCapturedLanguages(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos)This method returns the list of data capture languages.Set<String>getDefaultFilterAttributes()Gets the default identity filter attributes from configuration.Map<String,String>getDynamicEntityInfo(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)Gets the dynamic entity info for ID Name.StringgetDynamicEntityInfoAsString(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)Map<String,String>getDynamicEntityInfoAsStringWithKey(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)Gets the dynamic entity info for ID Name.StringgetEntityInfoAsString(MatchType matchType, String langCode, Map<String,List<IdentityInfoDTO>> idEntity)Gets the entity info as string.StringgetEntityInfoAsString(MatchType matchType, Map<String,List<IdentityInfoDTO>> idEntity)Gets the entity info as string.Map<String,String>getEntityInfoAsStringWithKey(MatchType matchType, String langCode, Map<String,List<IdentityInfoDTO>> idEntity, String key)List<String>getIdentityAttributesForIdName(String idName)List<String>getIdentityAttributesForIdName(String idName, boolean isDynamic)Gets the identity attributes for id name.List<String>getIdentityAttributesForMatchType(MatchType matchType, String idName)Gets the property names for match type.Map<String,String>getIdEntityInfoMap(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos, String language)Gets the entity info map.Map<String,String>getIdEntityInfoMap(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos, String language, String idName)Gets the entity info map.List<String>getIdMappingValue(IdMapping idMapping, MatchType matchType)Gets the id mapping value.static Optional<String>getKycAttributeHasPhoto(List<String> allowedKycAttributes)booleanisBiometricDataNeeded(AuthRequestDTO authRequestDTO)static booleanisKycAttributeHasPhoto(EkycAuthRequestDTO authRequestDTO)booleanisMatchtypeEnabled(MatchType matchType)To check Whether Match type is Enabled.List<MatchOutput>matchIdentityData(AuthRequestDTO authRequestDTO, String uin, Collection<MatchInput> listMatchInputs, EntityValueFetcher entityValueFetcher, String partnerId)Match identity data.List<MatchOutput>matchIdentityData(AuthRequestDTO authRequestDTO, Map<String,List<IdentityInfoDTO>> identityEntity, Collection<MatchInput> listMatchInputs, String partnerId)Match id data.
-
-
-
Method Detail
-
getAuthReqestInfo
public Map<String,String> getAuthReqestInfo(MatchType matchType, AuthRequestDTO authRequestDTO)
Get Authrequest Info.- Parameters:
matchType- the match typeauthRequestDTO- the auth request DTO- Returns:
- the auth reqest info
-
getIdMappingValue
public List<String> getIdMappingValue(IdMapping idMapping, MatchType matchType) throws IdAuthenticationBusinessException
Gets the id mapping value.- Parameters:
idMapping- the id mappingmatchType- the match type- Returns:
- the id mapping value
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
isMatchtypeEnabled
public boolean isMatchtypeEnabled(MatchType matchType)
To check Whether Match type is Enabled.- Parameters:
matchType- the match type- Returns:
- true, if is matchtype enabled
-
getEntityInfoAsString
public String getEntityInfoAsString(MatchType matchType, Map<String,List<IdentityInfoDTO>> idEntity) throws IdAuthenticationBusinessException
Gets the entity info as string.- Parameters:
matchType- the match typeidEntity- the id entity- Returns:
- the entity info as string
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getEntityInfoAsString
public String getEntityInfoAsString(MatchType matchType, String langCode, Map<String,List<IdentityInfoDTO>> idEntity) throws IdAuthenticationBusinessException
Gets the entity info as string. Note: This method is not used during authentication match, so the separator used in concatenation will not be used during the match.- Parameters:
matchType- the match typelangCode- the lang codeidEntity- the id entity- Returns:
- the entity info as string
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getEntityInfoAsStringWithKey
public Map<String,String> getEntityInfoAsStringWithKey(MatchType matchType, String langCode, Map<String,List<IdentityInfoDTO>> idEntity, String key) throws IdAuthenticationBusinessException
-
getIdEntityInfoMap
public Map<String,String> getIdEntityInfoMap(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos, String language) throws IdAuthenticationBusinessException
Gets the entity info map.- Parameters:
matchType- the match typeidentityInfos- the id entitylanguage- the language- Returns:
- the entity info map
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getIdEntityInfoMap
public Map<String,String> getIdEntityInfoMap(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos, String language, String idName) throws IdAuthenticationBusinessException
Gets the entity info map.- Parameters:
matchType- the match typeidentityInfos- the id entitylanguage- the languageidName- the id name- Returns:
- the entity info map
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getDataCapturedLanguages
public List<String> getDataCapturedLanguages(MatchType matchType, Map<String,List<IdentityInfoDTO>> identityInfos) throws IdAuthenticationBusinessException
This method returns the list of data capture languages. These are used to send the notifications in data capture languages.- Parameters:
matchType- the match typeidentityInfos- the identity infos- Returns:
- the data captured languages
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
matchIdentityData
public List<MatchOutput> matchIdentityData(AuthRequestDTO authRequestDTO, Map<String,List<IdentityInfoDTO>> identityEntity, Collection<MatchInput> listMatchInputs, String partnerId) throws IdAuthenticationBusinessException
Match id data.- Parameters:
authRequestDTO- the identity DTOidentityEntity- the id entitylistMatchInputs- the list match inputspartnerId- the partner id- Returns:
- the list
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
matchIdentityData
public List<MatchOutput> matchIdentityData(AuthRequestDTO authRequestDTO, String uin, Collection<MatchInput> listMatchInputs, EntityValueFetcher entityValueFetcher, String partnerId) throws IdAuthenticationBusinessException
Match identity data.- Parameters:
authRequestDTO- the auth request DTOuin- the uinlistMatchInputs- the list match inputsentityValueFetcher- the entity value fetcherpartnerId- the partner id- Returns:
- the list
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
getDynamicEntityInfoAsStringWithKey
public Map<String,String> getDynamicEntityInfoAsStringWithKey(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)
Gets the dynamic entity info for ID Name.- Parameters:
filteredIdentityInfo- the filtered identity infolangCode- the lang codeidName- the id name- Returns:
- the entity for match type
-
getDynamicEntityInfoAsString
public String getDynamicEntityInfoAsString(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)
-
getDynamicEntityInfo
public Map<String,String> getDynamicEntityInfo(Map<String,List<IdentityInfoDTO>> filteredIdentityInfo, String langCode, String idName)
Gets the dynamic entity info for ID Name.- Parameters:
filteredIdentityInfo- the filtered identity infolangCode- the lang codeidName- the id name- Returns:
- the entity for match type
-
getDefaultFilterAttributes
public Set<String> getDefaultFilterAttributes()
Gets the default identity filter attributes from configuration.- Returns:
- the default filter attributes
-
buildDemoAttributeFilters
public Set<String> buildDemoAttributeFilters(AuthRequestDTO authRequestDTO) throws IdAuthenticationBusinessException
Builds the demo attribute filters.- Parameters:
authRequestDTO- the auth request DTO- Returns:
- the sets the
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
buildBioFilters
public Set<String> buildBioFilters(AuthRequestDTO authRequestDTO)
To build the bio filters. These are used to decrypt only required bio attributes- Parameters:
authRequestDTO- the auth request DTO- Returns:
- the sets the
-
getBioSubTypes
public List<String> getBioSubTypes(io.mosip.kernel.biometrics.constant.BiometricType type)
to get all bio subtypes for given type.- Parameters:
type- the type- Returns:
- the bio sub types
-
getIdentityAttributesForMatchType
public List<String> getIdentityAttributesForMatchType(MatchType matchType, String idName)
Gets the property names for match type.- Parameters:
matchType- the match typeidName- the id name- Returns:
- the property names for match type
-
getIdentityAttributesForIdName
public List<String> getIdentityAttributesForIdName(String idName) throws IdAuthenticationBusinessException
-
getIdentityAttributesForIdName
public List<String> getIdentityAttributesForIdName(String idName, boolean isDynamic) throws IdAuthenticationBusinessException
Gets the identity attributes for id name.- Parameters:
idName- the id nameisDynamic- the is dynamic- Returns:
- the property names for id name
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
isBiometricDataNeeded
public boolean isBiometricDataNeeded(AuthRequestDTO authRequestDTO)
-
containsPhotoKYCAttribute
public boolean containsPhotoKYCAttribute(AuthRequestDTO authRequestDTO)
-
isKycAttributeHasPhoto
public static boolean isKycAttributeHasPhoto(EkycAuthRequestDTO authRequestDTO)
-
-