Skip to content

Commit

Permalink
Merge develop 2 rc2 normalization fix (#790)
Browse files Browse the repository at this point in the history
* MOSIP-18085: Upgraded swagger2 to openapi3 for authentication service

* MOSIP-18085: Upgraded swagger2 to openapi3 for Id Authentication Internal Service

* MOSIP-18085: Added Authorization headers

* MOSIP-18085: Added Authorization headers in internal service

* MOSIP-18085: Upgraded swagger to openapi for otp services.

* MOSIP-18085: Added header in kyc and fixed sorting tags.

* MOSIP-18085: Removed common properties for sorting of openapi tags.

* Added default filter attributes to configuration (#596)

* Added default filter attributes to configuration

* Code updated

* Mosip 18119 auto allow new dynamic attributes for authentication (#598)

* Fixes in demo auth dynamic attributes

* Fixed error message for decoding failure

* Fix in fetching postal code for auth anonym profile

* WIP for dynamic attribute auto match

* Allow new dynamic attrib for auth without mapping

* Removed unwanted comment

* Fix age not match err msg (#599)

* Fixes in demo auth dynamic attributes

* Fixed error message for decoding failure

* Fix in fetching postal code for auth anonym profile

* WIP for dynamic attribute auto match

* Allow new dynamic attrib for auth without mapping

* Removed unwanted comment

* Fix in age not match error msg

* Fix bio auth type check issue due to case sensitive check (#600)

* Fix bio auth type check issue due to case sensitive check

* Minor fix

* junit test cases for AuthAnonymousProfileServiceImpl.java (#604)

* Mosip 18252 dsl bio auth fix (#609)

* Fix bio auth type check issue due to case sensitive check

* Minor fix

* Added missing Face for ekyc request in filter

* Fixed otp kyc filter NPE issue due to null bio (#615)

* Fixed multi modal auth cbeff load issue (#617)

* Fixed ekyc face retrival issue (#619)

* MOSIP-18366,MOSIP-18370 bio type subtype error message correction (#621)

* Fixed biotype,biosubtype related error messages

* Fix NPE for null idtype

* Test fixes

* Revert debug code for idserviceimpl

* test cases updated (#620)

* IdInfoHelper Test cases updated (#623)

* Fix dynamic attribute language code issue (#624)

* KycController updated with test cases (#625)

* Fixed test case failure (#626)

* updated test cases (#627)

* Revert "updated test cases" (#628)

This reverts commit 5cb0b79758ede70509ff7e0cbe864e9589434cff.

* Mosip 18411,MOSIP-17587 fix filter attrip for ekyc (#632)

* Fixed keymanager bean loading issue

* MOSIP-18411 fixed kyc attribute filtered out issue

* MOSIP-17587-Fix status for ekyc auth in anonym profile

* Mosip 18191 fix bio auth segment timestamp validation issue (#633)

* Fix duplicate type code in kyc auth txn entry

* MOSIP-18191 fix segment timestamp validation not working

* Added null check for auth type code duplicate condition

* MOSIP-18265 Added column to key alias table (#638)

* CredentialServiceImplTest (#636)

Co-authored-by: Vipul Dhurve <[email protected]>

* MOSIP-18053-fixed duplicate match inputs for multiple dynamic attrib in auth req (#640)

* MOSIP-18053-fixed duplicate match inputs for multiple dynamic attrib in req

* added jdoc

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop (#641)

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop (#643)

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop

* [MOSIP-18119] Fixed test case failures

* Removed unnecessary db call (#645)

* MOSIP-18377 Column addition to indices (#649)

* MOSIP-16182 Add unique constraint to cert thumbprint column (#651)

* CredentialStoreServiceImplTest (#654)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

Co-authored-by: Vipul Dhurve <[email protected]>

* MatchInputBuilderTest test cases (#655)

* [MOSIP-17776] added temp logging for debugging (#658)

* [MOSIP-17776] reverted debugging code (#659)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* AuthTransactionHelperTest updated with test cases (#657)

* [MOSIP-9803] Updated swagger to accept Authorization header (#661)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* [MOSIP-9803] Updated swagger to accept Authorization header

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-9803] Updated swagger to accept Authorization header

* Created test class for HotlistServiceImpl (#660)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Mosip 18419 integrate with auth adapter for offline token validation (#656)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Mosip 18419 integrate with auth adapter for offline token validation 2 (#662)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Fixed missing env declaration in dockerfile

* Mosip 18419 integrate with auth adapter for offline token validation 3 (#663)

* Using RestHelper from ID Repo Core

* Fixes in rest helper config

* Added auth adapter download in docker cmd

* Fix compilation issue

* Fixed missing env declaration in dockerfile

* Added jar to classpath

* Mosip 18523 perf fixes (#665)

* Add cacheable to uin hash salt repo

* Minor refactor

* Fix to cache key

* MOSIP-16182 Composite unique key for ca cert store (#667)

* Created test class for WebSubHelper (#669)

* CredentialStoreServiceImplTest update

* CredentialStoreServiceImplTest update

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for HotlistServiceImpl: HotlistServiceImplTest

* Created Test class for WebSubHelper: WebSubHelperTest

* Created Test class for WebSubHelper: WebSubHelperTest

* Created Test class for WebSubHelper: WebSubHelperTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Integrate with resthelper-issue-fix (#671)

* Fix perf issue to use substring based logic for salt key calculation instead of modulo (#670)

* Added @transactional to handle duplicate requests (#678)

* Merge sonar coverage (#680)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Merge sonar coverage 2 (#681)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

* Added json to classpath

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Merge sonar coverage 2 (#682)

* updated test cases

* updated test cases

* KycFacadeImplTest class test cases updated

* Test fix

* Added json to classpath

* Test fix

Co-authored-by: Neosoft_MamtaA <[email protected]>

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest (#683)

Co-authored-by: Vipul Dhurve <[email protected]>

* Created Test Class for IdAuthFraudAnalysisEventManager (#684)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Created Test class for PartnerServiceCallbackController (#685)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Created test class for PartnerServiceEventsInitializer (#686)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created test class for PartnerServiceEventsInitializer => PartnerServiceEventsInitializerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Fix in setting the policy metadata for authToken issue (#687)

* Mosip 18612 perf fix resp to map conversion 3 (#690)

* Fixed repeated request body parsing

* WIP - updated controller side

* Added missing class

* setting id version on respnse obj creation

* Fixed respTime, transaction ID Store, send Error

* Store auth txn and anonym profile

* Test fixes

* Fix to load missing bean

* WIP - Fixes in id version and anonym prof

* Fix in errors in anonym prof

* Reverted debug idserviceimpl

* Fix for error code in anonym prof for match failure

* Fixes to store auth txn and anonym prof on err

* Revert debug idserviceimpl

* Fix test failure

* reated test class for IdChangeEventsInitializer  (#692)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created test class for PartnerServiceEventsInitializer => PartnerServiceEventsInitializerTest

* Created test class for IdChangeEventsInitializer => IdChangeEventsInitializerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Moved test classes to test src (#693)

* Mosip 17586 sonar fix (#694)

* Moved test classes to test src

* fix package

* Fix unique ID creation logic (#696)

* [MOSIP-18119] Fixed send otp timestamp mismatch (#695)

* [MOSIP-18119] Updated Notification timestamp based on timezone in prop

* [MOSIP-18119] Fixed test case failures

* [MOSIP-18119] Fixed send otp timestamp mismatch

* [MOSIP-18119] Fixed send otp timestamp mismatch

* [MOSIP-1819] Updated test cases

* [MOSIP-18119] Fixed send otp timestamp mismatch

* removed debug code (#699)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-18119] removed debug code

* Test coverage for websub initializers (#700)

* MOSIP-18606-purging cache on ca cert update event (#703)

* [MOSIP-18893] Fixed comment as valid json string in fraud analytics (#705)

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-18119] removed debug code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-17776] added temp logging for debugging

* [MOSIP-17776] reverted debugging code

* [MOSIP-18893] Fixed comment as valid json string in fraud analytics

* Fixed internal otp notif issue due to internal rest helper issue (#707)

* Fixed internal otp notif issue due to internal rest helper issue

* Test Fix

* Created test class for CredentialRequestManager  (#702)

* Created Test class for MissingCredentialsItemReader => MissingCredentialsItemReaderTest

* Created Test Class for IdAuthFraudAnalysisEventManager =>IdAuthFraudAnalysisEventManagerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created Test Class for PartnerServiceCallbackController =>PartnerServiceCallbackControllerTest

* Created test class for PartnerServiceEventsInitializer => PartnerServiceEventsInitializerTest

* Created test class for IdChangeEventsInitializer => IdChangeEventsInitializerTest

* Created test class for CredentialRequestManager => CredentialRequestManagerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Corrected salt modulo logic to last digits of use hash of id (#709)

* MOSIP-18085: Generated openapi.json for IDA- Authentication Service

* MOSIP-18085: Code Reformat

* Fix keymanager role bean issue (#715)

* Fix for internal auth issue

* Imported keymgr auth roles beans

* Updated Test class for IdInfoHelper (#713)

* Updated Test class for IdInfoHelper => IdInfoHelperTest

* Updated Test class for IdInfoHelper => IdInfoHelperTest

* Updated Test class for IdInfoHelper => IdInfoHelperTest

Co-authored-by: Vipul Dhurve <[email protected]>

* MOSIP-18085: Generate openapi.json for IDA-OTP service.

* MOSIP-18085: Generate openapi.json for IDA-Internal service.

* MOSIP-18085: Removed extra properties from authentication-internal-service test folder.

* MOSIP-18085: Removed extra properties from authentication-internal-service test folder.

* MOSIP-18085: Generated openapi.json for IDA- Authentication, Internal, OTP Service (#714)

* MOSIP-18085: Upgraded swagger2 to openapi3 for authentication service

* MOSIP-18085: Upgraded swagger2 to openapi3 for Id Authentication Internal Service

* MOSIP-18085: Added Authorization headers

* MOSIP-18085: Added Authorization headers in internal service

* MOSIP-18085: Upgraded swagger to openapi for otp services.

* MOSIP-18085: Added header in kyc and fixed sorting tags.

* MOSIP-18085: Removed common properties for sorting of openapi tags.

* MOSIP-18085: Generated openapi.json for IDA- Authentication Service

* MOSIP-18085: Code Reformat

* MOSIP-18085: Generate openapi.json for IDA-OTP service.

* MOSIP-18085: Generate openapi.json for IDA-Internal service.

* MOSIP-18085: Removed extra properties from authentication-internal-service test folder.

* MOSIP-18085: Removed extra properties from authentication-internal-service test folder.

* Update KycFilterTest.java (#717)

* Mosip 18908 integrate with websub client fix for callback url (#718)

* Integrated with new websubclient to load callback url from properties

* Temporariy ignoring failing test

* fix in json databind version for test failure due to open api dependency

* Created test class for IdValidationUtil (#719)

* Updated Test class for IdInfoHelper => IdInfoHelperTest

* Updated Test class for IdInfoHelper => IdInfoHelperTest

* Updated Test class for IdInfoHelper => IdInfoHelperTest

* Created Test class for IdValidationUtil => idValidationUtilTest

* Created Test class for IdValidationUtil => idValidationUtilTest

Co-authored-by: Vipul Dhurve <[email protected]>

* MOSIP-15286 changed openapi.json name

* MOSIP-15286 changed openapi.json name

* MOSIP-15286 changed openapi.json name

* MOSIP-15286 Removed extra properties

* Mosip 18908 integrate with websub client fix for callback url 1 (#721)

* Integrated with new websubclient to load callback url from properties

* Temporariy ignoring failing test

* fix in json databind version for test failure due to open api dependency

* Skip registering non-pubishing topics

* Mosip 18792 afterburner in objectmapper (#723)

* Integrated with new websubclient to load callback url from properties

* Temporariy ignoring failing test

* fix in json databind version for test failure due to open api dependency

* Skip registering non-pubishing topics

* Added afterburner in objectmapper

* Update db script for key alias and key policy tables (#725)

* Update db script for key alias and key policy tables

* Minor format

* Revert and fix object mapper and test fix (#726)

* Fixed dependency conflict due to jackson-databind (#727)

* Mosip 18406 add separator config support for full address (#729)

* Added separator config support for full address. Fix fetch non lang value

* Test fixes

* Updated test class

* Corrected bio subtype sep

* Minor refactoring

* Mosip 18406 add separator config support for full address 1 (#731)

* Added separator config support for full address. Fix fetch non lang value

* Test fixes

* Updated test class

* Corrected bio subtype sep

* Minor refactoring

* Added test case for full address matching

* [MOSIP-19008] Added property to enable/disable fraud analysis (#730)

* [MOSIP-19008] updated auth txn query to return count instead of object (#732)

* [MOSIP-19008] Added property to enable/disable fraud analysis

* [MOSIP-19008] updated auth txn query to return count instead of object

* [MOSIP-19008] updated auth txn query to return count instead of object

* [MOSIP-19008]Disabled fraud analysis websub based on property

* [MOSIP-19008]Disabled fraud analysis websub based on property

* [MOSIP-19008]Disabled fraud analysis websub based on property

* Mosip 18407 fix ekyc respononse identity (#733)

* Added separator config support for full address. Fix fetch non lang value

* Test fixes

* Updated test class

* Corrected bio subtype sep

* Minor refactoring

* Added test case for full address matching

* MOSIP-18407-fixed-kyc-attributes-fetch-logic

* Update push_trigger.yml (#734)

* Ida test fixes (#736)

* Test fix

* Fix partner subscription log

* MOSIP-19297-corrected auth type in notification by correcting the count predicate logic for disabled bio finger minutiea

* Test fix

* Updated test class for OtpServiceImpl => OtpServiceImplTest (#735)

Co-authored-by: Vipul Dhurve <[email protected]>

* [MOSIP-18655] Optimized env.getProperty method call to static for
performance

* [MOSIP-18655] Imported constants as static

* [MOSIP-18655] Optimized env.getProperty call to static for performance (#737)

* [MOSIP-18655] Optimized env.getProperty method call to static for
performance

* [MOSIP-18655] Imported constants as static

* Added a Bean to get Service Names as a Arraylist to RestRequestBuilder (#739)

* MOSIP-19360 Add uni_ident column with unq constraint (#741)

* MOSIP-19360 Add uni_ident column with unq constraint

* MOSIP-19370 Added 2 columns to key_policy_def

* [MOSIP-18655] Made EnvUtil as primary environment

* [MOSIP-18655] Optimized env.getProperty method call to static for
performance

* [MOSIP-18655] Added a Bean to get Service Names as a Arraylist to
RestRequestBuilder

* [MOSIP-18655] Made EnvUtil as primary environment (#742)

* [MOSIP-18655] Optimized env.getProperty method call to static for
performance

* [MOSIP-18655] Imported constants as static

* [MOSIP-18655] Made EnvUtil as primary environment

* [MOSIP-18655] Optimized env.getProperty method call to static for
performance

* [MOSIP-18655] Added a Bean to get Service Names as a Arraylist to
RestRequestBuilder

* MOSIP-19018-fix err msg if name is part of full address (#744)

* [MOSIP-18655] Updated EnvUtil with RefreshScope

* Created Test class for MosipAuthFilterFactory  (#743)

* Created Test class for MosipAuthFilterFactory => MosipAuthFilterFactoryTest

* Created Test Class for IdServiceImpl => IdServiceImplTest

Co-authored-by: Vipul Dhurve <[email protected]>

* [MOSIP-18655] reverted EnvUtil as RefreshScope (#745)

* [MOSIP-18655] Ignoring test cases temporarily (#746)

* [MOSIP-18655] reverted EnvUtil as RefreshScope

* [MOSIP-18655] Ignoring test cases temporarily

* Mosip 17586 sonar coverage (#747)

* junit tests

* Added debug print for maven build

* Mosip 17586 sonar coverage 1 (#748)

* junit tests

* Added debug print for maven build

* Added print trace

* Revert ignore (#749)

* Removed Vulnerability of Regular expressions to DoS(Denial of Service) (#751)

* Added a Bean to get Service Names as a Arraylist to RestRequestBuilder

* Removed vulnerability of Regular expression to DoS(Denial of Service)

* Revert "Removed vulnerability of Regular expression to DoS(Denial of Service)"

This reverts commit 49e2a73.

* Removed Vulnerability of Regular Expression to DoS(Denial of Service)

* Revert "Removed Vulnerability of Regular Expression to DoS(Denial of Service)"

This reverts commit 8922fb0.

* Revert "Merge branch 'develop' of https://github.com/balaji-alluru/id-authentication-1 into develop"

This reverts commit 00b5eb5, reversing
changes made to 34bb5b5.

* Removed Vulnerability of Regular expressions to DoS(Denial of Service)

* Added New Test cases (#752)

* [MOSIP-18655] Updated EnvUtil to implement env methods (#754)

* [MOSIP-18655] reverted EnvUtil as RefreshScope

* [MOSIP-18655] Ignoring test cases temporarily

* [MOSIP-18655] Updated EnvUtil to implement env methods

* Update push_trigger.yml

* Update push_trigger.yml

* fix duplicate key issue (#756)

* Fix env val for internal otp req validator (#757)

* Removed test unwanted (#759)

* Updated gpg signing keys.

* Created Test Class for IdServiceImpl (#762)

* Created Test CLass For IdServiceImpl => IdServiceImplTest

* Created Test CLass For IdServiceImpl => IdServiceImplTest

* Created Test CLass For IdServiceImpl => IdServiceImplTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Revert "Created Test Class for IdServiceImpl (#762)" (#764)

This reverts commit 9e689ff.

* Added New Test case (#763)

* Mosip 18208 fix anonym prof data (#765)

* fix partner name in anon prof

* Minor refactoring, test corrections with assertions

* Fix in column length limit in code

* Fix in photo attribute check

* Fix in bio time property

* Corrected attribute lengths, removed size for audit

* Added new test cases (#767)

* Updated test class for IdServiceImpl (#766)

* Updated test class for IdServiceImpl => IdServiceImplTest

* Updated test class for IdServiceImpl

* Updated test class for IdServiceImpl

Co-authored-by: Vipul Dhurve <[email protected]>

* ignoring failed new tests (#768)

* Updated Test cases for AuthRequestValidator class (#770)

* Added a Bean to get Service Names as a Arraylist to RestRequestBuilder

* Removed vulnerability of Regular expression to DoS(Denial of Service)

* Revert "Removed vulnerability of Regular expression to DoS(Denial of Service)"

This reverts commit 49e2a73.

* Removed Vulnerability of Regular Expression to DoS(Denial of Service)

* Revert "Removed Vulnerability of Regular Expression to DoS(Denial of Service)"

This reverts commit 8922fb0.

* Revert "Merge branch 'develop' of https://github.com/balaji-alluru/id-authentication-1 into develop"

This reverts commit 00b5eb5, reversing
changes made to 34bb5b5.

* Removed Vulnerability of Regular expressions to DoS(Denial of Service)

* Updated TestCases to AuthRequestValidator Class

* Update AuthRequestValidatorTest.java

* [MOSIP-19429] added thread pool with config prop and logic to monitor (#771)

* [MOSIP-19429] added thread pool with config prop and logic to monitor

* [MOSIP-19429] updated thread group count

* Added debug log (#772)

* Revert "Added debug log" (#773)

This reverts commit 1b2d328.

* Created test class for UpdateAythtypeStatusServiceImpl (#769)

* Created test class for UpdateAythtypeStatusServiceImpl => pdateAythtypeStatusServiceImplTest

* Created test class for UpdateAythtypeStatusServiceImpl => pdateAythtypeStatusServiceImplTest

* Created test class for UpdateAythtypeStatusServiceImpl => pdateAythtypeStatusServiceImplTest

* Created test class for UpdateAythtypeStatusServiceImpl => pdateAythtypeStatusServiceImplTest

* Created test class for UpdateAythtypeStatusServiceImpl => pdateAythtypeStatusServiceImplTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Updated Test class for InternalAuthController (#775)

* Updated Test class for InternalAuthController => InternalAUthCOntrollerTest

* Updated Test class for InternalAuthController => InternalAuthControllerTest

* Updated Test class for InternalAuthController => InternalAuthControllerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* New test cases added (#777)

* Ignoring failed tests (#779)

* Created test class for IdTypeUtil (#778)

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Resolved @ignore test cases (#781)

* Updated test case (#782)

* Created Test class for BytesUtil (#783)

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for HotlistScheduledCleanupJob => HotlistScheduledCleanupJobTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Created test class for HotlistScheduledCleanupJob (#785)

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for HotlistScheduledCleanupJob => HotlistScheduledCleanupJobTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Resolved ignore test cases (#786)

* Updated test cases (#788)

* Created test class for MasterDataCacheInitializer (#787)

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for IdTypeUtil => IdTypeUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for BytesUtil => BytesUtilTest

* Created test class for HotlistScheduledCleanupJob => HotlistScheduledCleanupJobTest

* Created test class for MasterDataCacheInitializer => MasterDataCacheInitializerTest

Co-authored-by: Vipul Dhurve <[email protected]>

* Mosip 19313 allow norm for name id attribs (#789)

* Added support to dynamic attrib norm if in name or fulladdr

* Added tests

* Minor refactoring

* Corrected internal service version for rc2

* Corrected open api dependency version

Co-authored-by: kameshsr <[email protected]>
Co-authored-by: kameshsr <[email protected]>
Co-authored-by: Nagarjuna K <[email protected]>
Co-authored-by: mamta-344 <[email protected]>
Co-authored-by: rambhatt1591 <[email protected]>
Co-authored-by: vipuldhurve02 <[email protected]>
Co-authored-by: Vipul Dhurve <[email protected]>
Co-authored-by: Manoj SP <[email protected]>
Co-authored-by: Neosoft_MamtaA <[email protected]>
Co-authored-by: Mandeep Dhiman <[email protected]>
Co-authored-by: Manoj SP <[email protected]>
Co-authored-by: Balaji Alluru <[email protected]>
Co-authored-by: Aiham Hasan <[email protected]>
Co-authored-by: mandeepdhiman123 <[email protected]>
  • Loading branch information
15 people authored Jan 18, 2022
1 parent 227b384 commit 2ec9624
Show file tree
Hide file tree
Showing 26 changed files with 1,565 additions and 1,158 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package io.mosip.authentication.common.service.builder;
import static io.mosip.authentication.core.constant.IdAuthCommonConstants.ID_NAME;
import static io.mosip.authentication.core.constant.IdAuthCommonConstants.MAPPING_CONFIG;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand All @@ -15,7 +18,6 @@
import io.mosip.authentication.common.service.impl.match.IdaIdMapping;
import io.mosip.authentication.common.service.util.EnvUtil;
import io.mosip.authentication.core.constant.IdAuthCommonConstants;
import io.mosip.authentication.core.constant.IdAuthConfigKeyConstants;
import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants;
import io.mosip.authentication.core.exception.IdAuthUncheckedException;
import io.mosip.authentication.core.indauth.dto.AuthRequestDTO;
Expand Down Expand Up @@ -317,7 +319,9 @@ private MatchInput contstructMatchInput(AuthRequestDTO authRequestDTO, String id
matchValue = matchThresholdOpt.orElseGet(() -> EnvUtil.getDefaultMatchValue());
}
}
Map<String, Object> matchProperties = authType.getMatchProperties(authRequestDTO, idInfoFetcher, language);
Map<String, Object> matchProperties = new HashMap<>(authType.getMatchProperties(authRequestDTO, idInfoFetcher, language));
matchProperties.put(ID_NAME, idName);
matchProperties.put(MAPPING_CONFIG, idInfoFetcher.getMappingConfig());
return new MatchInput(authType, idName, matchType, matchingStrategy, matchValue, matchProperties, language);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package io.mosip.authentication.common.service.impl.match;
import static io.mosip.authentication.core.constant.IdAuthCommonConstants.ID_NAME;
import static io.mosip.authentication.core.constant.IdAuthCommonConstants.MAPPING_CONFIG;

import java.util.Map;

import io.mosip.authentication.core.spi.indauth.match.MappingConfig;
import io.mosip.authentication.core.spi.indauth.match.MatchFunction;
import io.mosip.authentication.core.spi.indauth.match.MatchingStrategyType;
import io.mosip.authentication.core.spi.indauth.match.TextMatchingStrategy;
Expand All @@ -18,12 +21,33 @@ public enum DynamicDemoAttributeMatchingStrategy implements TextMatchingStrategy

EXACT(MatchingStrategyType.EXACT, (Object reqInfo, Object entityInfo, Map<String, Object> props) -> {
if (reqInfo instanceof String && entityInfo instanceof String) {
return getDemoMatcherUtilObject(props).doExactMatch((String) reqInfo, (String) entityInfo);
} if (reqInfo.equals(entityInfo)) {
DemoMatcherUtil demoMatcherUtilObject = getDemoMatcherUtilObject(props);
Object idNameObj = props.get(ID_NAME);
Object mappingConfigObj = props.get(MAPPING_CONFIG);
if(idNameObj instanceof String && mappingConfigObj instanceof MappingConfig) {
MappingConfig mappingConfig = (MappingConfig) mappingConfigObj;
String idName = (String) idNameObj;
if(isNameAttribute(idName, mappingConfig)) {
return TextMatchingStrategy.normalizeAndMatch(reqInfo,
entityInfo,
props,
NameMatchingStrategy::normalizeText,
demoMatcherUtilObject::doExactMatch);
} else if(isFullAddressAttribute(idName, mappingConfig)) {
return TextMatchingStrategy.normalizeAndMatch(reqInfo,
entityInfo,
props,
FullAddressMatchingStrategy::normalizeText,
demoMatcherUtilObject::doExactMatch);
}
}

return demoMatcherUtilObject.doExactMatch((String)reqInfo, (String)entityInfo);
} else if (reqInfo.equals(entityInfo)) {
return DemoMatcherUtil.EXACT_MATCH_VALUE;
} else {
return 0;
}

return 0;
});

/** The match function. */
Expand All @@ -43,6 +67,20 @@ private DynamicDemoAttributeMatchingStrategy(MatchingStrategyType matchStrategyT
this.matchStrategyType = matchStrategyType;
}

private static boolean isFullAddressAttribute(String idName, MappingConfig mappingConfig) {
return IdaIdMapping.FULLADDRESS
.getMappingFunction()
.apply(mappingConfig, DemoMatchType.ADDR)
.contains(idName);
}

private static boolean isNameAttribute(String idName, MappingConfig mappingConfig) {
return IdaIdMapping.NAME
.getMappingFunction()
.apply(mappingConfig, DemoMatchType.NAME)
.contains(idName);
}

/* (non-Javadoc)
* @see io.mosip.authentication.core.spi.indauth.match.MatchingStrategy#getType()
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package io.mosip.authentication.common.service.cache;

import io.mosip.authentication.core.exception.IdAuthUncheckedException;
import io.mosip.authentication.core.exception.IdAuthenticationBusinessException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.context.WebApplicationContext;

import java.io.IOException;

@WebMvcTest
@ContextConfiguration(classes = {TestContext.class, WebApplicationContext.class})
@RunWith(SpringRunner.class)
public class MasterDataCacheInitializerTest {

@InjectMocks
private MasterDataCacheInitializer masterDataCacheInitializer;

@Mock
private MasterDataCache masterDataCache;

/**
* This class tests the loadMasterData method
*
* @throws IdAuthenticationBusinessException the id authentication business
* exception
*/
@Test
public void loadMasterDataTest() throws IdAuthenticationBusinessException {
masterDataCacheInitializer.loadMasterData();
}

/**
* This class tests the onApplicationEvent method
*/
@Test
public void onApplicationEventTest(){
SpringApplication application = new SpringApplication();
ApplicationReadyEvent event = new ApplicationReadyEvent(application, new String[0], null);
masterDataCacheInitializer.onApplicationEvent(event);
}

/**
* This class tests the OnApplicationReadyEvent method
* in case IdAuthenticationBusinessException
*
* @throws IdAuthenticationBusinessException the id authentication business
* exception
*/
@Test(expected = IdAuthUncheckedException.class)
public void OnApplicationReadyEventExceptionTest() throws IdAuthenticationBusinessException {
SpringApplication application = new SpringApplication();
ApplicationReadyEvent event = new ApplicationReadyEvent(application, new String[0], null);
Mockito.doThrow(IdAuthenticationBusinessException.class).when(masterDataCache).getMasterDataTitles();
masterDataCacheInitializer.onApplicationEvent(event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void testHandleDataException() {
assertEquals(expectedResponse, actualResponse);
}
}

@Test
public void testHandleDataExceptionInternalAuthTxn() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/internal");
Expand Down Expand Up @@ -255,7 +255,7 @@ public void testHandleDataExceptionInternalAuthTxn() {
assertEquals(expectedResponse, actualResponse);
}
}

@Test
public void testHandleDataExceptionInternalOtp() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/internal");
Expand All @@ -280,7 +280,7 @@ public void testHandleDataExceptionInternalOtp() {
assertEquals(expectedResponse, actualResponse);
}
}

@Test
public void testHandleDataExceptionInternalAuthType() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/internal");
Expand All @@ -305,7 +305,7 @@ public void testHandleDataExceptionInternalAuthType() {
assertEquals(expectedResponse, actualResponse);
}
}

@Test
public void testHandleDataExceptionWithArgs() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/auth");
Expand All @@ -316,13 +316,13 @@ public void testHandleDataExceptionWithArgs() {
ResponseDTO res = new ResponseDTO();
res.setAuthStatus(Boolean.FALSE);
expectedResponse.setResponse(res);
expectedResponse.setErrors(
Collections.singletonList(new AuthError(IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorCode(),
expectedResponse.setErrors(Collections
.singletonList(new AuthError(IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorCode(),
IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorMessage())));

Errors errors = new BindException(expectedResponse, "BaseAuthResponseDTO");
errors.reject(IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorCode(),
new Object[] {"bioType"}, IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorMessage());
errors.reject(IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorCode(), new Object[] { "bioType" },
IdAuthenticationErrorConstants.INVALID_INPUT_PARAMETER.getErrorMessage());
try {
DataValidationUtil.validate(errors);
} catch (IDDataValidationException e) {
Expand All @@ -333,7 +333,7 @@ public void testHandleDataExceptionWithArgs() {
assertTrue(!actualResponse.getErrors().isEmpty());
}
}

@Test
public void testHandleDataExceptionWithArgsAndActionArgs() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/auth");
Expand All @@ -344,18 +344,19 @@ public void testHandleDataExceptionWithArgsAndActionArgs() {
ResponseDTO res = new ResponseDTO();
res.setAuthStatus(Boolean.FALSE);
expectedResponse.setResponse(res);
expectedResponse.setErrors(
Collections.singletonList(new AuthError(IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorCode(),
expectedResponse.setErrors(Collections
.singletonList(new AuthError(IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorCode(),
IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorMessage())));

Errors errors = new BindException(expectedResponse, "BaseAuthResponseDTO");
errors.reject(IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorCode(),
new Object[] {"Email"}, IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorMessage());
new Object[] { "Email" }, IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED.getErrorMessage());
try {
DataValidationUtil.validate(errors);
} catch (IDDataValidationException e) {
ResponseEntity<Object> handleExceptionInternal = handler.handleIdAppException(
new IdAuthenticationAppException(IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED, e), null);
new IdAuthenticationAppException(IdAuthenticationErrorConstants.PHONE_EMAIL_NOT_REGISTERED, e),
null);
BaseAuthResponseDTO actualResponse = (BaseAuthResponseDTO) handleExceptionInternal.getBody();
actualResponse.setResponseTime(null);
assertTrue(!actualResponse.getErrors().isEmpty());
Expand Down Expand Up @@ -463,24 +464,6 @@ public void testCreateAuthError() {
// assertEquals(expectedResponse, actualResponse);
}

@Ignore
@Test
public void testCreateAuthErrorwithActionCode() {
AuthResponseDTO expectedResponse = new AuthResponseDTO();
ResponseDTO res = new ResponseDTO();
res.setAuthStatus(Boolean.FALSE);
expectedResponse.setResponse(res);
expectedResponse.setErrors(Collections
.singletonList(new ActionableAuthError(IdAuthenticationErrorConstants.EXPIRED_OTP.getErrorCode(),
IdAuthenticationErrorConstants.EXPIRED_OTP.getErrorMessage(),
IdAuthenticationErrorConstants.EXPIRED_OTP.getActionMessage())));
ResponseEntity<Object> handleExceptionInternal = handler.handleIdAppException(
new IdAuthenticationBaseException(IdAuthenticationErrorConstants.EXPIRED_OTP), null);
BaseAuthResponseDTO actualResponse = (BaseAuthResponseDTO) handleExceptionInternal.getBody();
actualResponse.setResponseTime(null);
// assertEquals(expectedResponse, actualResponse);
}

@Test
public void testHandleAllException2() {
Mockito.when(servletRequest.getContextPath()).thenReturn("/otp");
Expand Down
Loading

0 comments on commit 2ec9624

Please sign in to comment.