diff options
5 files changed, 48 insertions, 25 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java index a8695885..00324a9a 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java @@ -27,15 +27,14 @@ import java.util.Date; import java.util.Map; import java.util.TimeZone; +import org.apache.commons.collections4.map.HashedMap; +import org.apache.commons.lang3.StringUtils; + import at.gv.egiz.eaaf.core.api.idp.IAuthData; import at.gv.egiz.eaaf.core.api.idp.auth.data.IIdentityLink; import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; import at.gv.egiz.eaaf.core.impl.builder.BpkBuilder; - -import org.apache.commons.collections4.map.HashedMap; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import lombok.extern.slf4j.Slf4j; /** * Service-Provider specific authentication data. @@ -43,10 +42,9 @@ import org.slf4j.LoggerFactory; * @author tlenz * */ +@Slf4j public class AuthenticationData implements IAuthData, Serializable { - private static final Logger log = LoggerFactory.getLogger(AuthenticationData.class); - private static final long serialVersionUID = -1042697056735596866L; public static final String IDENTITY_LINK_DATE_FORMAT = "yyyy-MM-dd"; public static final String ISSUE_INSTANT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/ISpConfiguration.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/ISpConfiguration.java index 5a16f655..dd4041fc 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/ISpConfiguration.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/idp/ISpConfiguration.java @@ -22,6 +22,7 @@ package at.gv.egiz.eaaf.core.api.idp; import java.io.Serializable; import java.util.List; import java.util.Map; +import java.util.Set; public interface ISpConfiguration extends Serializable { @@ -121,7 +122,7 @@ public interface ISpConfiguration extends Serializable { * * @return */ - List<String> getTargetsWithNoBaseIdInternalProcessingRestriction(); + Set<String> getTargetsWithNoBaseIdInternalProcessingRestriction(); /** * Get the {@link List} of identifier's that indicates no baseID transfer @@ -131,7 +132,7 @@ public interface ISpConfiguration extends Serializable { * * @return */ - List<String> getTargetsWithNoBaseIdTransferRestriction(); + Set<String> getTargetsWithNoBaseIdTransferRestriction(); /** * Get the List eIDAS LoA that are required by this service provider. diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/idp/conf/SpConfigurationImpl.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/idp/conf/SpConfigurationImpl.java index de54d103..2f4e18fa 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/idp/conf/SpConfigurationImpl.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/idp/conf/SpConfigurationImpl.java @@ -20,8 +20,10 @@ package at.gv.egiz.eaaf.core.impl.idp.conf; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,8 +40,8 @@ public class SpConfigurationImpl implements ISpConfiguration { private static final Logger log = LoggerFactory.getLogger(SpConfigurationImpl.class); private final Map<String, String> spConfiguration; - private final List<String> targetAreasWithNoInteralBaseIdRestriction; - private final List<String> targetAreasWithNoBaseIdTransmissionRestriction; + private final Set<String> targetAreasWithNoInteralBaseIdRestriction; + private final Set<String> targetAreasWithNoBaseIdTransmissionRestriction; /** * Service-provider configuration holder. @@ -52,21 +54,19 @@ public class SpConfigurationImpl implements ISpConfiguration { // set oa specific restrictions targetAreasWithNoInteralBaseIdRestriction = Collections - .unmodifiableList(KeyValueUtils.getListOfCsvValues(authConfig.getBasicConfiguration( - CONFIG_KEY_RESTRICTIONS_BASEID_INTERNAL, EaafConstants.URN_PREFIX_CDID))); + .unmodifiableSet(new HashSet<String>(KeyValueUtils.getListOfCsvValues(authConfig.getBasicConfiguration( + CONFIG_KEY_RESTRICTIONS_BASEID_INTERNAL, EaafConstants.URN_PREFIX_CDID)))); targetAreasWithNoBaseIdTransmissionRestriction = Collections - .unmodifiableList(KeyValueUtils.getListOfCsvValues(authConfig.getBasicConfiguration( - CONFIG_KEY_RESTRICTIONS_BASEID_TRANSMISSION, EaafConstants.URN_PREFIX_CDID))); + .unmodifiableSet(new HashSet<String>(KeyValueUtils.getListOfCsvValues(authConfig.getBasicConfiguration( + CONFIG_KEY_RESTRICTIONS_BASEID_TRANSMISSION, EaafConstants.URN_PREFIX_CDID)))); if (log.isTraceEnabled()) { log.trace("Internal policy for OA: " + getUniqueIdentifier()); - for (final String el : targetAreasWithNoInteralBaseIdRestriction) { - log.trace(" Allow baseID processing for prefix " + el); - } - for (final String el : targetAreasWithNoBaseIdTransmissionRestriction) { - log.trace(" Allow baseID transfer for prefix " + el); - } + targetAreasWithNoInteralBaseIdRestriction.stream() + .forEach(el -> log.trace(" Allow baseID processing for prefix " + el)); + targetAreasWithNoBaseIdTransmissionRestriction.stream() + .forEach(el -> log.trace(" Allow baseID transfer for prefix " + el)); } } @@ -143,12 +143,12 @@ public class SpConfigurationImpl implements ISpConfiguration { } @Override - public final List<String> getTargetsWithNoBaseIdInternalProcessingRestriction() { + public final Set<String> getTargetsWithNoBaseIdInternalProcessingRestriction() { return this.targetAreasWithNoInteralBaseIdRestriction; } @Override - public final List<String> getTargetsWithNoBaseIdTransferRestriction() { + public final Set<String> getTargetsWithNoBaseIdTransferRestriction() { return this.targetAreasWithNoBaseIdTransmissionRestriction; } diff --git a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java index 28501c54..6006b731 100644 --- a/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java +++ b/eaaf_modules/eaaf_module_moa-sig/src/main/java/at/gv/egiz/eaaf/modules/sigverify/moasig/impl/data/GenericSignatureVerificationResponse.java @@ -3,6 +3,7 @@ package at.gv.egiz.eaaf.modules.sigverify.moasig.impl.data; import java.io.Serializable; import java.security.cert.CertificateException; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -54,7 +55,7 @@ public class GenericSignatureVerificationResponse private ExtendedCertificateValidation extendedCertificateValidation; - private List<ExtendedResult> formValidationResults = new ArrayList<>(); + private List<ExtendedResult> formValidationResults = null; @Override public Date getSigningDateTime() { @@ -105,6 +106,17 @@ public class GenericSignatureVerificationResponse } + @Override + public List<ExtendedResult> getFormValidationResults() { + if (formValidationResults == null) { + return Collections.emptyList(); + + } else { + return formValidationResults; + + } + } + /** * Set signature creation timestramp. * @@ -161,7 +173,13 @@ public class GenericSignatureVerificationResponse if (formCheckResult != null) { for (Object elObj : formCheckResult) { if (elObj instanceof AdESFormResults) { - AdESFormResults el = (AdESFormResults)elObj; + AdESFormResults el = (AdESFormResults)elObj; + + if (formValidationResults == null) { + formValidationResults = new ArrayList<>(); + + } + formValidationResults.add(ExtendedResult.builder() .code(el.getCode()) .info(el.getName()) diff --git a/eaaf_modules/eaaf_module_pvp2_core/pom.xml b/eaaf_modules/eaaf_module_pvp2_core/pom.xml index ee20ef56..1ce539ee 100644 --- a/eaaf_modules/eaaf_module_pvp2_core/pom.xml +++ b/eaaf_modules/eaaf_module_pvp2_core/pom.xml @@ -56,6 +56,12 @@ <dependency> <groupId>org.cryptacular</groupId> <artifactId>cryptacular</artifactId> + <exclusions> + <exclusion> + <groupId>org.bouncycastle</groupId> + <artifactId>bcprov-jdk15on</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.bouncycastle</groupId> |