diff options
author | Thomas <> | 2021-09-27 15:56:40 +0200 |
---|---|---|
committer | Thomas <> | 2022-03-03 16:31:57 +0100 |
commit | 4261c3b57963476673ca87f7e857f9baee6362fb (patch) | |
tree | ba39287409ae10d24a61b1a53ca7e8410004ddb8 | |
parent | 5d1c16bc384b6b16e87a90df980f2b4d12dc4fe8 (diff) | |
download | National_eIDAS_Gateway-4261c3b57963476673ca87f7e857f9baee6362fb.tar.gz National_eIDAS_Gateway-4261c3b57963476673ca87f7e857f9baee6362fb.tar.bz2 National_eIDAS_Gateway-4261c3b57963476673ca87f7e857f9baee6362fb.zip |
refactor mandate-profile selection based on requested attributes to clearly separate functionality
-rw-r--r-- | eidas_modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/eidas_modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java b/eidas_modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java index 0316d434..8957d7db 100644 --- a/eidas_modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java +++ b/eidas_modules/eidas_proxy-sevice/src/main/java/at/asitplus/eidas/specific/modules/msproxyservice/protocol/EidasProxyServiceController.java @@ -408,16 +408,17 @@ public class EidasProxyServiceController extends AbstractController implements I log.trace("eIDAS Proxy-Service allows mandates for Connector: {}. Selecting profiles ... ", spConfig.getUniqueIdentifier()); - //check if legal person is requested - boolean isLegalPersonRequested = EidasProxyServiceUtils.isLegalPersonRequested(eidasRequest); - - // set mandate profiles - if (isLegalPersonRequested) { + //check if legal person is requested + if (EidasProxyServiceUtils.isLegalPersonRequested(eidasRequest)) { spConfig.setMandateProfiles(KeyValueUtils.getListOfCsvValues( - spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_LEGAL))); - + spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_LEGAL))); spConfig.setMandateMode(SpMandateModes.LEGAL_FORCE); + if (spConfig.getMandateProfiles().isEmpty()) { + throw new EidasProxyServiceException(ERROR_10, null); + + } + } else if (EidasProxyServiceUtils.isNaturalPersonRequested(eidasRequest)) { spConfig.setMandateProfiles(KeyValueUtils.getListOfCsvValues( spConfig.getConfigurationValue(MsProxyServiceConstants.CONIG_PROPS_CONNECTOR_MANDATES_PROFILE_NATURAL))); @@ -426,10 +427,8 @@ public class EidasProxyServiceController extends AbstractController implements I } - if (isLegalPersonRequested && spConfig.getMandateProfiles().isEmpty()) { - throw new EidasProxyServiceException(ERROR_10, null); - - } else if (spConfig.getMandateProfiles().isEmpty()) { + + if (spConfig.getMandateProfiles().isEmpty()) { log.debug("No mandate-profiles for issure: {}. Set mandate-mode to 'none'", spConfig.getUniqueIdentifier()); spConfig.setMandateMode(SpMandateModes.NONE); @@ -437,8 +436,7 @@ public class EidasProxyServiceController extends AbstractController implements I } else { log.debug("Set mandate-profiles: {} to request from issuer: {}", spConfig.getMandateProfiles(), spConfig.getUniqueIdentifier()); - - + } } |