aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2020-04-06 10:23:53 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2020-04-06 10:23:53 +0200
commita056118bbfabb53dc2856ff07d068cd57ddc8be3 (patch)
treee8972ade3b0137e8a61e10d9717a512787c16ba5 /id/server/moa-id-commons/src/main/java/at
parent7fa91731a8b852e9a8a4ea1a152a5aa74523d47e (diff)
parentaebaed0e889413491b5769babf39a200bd312992 (diff)
downloadmoa-id-spss-a056118bbfabb53dc2856ff07d068cd57ddc8be3.tar.gz
moa-id-spss-a056118bbfabb53dc2856ff07d068cd57ddc8be3.tar.bz2
moa-id-spss-a056118bbfabb53dc2856ff07d068cd57ddc8be3.zip
Merge branch 'development_preview'
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/ConfigurationProvider.java4
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/data/IVerifiyXMLSignatureResponse.java1
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java29
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java8
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java14
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java25
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java6
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/X509Utils.java62
8 files changed, 79 insertions, 70 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/ConfigurationProvider.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/ConfigurationProvider.java
index 12b9517a6..2873b17ef 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/ConfigurationProvider.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/ConfigurationProvider.java
@@ -22,14 +22,14 @@
*/
package at.gv.egovernment.moa.id.commons.api;
-import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
+import at.gv.egiz.eaaf.core.api.idp.IConfigurationWithSP;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
/**
* @author tlenz
*
*/
-public interface ConfigurationProvider extends IConfiguration{
+public interface ConfigurationProvider extends IConfigurationWithSP{
/**
* The name of the system property which contains the file name of the
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/data/IVerifiyXMLSignatureResponse.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/data/IVerifiyXMLSignatureResponse.java
index 08dfcae71..b08a49895 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/data/IVerifiyXMLSignatureResponse.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/api/data/IVerifiyXMLSignatureResponse.java
@@ -156,6 +156,5 @@ public interface IVerifiyXMLSignatureResponse {
Date getSigningDateTime();
- void setSigningDateTime(Date signingDateTime);
} \ No newline at end of file
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
index 4adff7f19..8de41eee7 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java
@@ -154,6 +154,7 @@ public class ConfigurationMigrationUtils {
if (MiscUtil.isNotEmpty(target_full)) {
if (TargetValidator.isValidTarget(target_full)) {
result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET, target_full);
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_USE_SUB, Boolean.FALSE.toString());
} else {
String[] target_split = target_full.split("-");
@@ -182,6 +183,11 @@ public class ConfigurationMigrationUtils {
else
result.put(MOAIDConfigurationConstants.SERVICE_AUTH_AUSTRIAN_EID_DEMO_MODE, Boolean.FALSE.toString());
+ if (oa.getIseIDProxyModeActive() != null)
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_AUSTRIAN_EID_PROXY_MODE, oa.getIseIDProxyModeActive().toString());
+ else
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_AUSTRIAN_EID_PROXY_MODE, Boolean.FALSE.toString());
+
if (MiscUtil.isNotEmpty(oa.getForeignbPKTargetList()))
result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_FOREIGN, oa.getForeignbPKTargetList());
else
@@ -198,8 +204,13 @@ public class ConfigurationMigrationUtils {
//convert selected SZR-GW service
if (MiscUtil.isNotEmpty(oa.getSelectedSZRGWServiceURL()))
result.put(MOAIDConfigurationConstants.SERVICE_EXTERNAL_CENTRAL_EIDASNODE_SERVICE_URL, oa.getSelectedSZRGWServiceURL());
+
+ //convert selected E-ID service
+ if (MiscUtil.isNotEmpty(oa.getSelectedEIDServiceURL()))
+ result.put(MOAIDConfigurationConstants.SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL, oa.getSelectedEIDServiceURL());
+
- AuthComponentOA oaauth = oa.getAuthComponentOA();
+ AuthComponentOA oaauth = oa.getAuthComponentOA();
if (oaauth != null) {
//convert SL20 infos
@@ -815,7 +826,9 @@ public class ConfigurationMigrationUtils {
dbOA.setSelectedSZRGWServiceURL(oa.get(MOAIDConfigurationConstants.SERVICE_EXTERNAL_CENTRAL_EIDASNODE_SERVICE_URL));
-
+ dbOA.setSelectedEIDServiceURL(oa.get(MOAIDConfigurationConstants.SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL));
+
+
dbOA.setMandateServiceSelectionTemplateURL(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_ELGAMANDATESERVICESELECTION_URL));
dbOA.setSaml2PostBindingTemplateURL(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SAML2POSTBINDING_URL));
@@ -876,6 +889,11 @@ public class ConfigurationMigrationUtils {
else
dbOA.setIseIDDemoModeActive(false);
+ if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_AUSTRIAN_EID_PROXY_MODE)))
+ dbOA.setIseIDProxyModeActive(Boolean.valueOf(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_AUSTRIAN_EID_PROXY_MODE)));
+ else
+ dbOA.setIseIDProxyModeActive(false);
+
if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_FOREIGN)))
dbOA.setForeignbPKTargetList(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_FOREIGN));
@@ -1267,6 +1285,9 @@ public class ConfigurationMigrationUtils {
result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL,
config.getElgaMandateServiceURLs());
+ if (MiscUtil.isNotEmpty(config.getEidSystemServiceURLs()))
+ result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL,
+ config.getEidSystemServiceURLs());
AuthComponentGeneral auth = config.getAuthComponentGeneral();
@@ -1590,8 +1611,10 @@ public class ConfigurationMigrationUtils {
MOAIDConfiguration dbconfig = new MOAIDConfiguration();
- dbconfig.setElgaMandateServiceURLs(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL));
+ dbconfig.setElgaMandateServiceURLs(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL));
+ dbconfig.setEidSystemServiceURLs(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL));
+
AuthComponentGeneral dbauth = dbconfig.getAuthComponentGeneral();
if (dbauth == null) {
dbauth = new AuthComponentGeneral();
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
index 1be97c49d..87f6c6416 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java
@@ -52,6 +52,7 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
private static final String TEMPLATES = "templates";
private static final String INTERFEDERATION = "interfederation";
private static final String ELGA_MANDATE_SERVICE_URL = "modules.elga_mandate.service.entityID";
+ private static final String EID_SYSTEM_SERVICE_URL = "modules.eid_system.service.entityID";
private static final String PROTOCOLS = "protocols";
private static final String SAML1 = "saml1";
@@ -66,6 +67,7 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
public static final String SERVICE_AUTH_TARGET_FOREIGN = SERVICE_AUTH_TARGET + ".foreign";
public static final String SERVICE_AUTH_TARGET_ADDITIONAL_BPKS = SERVICE_AUTH_TARGET + ".additionalbPKs";
public static final String SERVICE_AUTH_AUSTRIAN_EID_DEMO_MODE = AUTH + ".austrianeIDdemomode";
+ public static final String SERVICE_AUTH_AUSTRIAN_EID_PROXY_MODE = AUTH + ".austrianeIDproxymode";
public static final String SERVICE_AUTH_TARGET_PUBLIC_TARGET = SERVICE_AUTH_TARGET_PUBLIC + ".target";
@@ -195,9 +197,11 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
public static final String SERVICE_REVERSION_LOGS_ENABLED = SERVICE_REVERSION + ".log.enabled";
public static final String SERVICE_REVERSION_LOGS_EVENTCODES = SERVICE_REVERSION + ".log.eventcodes";
- public static final String SERVICE_EXTERNAL_ELGA_MANDATE_SERVICE_URL = ELGA_MANDATE_SERVICE_URL;
+ public static final String SERVICE_EXTERNAL_ELGA_MANDATE_SERVICE_URL = ELGA_MANDATE_SERVICE_URL;
+
public static final String SERVICE_EXTERNAL_MIS_SERVICE_URL = "modules.mis.service.url";
public static final String SERVICE_EXTERNAL_CENTRAL_EIDASNODE_SERVICE_URL = "modules.szrgw.service.url";
+ public static final String SERVICE_EXTERNAL_EID_SYSTEM_SERVICE_URL = "modules.eidsystem.service.url";
//Namespaces for general MOA-ID config
public static final String GENERAL_PUBLICURLPREFIX = PREFIX_MOAID_GENERAL + ".publicURLPrefix";
@@ -235,6 +239,8 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
public static final String GENERAL_AUTH_SERVICES_HVB_URL = GENERAL_AUTH + ".services.hvb.url";
public static final String GENERAL_AUTH_SERVICES_ELGA_MANDATE_SERVICE_URL = PREFIX_MOAID_GENERAL + "." + ELGA_MANDATE_SERVICE_URL;
+ public static final String GENERAL_AUTH_SERVICES_EID_SYSTEM_SERVICE_URL = PREFIX_MOAID_GENERAL + "." + EID_SYSTEM_SERVICE_URL;
+
public static final String GENERAL_AUTH_SSO_SERVICENAME = GENERAL_AUTH + "." + SSO + ".servicename";
public static final String GENERAL_AUTH_SSO_TARGET = GENERAL_AUTH + "." + SSO + ".target";
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java
index c251c7abb..1cb2f3fa0 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java
@@ -187,6 +187,10 @@ public class MOAIDConfiguration
@XmlTransient
protected String elgaMandateServiceURLs = null;
+ @XmlTransient
+ protected String eidSystemServiceURLs = null;
+
+
/**
* @return the eventCodes
@@ -503,6 +507,16 @@ public class MOAIDConfiguration
this.elgaMandateServiceURLs = elgaMandateServiceURLs;
}
+
+
+ public String getEidSystemServiceURLs() {
+ return eidSystemServiceURLs;
+ }
+
+ public void setEidSystemServiceURLs(String eidSystemServiceURLs) {
+ this.eidSystemServiceURLs = eidSystemServiceURLs;
+ }
+
/**
* Sets the value of the hjid property.
*
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java
index 510fd0581..53be4d980 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java
@@ -108,6 +108,9 @@ public class OnlineApplication
@XmlTransient
protected String selectedSZRGWServiceURL = null;
+
+ @XmlTransient
+ protected String selectedEIDServiceURL = null;
@XmlTransient
protected String saml2PostBindingTemplateURL = null;
@@ -124,6 +127,9 @@ public class OnlineApplication
@XmlTransient
protected Boolean iseIDDemoModeActive = false;
+ @XmlTransient
+ protected Boolean iseIDProxyModeActive = false;
+
public String getForeignbPKTargetList() {
return foreignbPKTargetList;
@@ -152,6 +158,15 @@ public class OnlineApplication
this.iseIDDemoModeActive = iseIDDemoModeActive;
}
+ public Boolean getIseIDProxyModeActive() {
+ return iseIDProxyModeActive ;
+ }
+
+ public void setIseIDProxyModeActive(Boolean valueOf) {
+ this.iseIDProxyModeActive = valueOf;
+
+ }
+
/**
* @return the saml2PostBindingTemplateURL
*/
@@ -194,6 +209,15 @@ public class OnlineApplication
this.selectedSZRGWServiceURL = selectedSZRGWServiceURL;
}
+
+ public String getSelectedEIDServiceURL() {
+ return this.selectedEIDServiceURL;
+ }
+
+ public void setSelectedEIDServiceURL(String selectedEIDServiceURL) {
+ this.selectedEIDServiceURL = selectedEIDServiceURL;
+ }
+
/**
* @return the isRevisionsLogActive
*/
@@ -627,5 +651,4 @@ public class OnlineApplication
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
-
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java
index f4143e434..f9b43c193 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java
@@ -146,4 +146,10 @@ public String mapInternalErrorToExternalError(String intErrorCode) {
return extErrorCode;
}
+@Override
+public String getMessageWithoutDefault(String messageId, Object[] parameters) {
+ return getMessage(messageId, parameters);
+
+}
+
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/X509Utils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/X509Utils.java
deleted file mode 100644
index 026b1a5fb..000000000
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/X509Utils.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package at.gv.egovernment.moa.id.commons.utils;
-
-import java.security.cert.X509Certificate;
-import java.util.List;
-
-import javax.security.auth.x500.X500Principal;
-
-public class X509Utils {
-
- /**
- * Sorts the Certificate Chain by IssuerDN and SubjectDN. The [0]-Element should be the Hostname,
- * the last Element should be the Root Certificate.
- *
- * @param certs
- * The first element must be the correct one.
- * @return sorted Certificate Chain
- */
- public static List<X509Certificate> sortCertificates(
- List<X509Certificate> certs)
- {
- int length = certs.size();
- if (certs.size() <= 1)
- {
- return certs;
- }
-
- for (X509Certificate cert : certs)
- {
- if (cert == null)
- {
- throw new NullPointerException();
- }
- }
-
- for (int i = 0; i < length; i++)
- {
- boolean found = false;
- X500Principal issuer = certs.get(i).getIssuerX500Principal();
- for (int j = i + 1; j < length; j++)
- {
- X500Principal subject = certs.get(j).getSubjectX500Principal();
- if (issuer.equals(subject))
- {
- // sorting necessary?
- if (i + 1 != j)
- {
- X509Certificate tmp = certs.get(i + 1);
- certs.set(i + 1, certs.get(j));
- certs.set(j, tmp);
- }
- found = true;
- }
- }
- if (!found)
- {
- break;
- }
- }
-
- return certs;
- }
-}