From 0224cdf7be78cf0778f0b832a42c18c480c4b784 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 9 Dec 2019 09:22:54 +0100 Subject: switch to EAAF-Components 1.1.0-SNAPSHOT --- .../verification/AuthnRequestValidator.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'connector/src/main/java/at/asitplus/eidas/specific/connector/verification/AuthnRequestValidator.java') diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/AuthnRequestValidator.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/AuthnRequestValidator.java index 94b0cc02..c49c0b28 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/AuthnRequestValidator.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/verification/AuthnRequestValidator.java @@ -44,16 +44,16 @@ import org.springframework.beans.factory.annotation.Autowired; import at.asitplus.eidas.specific.connector.MSeIDASNodeConstants; import at.asitplus.eidas.specific.connector.config.ServiceProviderConfiguration; import at.gv.egiz.eaaf.core.api.IRequest; -import at.gv.egiz.eaaf.core.api.data.EAAFConstants; -import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; +import at.gv.egiz.eaaf.core.api.data.EaafConstants; +import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions; import at.gv.egiz.eaaf.core.api.idp.IConfiguration; import at.gv.egiz.eaaf.core.exceptions.AuthnRequestValidatorException; -import at.gv.egiz.eaaf.core.exceptions.EAAFException; -import at.gv.egiz.eaaf.core.exceptions.EAAFStorageException; -import at.gv.egiz.eaaf.modules.pvp2.api.reqattr.EAAFRequestedAttribute; -import at.gv.egiz.eaaf.modules.pvp2.api.reqattr.EAAFRequestedAttributes; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; +import at.gv.egiz.eaaf.modules.pvp2.api.reqattr.EaafRequestedAttribute; +import at.gv.egiz.eaaf.modules.pvp2.api.reqattr.EaafRequestedAttributes; import at.gv.egiz.eaaf.modules.pvp2.api.validation.IAuthnRequestValidator; -import at.gv.egiz.eaaf.modules.pvp2.exception.NameIDFormatNotSupportedException; +import at.gv.egiz.eaaf.modules.pvp2.exception.NameIdFormatNotSupportedException; import eu.eidas.auth.commons.protocol.eidas.LevelOfAssurance; public class AuthnRequestValidator implements IAuthnRequestValidator { @@ -74,7 +74,7 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { if ( !(NameID.TRANSIENT.equals(nameIDFormat) || NameID.PERSISTENT.equals(nameIDFormat)) ) { - throw new NameIDFormatNotSupportedException(nameIDFormat); + throw new NameIdFormatNotSupportedException(nameIDFormat); } @@ -107,9 +107,9 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { LevelOfAssurance minimumLoAFromConfig = LevelOfAssurance.fromString(basicConfig.getBasicConfiguration( MSeIDASNodeConstants.PROP_EIDAS_REQUEST_LOA_MINIMUM_LEVEL, - EAAFConstants.EIDAS_LOA_HIGH)); + EaafConstants.EIDAS_LOA_HIGH)); if (minimumLoAFromConfig == null) { - log.warn("Can not load minimum LoA from configuration. Use LoA: {} as default", EAAFConstants.EIDAS_LOA_HIGH); + log.warn("Can not load minimum LoA from configuration. Use LoA: {} as default", EaafConstants.EIDAS_LOA_HIGH); minimumLoAFromConfig = LevelOfAssurance.HIGH; } @@ -119,7 +119,7 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { for (String loa : reqLoA) { try { LevelOfAssurance intLoa = LevelOfAssurance.fromString(loa); - String selectedLoA = EAAFConstants.EIDAS_LOA_HIGH; + String selectedLoA = EaafConstants.EIDAS_LOA_HIGH; if (intLoa != null && intLoa.numericValue() >= minimumLoAFromConfig.numericValue()) { log.info("Client: {} requested LoA: {} will be upgraded to: {}", @@ -155,12 +155,12 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { boolean sectorDetected = false; List requestedAttributes = authnReq.getExtensions().getUnknownXMLObjects(); for (XMLObject reqAttrObj : requestedAttributes) { - if (reqAttrObj instanceof EAAFRequestedAttributes) { - EAAFRequestedAttributes reqAttr = (EAAFRequestedAttributes)reqAttrObj; + if (reqAttrObj instanceof EaafRequestedAttributes) { + EaafRequestedAttributes reqAttr = (EaafRequestedAttributes)reqAttrObj; if (reqAttr.getAttributes() != null && reqAttr.getAttributes().size() != 0 ) { - for (EAAFRequestedAttribute el : reqAttr.getAttributes()) { + for (EaafRequestedAttribute el : reqAttr.getAttributes()) { log.trace("Processing req. attribute '" + el.getName() + "' ... "); - if (el.getName().equals(PVPAttributeDefinitions.EID_SECTOR_FOR_IDENTIFIER_NAME)) { + if (el.getName().equals(PvpAttributeDefinitions.EID_SECTOR_FOR_IDENTIFIER_NAME)) { if (el.getAttributeValues() != null && el.getAttributeValues().size() == 1) { String sectorId = el.getAttributeValues().get(0).getDOM().getTextContent(); ServiceProviderConfiguration spConfig = pendingReq.getServiceProviderConfiguration(ServiceProviderConfiguration.class); @@ -169,7 +169,7 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { spConfig.setbPKTargetIdentifier(sectorId); sectorDetected = true; - } catch (EAAFException e) { + } catch (EaafException e) { log.info("Requested sector: " + sectorId + " DOES NOT match to allowed sectors for SP: " + spConfig.getUniqueIdentifier()); } @@ -195,7 +195,7 @@ public class AuthnRequestValidator implements IAuthnRequestValidator { } - } catch (EAAFStorageException e) { + } catch (EaafStorageException e) { log.info("Can NOT store Authn. Req. data into pendingRequest." , e); throw new AuthnRequestValidatorException("internal.02", null, e); -- cgit v1.2.3