From d8a6a3a0fa27f6ea487c9fc4006f705383780917 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 21 Dec 2020 18:09:50 +0100 Subject: switch to eIDAS Ref Impl. v2.5 --- eidas_modules/authmodule-eIDAS-v2/pom.xml | 41 +- .../eu/eidas/2.5.0/eidas-parent-2.5.0.pom | 898 +++++++++++++++++++++ .../2.5.0/eidas-commons-2.5.0-javadoc.jar | Bin 0 -> 1027681 bytes .../2.5.0/eidas-commons-2.5.0-sources.jar | Bin 0 -> 204524 bytes .../eidas-commons/2.5.0/eidas-commons-2.5.0.jar | Bin 0 -> 301282 bytes .../eidas-commons/2.5.0/eidas-commons-2.5.0.pom | 101 +++ ...ignite-specific-communication-2.5.0-javadoc.jar | Bin 0 -> 30194 bytes ...ignite-specific-communication-2.5.0-sources.jar | Bin 0 -> 4138 bytes ...-jcache-ignite-specific-communication-2.5.0.jar | Bin 0 -> 6202 bytes ...-jcache-ignite-specific-communication-2.5.0.pom | 61 ++ .../2.5.0/eidas-jcache-ignite-2.5.0-javadoc.jar | Bin 0 -> 35711 bytes .../2.5.0/eidas-jcache-ignite-2.5.0-sources.jar | Bin 0 -> 2840 bytes .../2.5.0/eidas-jcache-ignite-2.5.0.jar | Bin 0 -> 3859 bytes .../2.5.0/eidas-jcache-ignite-2.5.0.pom | 94 +++ .../2.5.0/eidas-light-commons-2.5.0-javadoc.jar | Bin 0 -> 441594 bytes .../2.5.0/eidas-light-commons-2.5.0-sources.jar | Bin 0 -> 89442 bytes .../2.5.0/eidas-light-commons-2.5.0.jar | Bin 0 -> 128469 bytes .../2.5.0/eidas-light-commons-2.5.0.pom | 55 ++ .../eidas-parent/2.5.0/eidas-parent-2.5.0.pom | 898 +++++++++++++++++++++ ...ific-communication-definition-2.5.0-javadoc.jar | Bin 0 -> 153396 bytes ...ific-communication-definition-2.5.0-sources.jar | Bin 0 -> 48969 bytes ...das-specific-communication-definition-2.5.0.jar | Bin 0 -> 57695 bytes ...das-specific-communication-definition-2.5.0.pom | 136 ++++ .../v2/test/EidasAttributePostProcessingTest.java | 458 ----------- .../test/EidasRequestPreProcessingFirstTest.java | 147 ---- .../test/EidasRequestPreProcessingSecondTest.java | 116 --- .../tasks/GenerateAuthnRequestTaskFirstTest.java | 122 --- .../test/tasks/GenerateAuthnRequestTaskTest.java | 122 +++ .../EidasAttributePostProcessingTest.java | 458 +++++++++++ .../EidasRequestPreProcessingFirstTest.java | 147 ++++ .../EidasRequestPreProcessingSecondTest.java | 116 +++ 31 files changed, 3114 insertions(+), 856 deletions(-) create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/2.5.0/eidas-parent-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-javadoc.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-sources.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-javadoc.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-sources.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-javadoc.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-sources.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-javadoc.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-sources.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-parent/2.5.0/eidas-parent-2.5.0.pom create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-javadoc.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-sources.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.jar create mode 100644 eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.pom delete mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasAttributePostProcessingTest.java delete mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingFirstTest.java delete mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingSecondTest.java delete mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskFirstTest.java create mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java create mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasAttributePostProcessingTest.java create mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingFirstTest.java create mode 100644 eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingSecondTest.java (limited to 'eidas_modules') diff --git a/eidas_modules/authmodule-eIDAS-v2/pom.xml b/eidas_modules/authmodule-eIDAS-v2/pom.xml index d8459f9e..d7885088 100644 --- a/eidas_modules/authmodule-eIDAS-v2/pom.xml +++ b/eidas_modules/authmodule-eIDAS-v2/pom.xml @@ -13,14 +13,6 @@ eIDAS v2 authentication module eIDAS module based on eIDAS node reference implementation v2.x - - 2.4.0 - 2.4.0 - 2.4.0 - 2.4.0 - 3.23.1 - - default @@ -62,8 +54,6 @@ eu.eidas eidas-commons - ${eidas-commons.version} - log4j @@ -79,19 +69,16 @@ eu.eidas eidas-light-commons - ${eidas-light-commons.version} eu.eidas eidas-specific-communication-definition - ${eidas-specific-communication-definition.version} eu.eidas eidas-jcache-ignite-specific-communication - ${eidas-jcache-ignite-specific-communication.version} @@ -162,6 +149,14 @@ 2.0.7 test + + + at.asitplus.eidas.ms_specific + connector_lib + test + test-jar + + at.gv.egiz.eaaf eaaf_core_utils @@ -268,11 +263,31 @@ check + true **/at/gv/e_government/reference/namespace/persondata/_20020228/* **/org/w3/_2000/_09/* + **/org/w3/_2001/_04/* **/szrservices/* + **/generated/cxf/* + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.68 + + + BRANCH + COVEREDRATIO + 0.54 + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/2.5.0/eidas-parent-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/2.5.0/eidas-parent-2.5.0.pom new file mode 100644 index 00000000..38321046 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/2.5.0/eidas-parent-2.5.0.pom @@ -0,0 +1,898 @@ + + + 4.0.0 + eu.eidas + eidas-parent + pom + eIDAS Node Parent + 2.5.0 + + The EIDAS-Parent provides artifacts versions for Eidas Node components. + + + + EIDASParent + EidasNode + UTF-8 + war + jar + ${maven.build.timestamp} + + 1.8 + + 0.5.2 + 0.5.1 + + + 4.3.18.RELEASE + 0.3.9 + 1.5.5 + 3.4.3 + 3.4.3 + 1.0.7 + 2.1.4 + + 7.5.0 + 3.0.1 + 2.0 + 1.2.6 + 6.0.53 + 1.7.10 + 1.2.0 + 2.13.0 + 4.12 + 1.3 + 1.9 + 3.2.2 + 2.4 + 2.6 + 1.1.3 + 4.5.13 + 4.4.9 + 3.1 + 1.64 + 1.1.1 + 1.4.0 + 2.6 + 1.2.17 + 2.3 + 1.5 + 1.2.2 + 2.3.34 + + 7.4.2 + ${vaadin.version} + 1.0.0.beta1 + 0.0.5.RELEASE + 9.2.3.v20140905 + 28.1-jre + 3.0.1 + 57.1 + + + 2.8.1 + 2.3.2 + 2.19.1 + 3.2.0 + 2.7 + 2.4 + 2.7 + 1.5 + 2.1.2 + 2.5.2 + 2.6.1 + 3.1.2 + 2.3.1 + + + + + + + eu.eidas + SimpleProtocol + 0.0.3 + + + eu.eidas + eidas-commons + ${project.version} + + + eu.eidas + eidas-light-commons + ${project.version} + + + eu.eidas + eidas-configmodule + ${project.version} + + + eu.eidas + eidas-encryption + ${project.version} + + + eu.eidas + eidas-saml-engine + ${project.version} + + + eu.eidas + eidas-updater + ${project.version} + + + eu.eidas + eidas-saml-metadata + ${project.version} + + + eu.eidas + eidas-specific-connector + ${project.version} + + + eu.eidas + eidas-specific-proxyservice + ${project.version} + + + eu.eidas + eidas-specific-communication-definition + ${project.version} + + + eu.eidas + eidas-jcache-dev + ${project.version} + + + eu.eidas + eidas-jcache-dev-node + ${project.version} + + + eu.eidas + eidas-jcache-dev-specific-communication + ${project.version} + + + eu.eidas + eidas-jcache-ignite + ${project.version} + + + eu.eidas + eidas-jcache-ignite-node + ${project.version} + + + eu.eidas + eidas-jcache-ignite-specific-communication + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast-node + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast-specific-communication + ${project.version} + + + eu.eidas + eidas-node + ${project.version} + + + eu.eidas + eidas-sp + ${project.version} + + + eu.eidas + eidas-idp + ${project.version} + + + + joda-time + joda-time + ${joda.time.version} + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + org.slf4j + jul-to-slf4j + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + + + + commons-logging + commons-logging + ${commons.logging} + + + + log4j + log4j + ${log4j.version} + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + mail + javax.mail + + + + + + ch.qos.logback + logback-classic + ${logback.version} + + + org.slf4j + slf4j-api + + + + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + + provided + + + + commons-codec + commons-codec + ${commons.codec} + + + commons-collections + commons-collections + ${commons.collections} + + + org.apache.httpcomponents + httpclient + ${commons.httpclient} + + + commons-logging + commons-logging + + + commons-codec + commons-codec + + + + + org.apache.httpcomponents + httpcore + ${commons.httpcore} + + + commons-logging + commons-logging + + + + + commons-io + commons-io + ${commons.io} + + + commons-lang + commons-lang + ${commons.lang} + + + org.owasp.encoder + encoder + ${owasp.version} + + + org.owasp.encoder + encoder-jsp + ${owasp.version} + + + com.google.guava + guava + ${guava.version} + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + + + org.opensaml + opensaml-core + ${opensaml.version} + + + commons-codec + commons-codec + + + commons-collections + commons-collections + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + javax.servlet + servlet-api + + + joda-time + joda-time + + + junit + junit + + + log4j + log4j + + + org.apache.velocity + velocity + + + org.bouncycastle + bcprov-jdk15on + + + org.slf4j + slf4j-api + + + org.slf4j + jcl-over-slf4j + + + org.slf4j + log4j-over-slf4j + + + org.slf4j + jul-to-slf4j + + + org.springframework + spring-test + + + + + org.opensaml + opensaml-saml-api + ${opensaml.version} + + + org.opensaml + opensaml-saml-impl + ${opensaml.version} + + + se.swedenconnect.opensaml + opensaml-security-ext + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml-security-ext.version} + + + net.shibboleth.utilities + java-support + ${shibboleth.xmlsupport.version} + + + org.opensaml + opensaml-xmlsec-api + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml.version} + + + javax.servlet + javax.servlet-api + ${servlet.version} + provided + + + + javax.servlet + jsp-api + ${jsp.api} + provided + + + + org.glassfish.web + jakarta.servlet.jsp.jstl + ${jstl.version} + runtime + + + + org.springframework + spring-core + ${spring.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-context-support + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + xalan + xalan + ${xalan.version} + + + org.opensaml + opensaml-xmlsec-impl + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml.version} + + + + org.apache.santuario + xmlsec + ${xmlsec.version} + + + + org.apache.tomcat + jasper-el + ${jasper.version} + + + + org.apache.struts + struts2-core + ${struts.version} + + + + com.ibm.icu + icu4j + ${icu4j.version} + + + + + junit + junit + ${junit.version} + test + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + xmlunit + xmlunit + ${xmlunit.version} + test + + + org.springframework + spring-test + ${spring.version} + test + + + + + + + + commons-collections + commons-collections + + + commons-io + commons-io + + + commons-lang + commons-lang + + + com.google.guava + guava + + + com.google.code.findbugs + jsr305 + + + + + junit + junit + + + hamcrest-core + org.hamcrest + + + + + org.hamcrest + hamcrest-all + + + org.mockito + mockito-core + + + hamcrest-core + org.hamcrest + + + + + xmlunit + xmlunit + + + + + + + + + com.orctom.mojo + was-maven-plugin + 1.0.8 + + c:/pgm/wlp + ${proj.name} + localhost + server01 + node01 + default_host + true + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + http://localhost:8080/manager/text + tomcat + /${proj.name} + admin + admin + + + + org.apache.maven.plugins + maven-war-plugin + ${war.plugin.version} + + + + ${project.basedir}/src/main/webapp/WEB-INF + true + WEB-INF + + **/web.xml + + + + + + + org.apache.maven.plugins + maven-source-plugin + ${source.plugin.version} + + + attach-sources + verify + + jar-no-fork + + + + + + org.codehaus.mojo + cobertura-maven-plugin + ${cobertura.plugin.version} + + + html + xml + + + + + org.codehaus.mojo + jaxb2-maven-plugin + ${jaxb.plugin.version} + + + org.apache.maven.plugins + maven-resources-plugin + ${resources.plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.plugin.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compile.plugin.version} + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + + false + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + true + + + + + + ../EIDAS-Light-Commons + ../EIDAS-Commons + ../EIDAS-ConfigModule + ../EIDAS-Encryption + ../EIDAS-Metadata + ../EIDAS-SpecificCommunicationDefinition + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Node + + + + + NodeOnly + + true + + + ../EIDAS-SAMLEngine + ../EIDAS-UPDATER + ../EIDAS-Node + + + + DemoToolsOnly + + false + + + ../EIDAS-SimpleProtocol + ../EIDAS-SpecificProxyService + ../EIDAS-SpecificConnector + ../EIDAS-SP + ../EIDAS-IdP-1.0 + + + + nodeJcacheIgnite + + true + + + ../EIDAS-JCache-Ignite + ../EIDAS-JCache-Ignite-Node + + + + nodeJcacheHazelcast + + true + + + ../EIDAS-JCache-Hazelcast + ../EIDAS-JCache-Hazelcast-Node + + + + nodeJcacheDev + + true + + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Node + + + + specificCommunicationJcacheIgnite + + true + + + ../EIDAS-JCache-Ignite + ../EIDAS-JCache-Ignite-Specific-Communication + + + + specificCommunicationJcacheHazelcast + + false + + + ../EIDAS-JCache-Hazelcast + ../EIDAS-JCache-Hazelcast-Specific-Communication + + + + specificCommunicationJcacheDev + + false + + specificJar + + + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Specific-Communication + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-javadoc.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-javadoc.jar new file mode 100644 index 00000000..dd667cd9 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-javadoc.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-sources.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-sources.jar new file mode 100644 index 00000000..8b6d3da3 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0-sources.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.jar new file mode 100644 index 00000000..8439b264 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.pom new file mode 100644 index 00000000..ac302325 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-commons/2.5.0/eidas-commons-2.5.0.pom @@ -0,0 +1,101 @@ + + 4.0.0 + eidas-commons + ${mod.packaging.type} + eIDAS Commons + + The EIDASCommons library provides beans, Java Interfaces and utility classes to integrate EidasNode and SAML + Engine. + + + eu.eidas + eidas-parent + 2.5.0 + ../EIDAS-Parent/pom.xml + + + + eu.eidas + eidas-light-commons + + + org.slf4j + slf4j-api + + + org.bouncycastle + bcprov-jdk15on + + + + javax.servlet + javax.servlet-api + + + org.owasp.encoder + encoder + + + javax.cache + cache-api + 1.1.0 + + + + ch.qos.logback + logback-classic + test + + + aopalliance + aopalliance + 1.0 + test + + + + + + + ${project.basedir}/src/main/resources + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + src/test/resources + + log4j.xml + *.properties + + + + + + + metrics + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-javadoc.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-javadoc.jar new file mode 100644 index 00000000..68bd2496 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-javadoc.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-sources.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-sources.jar new file mode 100644 index 00000000..cb518da2 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0-sources.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.jar new file mode 100644 index 00000000..5e190e0b Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.pom new file mode 100644 index 00000000..809d00e4 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite-specific-communication/2.5.0/eidas-jcache-ignite-specific-communication-2.5.0.pom @@ -0,0 +1,61 @@ + + + 4.0.0 + eidas-jcache-ignite-specific-communication + jar + eIDAS JCache Ignite Specific Communication + Implements JCache using Ignite with Specific Communication Definition's beans configurations. + + + eu.eidas + eidas-parent + 2.5.0 + ../EIDAS-Parent/pom.xml + + + + 2.8.1 + + + + + eu.eidas + eidas-jcache-ignite + + + org.springframework + spring-context + test + + + org.slf4j + slf4j-simple + test + + + org.apache.ignite + ignite-slf4j + ${ignite.version} + test + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-javadoc.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-javadoc.jar new file mode 100644 index 00000000..34d86914 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-javadoc.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-sources.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-sources.jar new file mode 100644 index 00000000..44b56b3b Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0-sources.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.jar new file mode 100644 index 00000000..f055b5e8 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.pom new file mode 100644 index 00000000..5e4d6b05 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-jcache-ignite/2.5.0/eidas-jcache-ignite-2.5.0.pom @@ -0,0 +1,94 @@ + + 4.0.0 + eidas-jcache-ignite + jar + eIDAS JCache Ignite + Implements JCache using Ignite. + + + eu.eidas + eidas-parent + 2.5.0 + ../EIDAS-Parent/pom.xml + + + + 2.8.1 + + + + + eu.eidas + eidas-commons + + + commons-logging + commons-logging + + + org.apache.ignite + ignite-core + ${ignite.version} + + + org.gridgain + ignite-shmem + + + + + org.apache.ignite + ignite-spring + ${ignite.version} + + + org.apache.ignite + ignite-indexing + + + org.springframework + spring-core + + + org.springframework + spring-aop + + + org.springframework + spring-beans + + + org.springframework + spring-context + + + org.springframework + spring-expression + + + org.springframework + spring-tx + + + org.springframework + spring-jdbc + + + commons-logging + commons-logging + + + + + javax.servlet + javax.servlet-api + + + org.apache.ignite + ignite-slf4j + ${ignite.version} + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-javadoc.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-javadoc.jar new file mode 100644 index 00000000..6f521268 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-javadoc.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-sources.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-sources.jar new file mode 100644 index 00000000..3e90e3af Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0-sources.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.jar new file mode 100644 index 00000000..de5a51b1 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.pom new file mode 100644 index 00000000..ad62ebda --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-light-commons/2.5.0/eidas-light-commons-2.5.0.pom @@ -0,0 +1,55 @@ + + 4.0.0 + eidas-light-commons + ${mod.packaging.type} + eIDAS Light Commons + + The EIDASLightCommons library provides Java Interfaces and utility classes to integrate EIDASCommons and eIDAS Specific Communication Definition. + + + eu.eidas + eidas-parent + 2.5.0 + ../EIDAS-Parent/pom.xml + + + + joda-time + joda-time + + + com.ibm.icu + icu4j + + + + + + org.apache.maven.plugins + maven-source-plugin + + + + + + metrics + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-parent/2.5.0/eidas-parent-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-parent/2.5.0/eidas-parent-2.5.0.pom new file mode 100644 index 00000000..38321046 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-parent/2.5.0/eidas-parent-2.5.0.pom @@ -0,0 +1,898 @@ + + + 4.0.0 + eu.eidas + eidas-parent + pom + eIDAS Node Parent + 2.5.0 + + The EIDAS-Parent provides artifacts versions for Eidas Node components. + + + + EIDASParent + EidasNode + UTF-8 + war + jar + ${maven.build.timestamp} + + 1.8 + + 0.5.2 + 0.5.1 + + + 4.3.18.RELEASE + 0.3.9 + 1.5.5 + 3.4.3 + 3.4.3 + 1.0.7 + 2.1.4 + + 7.5.0 + 3.0.1 + 2.0 + 1.2.6 + 6.0.53 + 1.7.10 + 1.2.0 + 2.13.0 + 4.12 + 1.3 + 1.9 + 3.2.2 + 2.4 + 2.6 + 1.1.3 + 4.5.13 + 4.4.9 + 3.1 + 1.64 + 1.1.1 + 1.4.0 + 2.6 + 1.2.17 + 2.3 + 1.5 + 1.2.2 + 2.3.34 + + 7.4.2 + ${vaadin.version} + 1.0.0.beta1 + 0.0.5.RELEASE + 9.2.3.v20140905 + 28.1-jre + 3.0.1 + 57.1 + + + 2.8.1 + 2.3.2 + 2.19.1 + 3.2.0 + 2.7 + 2.4 + 2.7 + 1.5 + 2.1.2 + 2.5.2 + 2.6.1 + 3.1.2 + 2.3.1 + + + + + + + eu.eidas + SimpleProtocol + 0.0.3 + + + eu.eidas + eidas-commons + ${project.version} + + + eu.eidas + eidas-light-commons + ${project.version} + + + eu.eidas + eidas-configmodule + ${project.version} + + + eu.eidas + eidas-encryption + ${project.version} + + + eu.eidas + eidas-saml-engine + ${project.version} + + + eu.eidas + eidas-updater + ${project.version} + + + eu.eidas + eidas-saml-metadata + ${project.version} + + + eu.eidas + eidas-specific-connector + ${project.version} + + + eu.eidas + eidas-specific-proxyservice + ${project.version} + + + eu.eidas + eidas-specific-communication-definition + ${project.version} + + + eu.eidas + eidas-jcache-dev + ${project.version} + + + eu.eidas + eidas-jcache-dev-node + ${project.version} + + + eu.eidas + eidas-jcache-dev-specific-communication + ${project.version} + + + eu.eidas + eidas-jcache-ignite + ${project.version} + + + eu.eidas + eidas-jcache-ignite-node + ${project.version} + + + eu.eidas + eidas-jcache-ignite-specific-communication + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast-node + ${project.version} + + + eu.eidas + eidas-jcache-hazelcast-specific-communication + ${project.version} + + + eu.eidas + eidas-node + ${project.version} + + + eu.eidas + eidas-sp + ${project.version} + + + eu.eidas + eidas-idp + ${project.version} + + + + joda-time + joda-time + ${joda.time.version} + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + + org.slf4j + jul-to-slf4j + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + + + + commons-logging + commons-logging + ${commons.logging} + + + + log4j + log4j + ${log4j.version} + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + mail + javax.mail + + + + + + ch.qos.logback + logback-classic + ${logback.version} + + + org.slf4j + slf4j-api + + + + + + org.bouncycastle + bcprov-jdk15on + ${bouncycastle.version} + + provided + + + + commons-codec + commons-codec + ${commons.codec} + + + commons-collections + commons-collections + ${commons.collections} + + + org.apache.httpcomponents + httpclient + ${commons.httpclient} + + + commons-logging + commons-logging + + + commons-codec + commons-codec + + + + + org.apache.httpcomponents + httpcore + ${commons.httpcore} + + + commons-logging + commons-logging + + + + + commons-io + commons-io + ${commons.io} + + + commons-lang + commons-lang + ${commons.lang} + + + org.owasp.encoder + encoder + ${owasp.version} + + + org.owasp.encoder + encoder-jsp + ${owasp.version} + + + com.google.guava + guava + ${guava.version} + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + provided + + + org.opensaml + opensaml-core + ${opensaml.version} + + + commons-codec + commons-codec + + + commons-collections + commons-collections + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + javax.servlet + servlet-api + + + joda-time + joda-time + + + junit + junit + + + log4j + log4j + + + org.apache.velocity + velocity + + + org.bouncycastle + bcprov-jdk15on + + + org.slf4j + slf4j-api + + + org.slf4j + jcl-over-slf4j + + + org.slf4j + log4j-over-slf4j + + + org.slf4j + jul-to-slf4j + + + org.springframework + spring-test + + + + + org.opensaml + opensaml-saml-api + ${opensaml.version} + + + org.opensaml + opensaml-saml-impl + ${opensaml.version} + + + se.swedenconnect.opensaml + opensaml-security-ext + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml-security-ext.version} + + + net.shibboleth.utilities + java-support + ${shibboleth.xmlsupport.version} + + + org.opensaml + opensaml-xmlsec-api + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml.version} + + + javax.servlet + javax.servlet-api + ${servlet.version} + provided + + + + javax.servlet + jsp-api + ${jsp.api} + provided + + + + org.glassfish.web + jakarta.servlet.jsp.jstl + ${jstl.version} + runtime + + + + org.springframework + spring-core + ${spring.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-context-support + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + xalan + xalan + ${xalan.version} + + + org.opensaml + opensaml-xmlsec-impl + + + org.bouncycastle + bcprov-jdk15on + + + ${opensaml.version} + + + + org.apache.santuario + xmlsec + ${xmlsec.version} + + + + org.apache.tomcat + jasper-el + ${jasper.version} + + + + org.apache.struts + struts2-core + ${struts.version} + + + + com.ibm.icu + icu4j + ${icu4j.version} + + + + + junit + junit + ${junit.version} + test + + + org.hamcrest + hamcrest-all + ${hamcrest.version} + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + xmlunit + xmlunit + ${xmlunit.version} + test + + + org.springframework + spring-test + ${spring.version} + test + + + + + + + + commons-collections + commons-collections + + + commons-io + commons-io + + + commons-lang + commons-lang + + + com.google.guava + guava + + + com.google.code.findbugs + jsr305 + + + + + junit + junit + + + hamcrest-core + org.hamcrest + + + + + org.hamcrest + hamcrest-all + + + org.mockito + mockito-core + + + hamcrest-core + org.hamcrest + + + + + xmlunit + xmlunit + + + + + + + + + com.orctom.mojo + was-maven-plugin + 1.0.8 + + c:/pgm/wlp + ${proj.name} + localhost + server01 + node01 + default_host + true + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + http://localhost:8080/manager/text + tomcat + /${proj.name} + admin + admin + + + + org.apache.maven.plugins + maven-war-plugin + ${war.plugin.version} + + + + ${project.basedir}/src/main/webapp/WEB-INF + true + WEB-INF + + **/web.xml + + + + + + + org.apache.maven.plugins + maven-source-plugin + ${source.plugin.version} + + + attach-sources + verify + + jar-no-fork + + + + + + org.codehaus.mojo + cobertura-maven-plugin + ${cobertura.plugin.version} + + + html + xml + + + + + org.codehaus.mojo + jaxb2-maven-plugin + ${jaxb.plugin.version} + + + org.apache.maven.plugins + maven-resources-plugin + ${resources.plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${maven.jar.plugin.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compile.plugin.version} + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + + false + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + true + + + + + + ../EIDAS-Light-Commons + ../EIDAS-Commons + ../EIDAS-ConfigModule + ../EIDAS-Encryption + ../EIDAS-Metadata + ../EIDAS-SpecificCommunicationDefinition + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Node + + + + + NodeOnly + + true + + + ../EIDAS-SAMLEngine + ../EIDAS-UPDATER + ../EIDAS-Node + + + + DemoToolsOnly + + false + + + ../EIDAS-SimpleProtocol + ../EIDAS-SpecificProxyService + ../EIDAS-SpecificConnector + ../EIDAS-SP + ../EIDAS-IdP-1.0 + + + + nodeJcacheIgnite + + true + + + ../EIDAS-JCache-Ignite + ../EIDAS-JCache-Ignite-Node + + + + nodeJcacheHazelcast + + true + + + ../EIDAS-JCache-Hazelcast + ../EIDAS-JCache-Hazelcast-Node + + + + nodeJcacheDev + + true + + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Node + + + + specificCommunicationJcacheIgnite + + true + + + ../EIDAS-JCache-Ignite + ../EIDAS-JCache-Ignite-Specific-Communication + + + + specificCommunicationJcacheHazelcast + + false + + + ../EIDAS-JCache-Hazelcast + ../EIDAS-JCache-Hazelcast-Specific-Communication + + + + specificCommunicationJcacheDev + + false + + specificJar + + + + ../EIDAS-JCache-Dev + ../EIDAS-JCache-Dev-Specific-Communication + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-javadoc.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-javadoc.jar new file mode 100644 index 00000000..fad96d8a Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-javadoc.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-sources.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-sources.jar new file mode 100644 index 00000000..9a2589d6 Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0-sources.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.jar b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.jar new file mode 100644 index 00000000..8b8c387d Binary files /dev/null and b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.jar differ diff --git a/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.pom b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.pom new file mode 100644 index 00000000..4fd93c22 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/repository/eu/eidas/eidas-specific-communication-definition/2.5.0/eidas-specific-communication-definition-2.5.0.pom @@ -0,0 +1,136 @@ + + + 4.0.0 + eidas-specific-communication-definition + jar + eIDAS Specific Communication Definition + Defines and implements the communication protocol to be used between specific and node modules. + + + eu.eidas + eidas-parent + 2.5.0 + ../EIDAS-Parent/pom.xml + + + lightRequest.xsd + + + + org.springframework + spring-context + + + eu.eidas + eidas-commons + + + javax.servlet + javax.servlet-api + + + org.springframework + spring-test + test + + + commons-logging + commons-logging + test + + + eu.eidas + eidas-jcache-dev + test + + + + + + org.apache.maven.plugins + maven-source-plugin + + + org.codehaus.mojo + jaxb2-maven-plugin + + + xjc + + xjc + + + + + + src/main/resources/xsds/${lightRequest.xsd} + src/main/resources/xsds/lightResponse.xsd + + eu.eidas.specificcommunication + true + + + + + + + specificCommunicationJcacheIgnite + + true + + + + eu.eidas + eidas-jcache-ignite-specific-communication + + + + + specificCommunicationJcacheHazelcast + + + eu.eidas + eidas-jcache-hazelcast-specific-communication + + + + + specificCommunicationJcacheProvidedImpl + + false + + + + specificCommunicationJcacheDev + + + + + + + + eu.eidas + eidas-jcache-dev-specific-communication + + + + + diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasAttributePostProcessingTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasAttributePostProcessingTest.java deleted file mode 100644 index 55a3ce99..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasAttributePostProcessingTest.java +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright 2018 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. -*/ - -package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; - -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.Map; - -import org.joda.time.DateTime; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.ErnbEidData; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("/SpringTest-context_tasks_test.xml") -@DirtiesContext(classMode = ClassMode.AFTER_CLASS) -public class EidasAttributePostProcessingTest { - - @Autowired - private CcSpecificEidProcessingService postProcessor; - - // lower case - private static final String P1_eIDASID = - "DE/AT/532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25"; - private static final String P1_GIVENNAME = "Max"; - private static final String P1_FAMILYNAME = "Mustermann"; - private static final DateTime P1_DATEOFBIRTH = DateTime.now(); - private static final String P1_PLACEOFBIRTH = "Nirgendwo"; - private static final String P1_BIRTHNAME = "Musterkind"; - - // mixed - private static final String P3_eIDASID = - "DE/AT/532eaabd9574880dbf76b9b8cc00832c20A6ec113d682299550d7a6e0f345e25"; - private static final String P3_GIVENNAME = "Max"; - private static final String P3_FAMILYNAME = "Mustermann"; - private static final DateTime P3_DATEOFBIRTH = DateTime.now(); - private static final String P3_PLACEOFBIRTH = "Nirgendwo"; - private static final String P3_BIRTHNAME = "Musterkind"; - - // upper case - private static final String P4_eIDASID = - "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F345E25"; - private static final String P4_GIVENNAME = "Max"; - private static final String P4_FAMILYNAME = "Mustermann"; - private static final DateTime P4_DATEOFBIRTH = DateTime.now(); - private static final String P4_PLACEOFBIRTH = "Nirgendwo"; - private static final String P4_BIRTHNAME = "Musterkind"; - - // To long identifier - private static final String P5_eIDASID = - "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F345E251"; - private static final String P5_GIVENNAME = "Max"; - private static final String P5_FAMILYNAME = "Mustermann"; - private static final DateTime P5_DATEOFBIRTH = DateTime.now(); - private static final String P5_PLACEOFBIRTH = "Nirgendwo"; - private static final String P5_BIRTHNAME = "Musterkind"; - - // to short identifier - private static final String P6_eIDASID = "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F"; - private static final String P6_GIVENNAME = "Max"; - private static final String P6_FAMILYNAME = "Mustermann"; - private static final DateTime P6_DATEOFBIRTH = DateTime.now(); - private static final String P6_PLACEOFBIRTH = "Nirgendwo"; - private static final String P6_BIRTHNAME = "Musterkind"; - - // no hex encoded identifier - private static final String P7_eIDASID = "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F"; - private static final String P7_GIVENNAME = "Max"; - private static final String P7_FAMILYNAME = "Mustermann"; - private static final DateTime P7_DATEOFBIRTH = DateTime.now(); - private static final String P7_PLACEOFBIRTH = "Nirgendwo"; - private static final String P7_BIRTHNAME = "Musterkind"; - - private static final String P2_eIDASID = - "EE/AT/asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd"; - private static final String P2_GIVENNAME = "Max"; - private static final String P2_FAMILYNAME = "Mustermann"; - private static final DateTime P2_DATEOFBIRTH = DateTime.now(); - private static final String P2_PLACEOFBIRTH = "Nirgendwo"; - private static final String P2_BIRTHNAME = "Musterkind"; - - /** - * jUnit class initializer. - * - * @throws IOException In case of an error - */ - @BeforeClass - public static void classInitializer() throws IOException { - final String current = new java.io.File(".").toURI().toString(); - System.setProperty("eidas.ms.configuration", current + "../../basicConfig/default_config.properties"); - - } - - @Test - public void deWithHexLowerCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P1_eIDASID, - P1_FAMILYNAME, - P1_GIVENNAME, - P1_DATEOFBIRTH, - P1_PLACEOFBIRTH, - P1_BIRTHNAME)); - - validate(result, - "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", - P1_FAMILYNAME, - P1_GIVENNAME, - P1_DATEOFBIRTH, - P1_PLACEOFBIRTH, - P1_BIRTHNAME); - - } catch (final Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - - } - } - - @Test - public void deWithHexMixedCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P3_eIDASID, - P3_FAMILYNAME, - P3_GIVENNAME, - P3_DATEOFBIRTH, - P3_PLACEOFBIRTH, - P3_BIRTHNAME)); - - validate(result, - "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", - P3_FAMILYNAME, - P3_GIVENNAME, - P3_DATEOFBIRTH, - P3_PLACEOFBIRTH, - P3_BIRTHNAME); - - } catch (final Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - - } - } - - @Test - public void deWithHexUpperCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P4_eIDASID, - P4_FAMILYNAME, - P4_GIVENNAME, - P4_DATEOFBIRTH, - P4_PLACEOFBIRTH, - P4_BIRTHNAME)); - - validate(result, - "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", - P4_FAMILYNAME, - P4_GIVENNAME, - P4_DATEOFBIRTH, - P4_PLACEOFBIRTH, - P4_BIRTHNAME); - - } catch (final Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - - } - } - - @Test - public void deWithHexTooLongCase() throws Exception { - try { - postProcessor.postProcess( - generateInputData( - P5_eIDASID, - P5_FAMILYNAME, - P5_GIVENNAME, - P5_DATEOFBIRTH, - P5_PLACEOFBIRTH, - P5_BIRTHNAME)); - - } catch (final Exception e) { - return; - - } - - fail("Too long input accepted"); - } - - @Test - public void deWithHexTooShortCase() throws Exception { - try { - postProcessor.postProcess( - generateInputData( - P6_eIDASID, - P6_FAMILYNAME, - P6_GIVENNAME, - P6_DATEOFBIRTH, - P6_PLACEOFBIRTH, - P6_BIRTHNAME)); - - } catch (final Exception e) { - return; - - } - - fail("Too short input accepted"); - } - - @Test - public void deWithNoHexCase() throws Exception { - try { - postProcessor.postProcess( - generateInputData( - P7_eIDASID, - P7_FAMILYNAME, - P7_GIVENNAME, - P7_DATEOFBIRTH, - P7_PLACEOFBIRTH, - P7_BIRTHNAME)); - - } catch (final Exception e) { - return; - - } - - fail("Not hex encoded input accepted"); - } - - @Test - public void eeTestCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P2_eIDASID, - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME)); - - validate(result, - "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME); - - } catch (final Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - - } - } - - @Test - public void eeTestFamilyNameMissingCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P2_eIDASID, - null, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME)); - - validate(result, - "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME); - - } catch (final Exception e) { - return; - - } - - fail("FamilyName missing input accepted"); - - } - - @Test - public void eeTestGivenNameMissingCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P2_eIDASID, - P2_FAMILYNAME, - null, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME)); - - validate(result, - "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME); - - } catch (final Exception e) { - return; - - } - - fail("GivenName missing input accepted"); - - } - - @Test - public void eeTestDateOfBirthMissingCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - P2_eIDASID, - P2_FAMILYNAME, - P2_GIVENNAME, - null, - P2_PLACEOFBIRTH, - P2_BIRTHNAME)); - - validate(result, - "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME); - - } catch (final Exception e) { - return; - - } - - fail("DateOfBirth missing input accepted"); - - } - - @Test - public void eeTestIdMissingCase() throws Exception { - try { - final ErnbEidData result = postProcessor.postProcess( - generateInputData( - null, - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME)); - - validate(result, - "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", - P2_FAMILYNAME, - P2_GIVENNAME, - P2_DATEOFBIRTH, - P2_PLACEOFBIRTH, - P2_BIRTHNAME); - - } catch (final Exception e) { - return; - - } - - fail("eIDAS-Id missing input accepted"); - - } - - private Map generateInputData(String id, String familyName, String givenName, - DateTime dateOfBirth, String placeOfBirth, String birthName) { - final Map result = new HashMap<>(); - result.put(Constants.eIDAS_ATTR_PERSONALIDENTIFIER, id); - result.put(Constants.eIDAS_ATTR_CURRENTGIVENNAME, givenName); - result.put(Constants.eIDAS_ATTR_CURRENTFAMILYNAME, familyName); - result.put(Constants.eIDAS_ATTR_DATEOFBIRTH, dateOfBirth); - result.put(Constants.eIDAS_ATTR_PLACEOFBIRTH, placeOfBirth); - result.put(Constants.eIDAS_ATTR_BIRTHNAME, birthName); - return result; - - } - - private void validate(ErnbEidData result, String id, String familyName, String givenName, - DateTime dateOfBirth, String placeOfBirth, String birthName) { - if (!result.getPseudonym().equals(id)) { - fail(result.getPseudonym() + "is not equal to " + id); - } - - if (!result.getFamilyName().equals(familyName)) { - fail(result.getFamilyName() + "is not equal to " + familyName); - } - - if (!result.getGivenName().equals(givenName)) { - fail(result.getGivenName() + "is not equal to " + givenName); - } - - if (!result.getDateOfBirth().equals(dateOfBirth)) { - fail(result.getDateOfBirth() + "is not equal to " + dateOfBirth); - } - - if (!result.getFormatedDateOfBirth().equals(new SimpleDateFormat("yyyy-MM-dd").format(dateOfBirth - .toDate()))) { - fail(result.getDateOfBirth() + "is not equal to " + new SimpleDateFormat("yyyy-MM-dd").format( - dateOfBirth.toDate())); - } - - if (!result.getPlaceOfBirth().equals(placeOfBirth)) { - fail(result.getPlaceOfBirth() + "is not equal to " + placeOfBirth); - } - - if (!result.getBirthName().equals(birthName)) { - fail(result.getBirthName() + "is not equal to " + birthName); - } - - } - -} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingFirstTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingFirstTest.java deleted file mode 100644 index 880c32ae..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingFirstTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2018 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. -*/ - -package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidPostProcessingException; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; -import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; -import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; -import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; -import eu.eidas.auth.commons.light.impl.LightRequest; -import eu.eidas.auth.commons.light.impl.LightRequest.Builder; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("/SpringTest-context_tasks_test.xml") -@DirtiesContext(classMode = ClassMode.AFTER_CLASS) -public class EidasRequestPreProcessingFirstTest { - - @Autowired - private IConfigurationWithSP basicConfig; - @Autowired - private CcSpecificEidProcessingService preProcessor; - - private TestRequestImpl pendingReq; - private DummySpConfiguration oaParam; - private Builder authnRequestBuilder; - - /** - * jUnit class initializer. - * - * @throws IOException In case of an error - */ - @BeforeClass - public static void classInitializer() throws IOException { - final String current = new java.io.File(".").toURI().toString(); - System.setProperty("eidas.ms.configuration", current + "../../basicConfig/default_config.properties"); - - } - - /** - * jUnit test set-up. - * - */ - @Before - public void setUp() { - - final Map spConfig = new HashMap<>(); - spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); - spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); - oaParam = new DummySpConfiguration(spConfig, basicConfig); - - pendingReq = new TestRequestImpl(); - pendingReq.setSpConfig(oaParam); - pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); - pendingReq.setAuthUrl("http://test.com/"); - - authnRequestBuilder = LightRequest.builder(); - authnRequestBuilder.id(UUID.randomUUID().toString()); - authnRequestBuilder.issuer("Test"); - - } - - @Test - public void prePreProcessGeneric() throws EidPostProcessingException { - final String testCountry = "XX"; - authnRequestBuilder.citizenCountryCode(testCountry); - preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); - - final LightRequest lightReq = authnRequestBuilder.build(); - - Assert.assertEquals("ProviderName is not Static", - Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); - Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); - Assert.assertEquals("Requested attribute size not match", 4, lightReq.getRequestedAttributes().size()); - - } - - @Test - public void prePreProcessGenericNoCountryCode() throws EidPostProcessingException { - final String testCountry = "XX"; - authnRequestBuilder.citizenCountryCode(testCountry); - preProcessor.preProcess(null, pendingReq, authnRequestBuilder); - - final LightRequest lightReq = authnRequestBuilder.build(); - - Assert.assertEquals("ProviderName is not Static", - Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); - Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); - Assert.assertEquals("Requested attribute size not match", 4, lightReq.getRequestedAttributes().size()); - - } - - @Test - public void prePreProcessDE() throws EidPostProcessingException { - - final String testCountry = "DE"; - authnRequestBuilder.citizenCountryCode(testCountry); - preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); - - final LightRequest lightReq = authnRequestBuilder.build(); - - Assert.assertEquals("ProviderName is not Static", - Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); - Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); - Assert.assertEquals("Requested attribute size not match", 8, lightReq.getRequestedAttributes().size()); - - } - -} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingSecondTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingSecondTest.java deleted file mode 100644 index da7e3d85..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/EidasRequestPreProcessingSecondTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2018 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. -*/ - -package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidPostProcessingException; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; -import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; -import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; -import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; -import eu.eidas.auth.commons.light.impl.LightRequest; -import eu.eidas.auth.commons.light.impl.LightRequest.Builder; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("/SpringTest-context_tasks_test.xml") -@DirtiesContext(classMode = ClassMode.AFTER_CLASS) -public class EidasRequestPreProcessingSecondTest { - - @Autowired - private IConfigurationWithSP basicConfig; - @Autowired - private CcSpecificEidProcessingService preProcessor; - - private TestRequestImpl pendingReq; - private DummySpConfiguration oaParam; - private Builder authnRequestBuilder; - - /** - * jUnit class initializer. - * - * @throws IOException In case of an error - */ - @BeforeClass - public static void classInitializer() throws IOException { - final String current = new java.io.File(".").toURI().toString(); - System.setProperty("eidas.ms.configuration", current - + "src/test/resources/config/junit_config_1.properties"); - - } - - /** - * jUnit test set-up. - * - */ - @Before - public void setUp() { - - final Map spConfig = new HashMap<>(); - spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); - spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); - oaParam = new DummySpConfiguration(spConfig, basicConfig); - - pendingReq = new TestRequestImpl(); - pendingReq.setSpConfig(oaParam); - pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); - pendingReq.setAuthUrl("http://test.com/"); - - authnRequestBuilder = LightRequest.builder(); - authnRequestBuilder.id(UUID.randomUUID().toString()); - authnRequestBuilder.issuer("Test"); - - } - - @Test - public void prePreProcessDeUnknownAttribute() throws EidPostProcessingException { - - final String testCountry = "DE"; - authnRequestBuilder.citizenCountryCode(testCountry); - preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); - - final LightRequest lightReq = authnRequestBuilder.build(); - - Assert.assertEquals("ProviderName is not Static", "myNode", lightReq.getProviderName()); - Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); - Assert.assertEquals("Requested attribute size not match", 8, lightReq.getRequestedAttributes().size()); - - } - -} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskFirstTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskFirstTest.java deleted file mode 100644 index e8fcdd3d..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskFirstTest.java +++ /dev/null @@ -1,122 +0,0 @@ -package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateAuthnRequestTask; -import at.asitplus.eidas.specific.modules.auth.eidas.v2.test.dummy.DummySpecificCommunicationService; -import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; -import at.gv.egiz.eaaf.core.api.idp.IConfiguration; -import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; -import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; -import at.gv.egiz.eaaf.core.exceptions.EaafException; -import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; -import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; -import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; -import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl; -import eu.eidas.auth.commons.light.ILightRequest; -import eu.eidas.specificcommunication.exception.SpecificCommunicationException; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("/SpringTest-context_tasks_test.xml") -@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) -public class GenerateAuthnRequestTaskFirstTest { - - @Autowired(required = true) - private GenerateAuthnRequestTask task; - @Autowired(required = true) - private DummySpecificCommunicationService commService; - @Autowired(required = true) - private IConfiguration basicConfig; - - final ExecutionContext executionContext = new ExecutionContextImpl(); - private MockHttpServletRequest httpReq; - private MockHttpServletResponse httpResp; - private TestRequestImpl pendingReq; - private DummySpConfiguration oaParam; - - /** - * jUnit class initializer. - * - * @throws IOException In case of an error - */ - @BeforeClass - public static void classInitializer() throws IOException { - final String current = new java.io.File(".").toURI().toString(); - System.setProperty("eidas.ms.configuration", current - + "src/test/resources/config/junit_config_1.properties"); - - } - - /** - * jUnit test set-up. - * - */ - @Before - public void setUp() { - - httpReq = new MockHttpServletRequest("POST", "https://localhost/authhandler"); - httpResp = new MockHttpServletResponse(); - RequestContextHolder.resetRequestAttributes(); - RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpReq, httpResp)); - - final Map spConfig = new HashMap<>(); - spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); - spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); - oaParam = new DummySpConfiguration(spConfig, basicConfig); - - pendingReq = new TestRequestImpl(); - pendingReq.setSpConfig(oaParam); - pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); - pendingReq.setAuthUrl("http://test.com/"); - - } - - @Test - @DirtiesContext - public void withCustomStaticProviderNameForPublicSPs() throws TaskExecutionException, - SpecificCommunicationException { - executionContext.put(MsEidasNodeConstants.REQ_PARAM_SELECTED_COUNTRY, "CC"); - - try { - task.execute(pendingReq, executionContext); - - } catch (final TaskExecutionException e) { - // forward URL is not set in example config - org.springframework.util.Assert.isInstanceOf(EaafConfigurationException.class, e.getOriginalException(), - "Wrong exception"); - Assert.assertEquals("wrong errorCode", "config.08", ((EaafException) e.getOriginalException()) - .getErrorId()); - Assert.assertEquals("wrong parameter size", 1, ((EaafException) e.getOriginalException()) - .getParams().length); - Assert.assertEquals("wrong errorMsg", Constants.CONIG_PROPS_EIDAS_NODE_FORWARD_URL, ((EaafException) e - .getOriginalException()).getParams()[0]); - - } - - final ILightRequest eidasReq = commService.getAndRemoveRequest(null, null); - - Assert.assertEquals("ProviderName is not Static", "myNode", eidasReq.getProviderName()); - Assert.assertEquals("no PublicSP", "public", eidasReq.getSpType()); - Assert.assertEquals("wrong LoA", "http://eidas.europa.eu/LoA/high", eidasReq.getLevelOfAssurance()); - } - -} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java new file mode 100644 index 00000000..e8fcdd3d --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java @@ -0,0 +1,122 @@ +package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.GenerateAuthnRequestTask; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.test.dummy.DummySpecificCommunicationService; +import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; +import at.gv.egiz.eaaf.core.api.idp.IConfiguration; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; +import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; +import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; +import at.gv.egiz.eaaf.core.impl.idp.process.ExecutionContextImpl; +import eu.eidas.auth.commons.light.ILightRequest; +import eu.eidas.specificcommunication.exception.SpecificCommunicationException; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/SpringTest-context_tasks_test.xml") +@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) +public class GenerateAuthnRequestTaskFirstTest { + + @Autowired(required = true) + private GenerateAuthnRequestTask task; + @Autowired(required = true) + private DummySpecificCommunicationService commService; + @Autowired(required = true) + private IConfiguration basicConfig; + + final ExecutionContext executionContext = new ExecutionContextImpl(); + private MockHttpServletRequest httpReq; + private MockHttpServletResponse httpResp; + private TestRequestImpl pendingReq; + private DummySpConfiguration oaParam; + + /** + * jUnit class initializer. + * + * @throws IOException In case of an error + */ + @BeforeClass + public static void classInitializer() throws IOException { + final String current = new java.io.File(".").toURI().toString(); + System.setProperty("eidas.ms.configuration", current + + "src/test/resources/config/junit_config_1.properties"); + + } + + /** + * jUnit test set-up. + * + */ + @Before + public void setUp() { + + httpReq = new MockHttpServletRequest("POST", "https://localhost/authhandler"); + httpResp = new MockHttpServletResponse(); + RequestContextHolder.resetRequestAttributes(); + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpReq, httpResp)); + + final Map spConfig = new HashMap<>(); + spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); + spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); + oaParam = new DummySpConfiguration(spConfig, basicConfig); + + pendingReq = new TestRequestImpl(); + pendingReq.setSpConfig(oaParam); + pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); + pendingReq.setAuthUrl("http://test.com/"); + + } + + @Test + @DirtiesContext + public void withCustomStaticProviderNameForPublicSPs() throws TaskExecutionException, + SpecificCommunicationException { + executionContext.put(MsEidasNodeConstants.REQ_PARAM_SELECTED_COUNTRY, "CC"); + + try { + task.execute(pendingReq, executionContext); + + } catch (final TaskExecutionException e) { + // forward URL is not set in example config + org.springframework.util.Assert.isInstanceOf(EaafConfigurationException.class, e.getOriginalException(), + "Wrong exception"); + Assert.assertEquals("wrong errorCode", "config.08", ((EaafException) e.getOriginalException()) + .getErrorId()); + Assert.assertEquals("wrong parameter size", 1, ((EaafException) e.getOriginalException()) + .getParams().length); + Assert.assertEquals("wrong errorMsg", Constants.CONIG_PROPS_EIDAS_NODE_FORWARD_URL, ((EaafException) e + .getOriginalException()).getParams()[0]); + + } + + final ILightRequest eidasReq = commService.getAndRemoveRequest(null, null); + + Assert.assertEquals("ProviderName is not Static", "myNode", eidasReq.getProviderName()); + Assert.assertEquals("no PublicSP", "public", eidasReq.getSpType()); + Assert.assertEquals("wrong LoA", "http://eidas.europa.eu/LoA/high", eidasReq.getLevelOfAssurance()); + } + +} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasAttributePostProcessingTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasAttributePostProcessingTest.java new file mode 100644 index 00000000..55a3ce99 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasAttributePostProcessingTest.java @@ -0,0 +1,458 @@ +/* + * Copyright 2018 A-SIT Plus GmbH + * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, + * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "License"); + * You may not use this work except in compliance with the License. + * You may obtain a copy of the License at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. +*/ + +package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; + +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Map; + +import org.joda.time.DateTime; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.ErnbEidData; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/SpringTest-context_tasks_test.xml") +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +public class EidasAttributePostProcessingTest { + + @Autowired + private CcSpecificEidProcessingService postProcessor; + + // lower case + private static final String P1_eIDASID = + "DE/AT/532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25"; + private static final String P1_GIVENNAME = "Max"; + private static final String P1_FAMILYNAME = "Mustermann"; + private static final DateTime P1_DATEOFBIRTH = DateTime.now(); + private static final String P1_PLACEOFBIRTH = "Nirgendwo"; + private static final String P1_BIRTHNAME = "Musterkind"; + + // mixed + private static final String P3_eIDASID = + "DE/AT/532eaabd9574880dbf76b9b8cc00832c20A6ec113d682299550d7a6e0f345e25"; + private static final String P3_GIVENNAME = "Max"; + private static final String P3_FAMILYNAME = "Mustermann"; + private static final DateTime P3_DATEOFBIRTH = DateTime.now(); + private static final String P3_PLACEOFBIRTH = "Nirgendwo"; + private static final String P3_BIRTHNAME = "Musterkind"; + + // upper case + private static final String P4_eIDASID = + "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F345E25"; + private static final String P4_GIVENNAME = "Max"; + private static final String P4_FAMILYNAME = "Mustermann"; + private static final DateTime P4_DATEOFBIRTH = DateTime.now(); + private static final String P4_PLACEOFBIRTH = "Nirgendwo"; + private static final String P4_BIRTHNAME = "Musterkind"; + + // To long identifier + private static final String P5_eIDASID = + "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F345E251"; + private static final String P5_GIVENNAME = "Max"; + private static final String P5_FAMILYNAME = "Mustermann"; + private static final DateTime P5_DATEOFBIRTH = DateTime.now(); + private static final String P5_PLACEOFBIRTH = "Nirgendwo"; + private static final String P5_BIRTHNAME = "Musterkind"; + + // to short identifier + private static final String P6_eIDASID = "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F"; + private static final String P6_GIVENNAME = "Max"; + private static final String P6_FAMILYNAME = "Mustermann"; + private static final DateTime P6_DATEOFBIRTH = DateTime.now(); + private static final String P6_PLACEOFBIRTH = "Nirgendwo"; + private static final String P6_BIRTHNAME = "Musterkind"; + + // no hex encoded identifier + private static final String P7_eIDASID = "DE/AT/532EAABD9574880DBF76B9B8CC00832C20A6EC113D682299550D7A6E0F"; + private static final String P7_GIVENNAME = "Max"; + private static final String P7_FAMILYNAME = "Mustermann"; + private static final DateTime P7_DATEOFBIRTH = DateTime.now(); + private static final String P7_PLACEOFBIRTH = "Nirgendwo"; + private static final String P7_BIRTHNAME = "Musterkind"; + + private static final String P2_eIDASID = + "EE/AT/asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd"; + private static final String P2_GIVENNAME = "Max"; + private static final String P2_FAMILYNAME = "Mustermann"; + private static final DateTime P2_DATEOFBIRTH = DateTime.now(); + private static final String P2_PLACEOFBIRTH = "Nirgendwo"; + private static final String P2_BIRTHNAME = "Musterkind"; + + /** + * jUnit class initializer. + * + * @throws IOException In case of an error + */ + @BeforeClass + public static void classInitializer() throws IOException { + final String current = new java.io.File(".").toURI().toString(); + System.setProperty("eidas.ms.configuration", current + "../../basicConfig/default_config.properties"); + + } + + @Test + public void deWithHexLowerCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P1_eIDASID, + P1_FAMILYNAME, + P1_GIVENNAME, + P1_DATEOFBIRTH, + P1_PLACEOFBIRTH, + P1_BIRTHNAME)); + + validate(result, + "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", + P1_FAMILYNAME, + P1_GIVENNAME, + P1_DATEOFBIRTH, + P1_PLACEOFBIRTH, + P1_BIRTHNAME); + + } catch (final Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + + } + } + + @Test + public void deWithHexMixedCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P3_eIDASID, + P3_FAMILYNAME, + P3_GIVENNAME, + P3_DATEOFBIRTH, + P3_PLACEOFBIRTH, + P3_BIRTHNAME)); + + validate(result, + "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", + P3_FAMILYNAME, + P3_GIVENNAME, + P3_DATEOFBIRTH, + P3_PLACEOFBIRTH, + P3_BIRTHNAME); + + } catch (final Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + + } + } + + @Test + public void deWithHexUpperCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P4_eIDASID, + P4_FAMILYNAME, + P4_GIVENNAME, + P4_DATEOFBIRTH, + P4_PLACEOFBIRTH, + P4_BIRTHNAME)); + + validate(result, + "Uy6qvZV0iA2/drm4zACDLCCm7BE9aCKZVQ16bg80XiU=", + P4_FAMILYNAME, + P4_GIVENNAME, + P4_DATEOFBIRTH, + P4_PLACEOFBIRTH, + P4_BIRTHNAME); + + } catch (final Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + + } + } + + @Test + public void deWithHexTooLongCase() throws Exception { + try { + postProcessor.postProcess( + generateInputData( + P5_eIDASID, + P5_FAMILYNAME, + P5_GIVENNAME, + P5_DATEOFBIRTH, + P5_PLACEOFBIRTH, + P5_BIRTHNAME)); + + } catch (final Exception e) { + return; + + } + + fail("Too long input accepted"); + } + + @Test + public void deWithHexTooShortCase() throws Exception { + try { + postProcessor.postProcess( + generateInputData( + P6_eIDASID, + P6_FAMILYNAME, + P6_GIVENNAME, + P6_DATEOFBIRTH, + P6_PLACEOFBIRTH, + P6_BIRTHNAME)); + + } catch (final Exception e) { + return; + + } + + fail("Too short input accepted"); + } + + @Test + public void deWithNoHexCase() throws Exception { + try { + postProcessor.postProcess( + generateInputData( + P7_eIDASID, + P7_FAMILYNAME, + P7_GIVENNAME, + P7_DATEOFBIRTH, + P7_PLACEOFBIRTH, + P7_BIRTHNAME)); + + } catch (final Exception e) { + return; + + } + + fail("Not hex encoded input accepted"); + } + + @Test + public void eeTestCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P2_eIDASID, + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME)); + + validate(result, + "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME); + + } catch (final Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + + } + } + + @Test + public void eeTestFamilyNameMissingCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P2_eIDASID, + null, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME)); + + validate(result, + "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME); + + } catch (final Exception e) { + return; + + } + + fail("FamilyName missing input accepted"); + + } + + @Test + public void eeTestGivenNameMissingCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P2_eIDASID, + P2_FAMILYNAME, + null, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME)); + + validate(result, + "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME); + + } catch (final Exception e) { + return; + + } + + fail("GivenName missing input accepted"); + + } + + @Test + public void eeTestDateOfBirthMissingCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + P2_eIDASID, + P2_FAMILYNAME, + P2_GIVENNAME, + null, + P2_PLACEOFBIRTH, + P2_BIRTHNAME)); + + validate(result, + "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME); + + } catch (final Exception e) { + return; + + } + + fail("DateOfBirth missing input accepted"); + + } + + @Test + public void eeTestIdMissingCase() throws Exception { + try { + final ErnbEidData result = postProcessor.postProcess( + generateInputData( + null, + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME)); + + validate(result, + "asfasfasdfasdfasdfasdfasdfasvafasdfasdfasdfasdfasdfasvascasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd", + P2_FAMILYNAME, + P2_GIVENNAME, + P2_DATEOFBIRTH, + P2_PLACEOFBIRTH, + P2_BIRTHNAME); + + } catch (final Exception e) { + return; + + } + + fail("eIDAS-Id missing input accepted"); + + } + + private Map generateInputData(String id, String familyName, String givenName, + DateTime dateOfBirth, String placeOfBirth, String birthName) { + final Map result = new HashMap<>(); + result.put(Constants.eIDAS_ATTR_PERSONALIDENTIFIER, id); + result.put(Constants.eIDAS_ATTR_CURRENTGIVENNAME, givenName); + result.put(Constants.eIDAS_ATTR_CURRENTFAMILYNAME, familyName); + result.put(Constants.eIDAS_ATTR_DATEOFBIRTH, dateOfBirth); + result.put(Constants.eIDAS_ATTR_PLACEOFBIRTH, placeOfBirth); + result.put(Constants.eIDAS_ATTR_BIRTHNAME, birthName); + return result; + + } + + private void validate(ErnbEidData result, String id, String familyName, String givenName, + DateTime dateOfBirth, String placeOfBirth, String birthName) { + if (!result.getPseudonym().equals(id)) { + fail(result.getPseudonym() + "is not equal to " + id); + } + + if (!result.getFamilyName().equals(familyName)) { + fail(result.getFamilyName() + "is not equal to " + familyName); + } + + if (!result.getGivenName().equals(givenName)) { + fail(result.getGivenName() + "is not equal to " + givenName); + } + + if (!result.getDateOfBirth().equals(dateOfBirth)) { + fail(result.getDateOfBirth() + "is not equal to " + dateOfBirth); + } + + if (!result.getFormatedDateOfBirth().equals(new SimpleDateFormat("yyyy-MM-dd").format(dateOfBirth + .toDate()))) { + fail(result.getDateOfBirth() + "is not equal to " + new SimpleDateFormat("yyyy-MM-dd").format( + dateOfBirth.toDate())); + } + + if (!result.getPlaceOfBirth().equals(placeOfBirth)) { + fail(result.getPlaceOfBirth() + "is not equal to " + placeOfBirth); + } + + if (!result.getBirthName().equals(birthName)) { + fail(result.getBirthName() + "is not equal to " + birthName); + } + + } + +} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingFirstTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingFirstTest.java new file mode 100644 index 00000000..880c32ae --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingFirstTest.java @@ -0,0 +1,147 @@ +/* + * Copyright 2018 A-SIT Plus GmbH + * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, + * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "License"); + * You may not use this work except in compliance with the License. + * You may obtain a copy of the License at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. +*/ + +package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidPostProcessingException; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; +import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; +import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; +import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; +import eu.eidas.auth.commons.light.impl.LightRequest; +import eu.eidas.auth.commons.light.impl.LightRequest.Builder; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/SpringTest-context_tasks_test.xml") +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +public class EidasRequestPreProcessingFirstTest { + + @Autowired + private IConfigurationWithSP basicConfig; + @Autowired + private CcSpecificEidProcessingService preProcessor; + + private TestRequestImpl pendingReq; + private DummySpConfiguration oaParam; + private Builder authnRequestBuilder; + + /** + * jUnit class initializer. + * + * @throws IOException In case of an error + */ + @BeforeClass + public static void classInitializer() throws IOException { + final String current = new java.io.File(".").toURI().toString(); + System.setProperty("eidas.ms.configuration", current + "../../basicConfig/default_config.properties"); + + } + + /** + * jUnit test set-up. + * + */ + @Before + public void setUp() { + + final Map spConfig = new HashMap<>(); + spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); + spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); + oaParam = new DummySpConfiguration(spConfig, basicConfig); + + pendingReq = new TestRequestImpl(); + pendingReq.setSpConfig(oaParam); + pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); + pendingReq.setAuthUrl("http://test.com/"); + + authnRequestBuilder = LightRequest.builder(); + authnRequestBuilder.id(UUID.randomUUID().toString()); + authnRequestBuilder.issuer("Test"); + + } + + @Test + public void prePreProcessGeneric() throws EidPostProcessingException { + final String testCountry = "XX"; + authnRequestBuilder.citizenCountryCode(testCountry); + preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); + + final LightRequest lightReq = authnRequestBuilder.build(); + + Assert.assertEquals("ProviderName is not Static", + Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); + Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); + Assert.assertEquals("Requested attribute size not match", 4, lightReq.getRequestedAttributes().size()); + + } + + @Test + public void prePreProcessGenericNoCountryCode() throws EidPostProcessingException { + final String testCountry = "XX"; + authnRequestBuilder.citizenCountryCode(testCountry); + preProcessor.preProcess(null, pendingReq, authnRequestBuilder); + + final LightRequest lightReq = authnRequestBuilder.build(); + + Assert.assertEquals("ProviderName is not Static", + Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); + Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); + Assert.assertEquals("Requested attribute size not match", 4, lightReq.getRequestedAttributes().size()); + + } + + @Test + public void prePreProcessDE() throws EidPostProcessingException { + + final String testCountry = "DE"; + authnRequestBuilder.citizenCountryCode(testCountry); + preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); + + final LightRequest lightReq = authnRequestBuilder.build(); + + Assert.assertEquals("ProviderName is not Static", + Constants.DEFAULT_PROPS_EIDAS_NODE_STATIC_PROVIDERNAME_FOR_PUBLIC_SP, lightReq.getProviderName()); + Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); + Assert.assertEquals("Requested attribute size not match", 8, lightReq.getRequestedAttributes().size()); + + } + +} diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingSecondTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingSecondTest.java new file mode 100644 index 00000000..da7e3d85 --- /dev/null +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/validation/EidasRequestPreProcessingSecondTest.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 A-SIT Plus GmbH + * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, + * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "License"); + * You may not use this work except in compliance with the License. + * You may obtain a copy of the License at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. +*/ + +package at.asitplus.eidas.specific.modules.auth.eidas.v2.test; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.EidPostProcessingException; +import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.CcSpecificEidProcessingService; +import at.gv.egiz.eaaf.core.api.data.EaafConfigConstants; +import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP; +import at.gv.egiz.eaaf.core.impl.idp.module.test.DummySpConfiguration; +import at.gv.egiz.eaaf.core.impl.idp.module.test.TestRequestImpl; +import eu.eidas.auth.commons.light.impl.LightRequest; +import eu.eidas.auth.commons.light.impl.LightRequest.Builder; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("/SpringTest-context_tasks_test.xml") +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +public class EidasRequestPreProcessingSecondTest { + + @Autowired + private IConfigurationWithSP basicConfig; + @Autowired + private CcSpecificEidProcessingService preProcessor; + + private TestRequestImpl pendingReq; + private DummySpConfiguration oaParam; + private Builder authnRequestBuilder; + + /** + * jUnit class initializer. + * + * @throws IOException In case of an error + */ + @BeforeClass + public static void classInitializer() throws IOException { + final String current = new java.io.File(".").toURI().toString(); + System.setProperty("eidas.ms.configuration", current + + "src/test/resources/config/junit_config_1.properties"); + + } + + /** + * jUnit test set-up. + * + */ + @Before + public void setUp() { + + final Map spConfig = new HashMap<>(); + spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp"); + spConfig.put("target", "urn:publicid:gv.at:cdid+XX"); + oaParam = new DummySpConfiguration(spConfig, basicConfig); + + pendingReq = new TestRequestImpl(); + pendingReq.setSpConfig(oaParam); + pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue()); + pendingReq.setAuthUrl("http://test.com/"); + + authnRequestBuilder = LightRequest.builder(); + authnRequestBuilder.id(UUID.randomUUID().toString()); + authnRequestBuilder.issuer("Test"); + + } + + @Test + public void prePreProcessDeUnknownAttribute() throws EidPostProcessingException { + + final String testCountry = "DE"; + authnRequestBuilder.citizenCountryCode(testCountry); + preProcessor.preProcess(testCountry, pendingReq, authnRequestBuilder); + + final LightRequest lightReq = authnRequestBuilder.build(); + + Assert.assertEquals("ProviderName is not Static", "myNode", lightReq.getProviderName()); + Assert.assertEquals("no PublicSP", "public", lightReq.getSpType()); + Assert.assertEquals("Requested attribute size not match", 8, lightReq.getRequestedAttributes().size()); + + } + +} -- cgit v1.2.3