aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-08-27 11:32:05 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-08-27 11:32:05 +0200
commitbb1b12ac5b240629e16ea1c7a50891e99f4adc14 (patch)
tree5a77e4fd20a6c22f34be8d7546c01199fe343bb9 /id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config
parentea10821a16993913222f12e1b919fe3d48c29b30 (diff)
downloadmoa-id-spss-bb1b12ac5b240629e16ea1c7a50891e99f4adc14.tar.gz
moa-id-spss-bb1b12ac5b240629e16ea1c7a50891e99f4adc14.tar.bz2
moa-id-spss-bb1b12ac5b240629e16ea1c7a50891e99f4adc14.zip
Use test- and productive TrustStore configurations in one IDP instance
- every service configuration could select its preferred TrustStore
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java43
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java4
2 files changed, 38 insertions, 9 deletions
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 05de581d2..38a111707 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
@@ -270,7 +270,11 @@ public class ConfigurationMigrationUtils {
}
result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_OIDs, oids);
- }
+ }
+
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTIDLTRUSTSTORE, String.valueOf(oaauth.getTestCredentials().isUseTestIDLTrustStore()));
+ result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTAUTHBLOCKTRUSTSTORE, String.valueOf(oaauth.getTestCredentials().isUseTestAuthBlockTrustStore()));
+
}
//convert foreign bPK
@@ -856,10 +860,12 @@ public class ConfigurationMigrationUtils {
}
authoa.setMandates(mandates);
- if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED))) {
- TestCredentials testing = authoa.getTestCredentials();
- testing = new TestCredentials();
- authoa.setTestCredentials(testing);
+ TestCredentials testing = authoa.getTestCredentials();
+ if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED))) {
+ if (testing == null) {
+ testing = new TestCredentials();
+ authoa.setTestCredentials(testing);
+ }
testing.setEnableTestCredentials(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED)));
if (oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_OIDs) != null) {
@@ -868,15 +874,29 @@ public class ConfigurationMigrationUtils {
testing.setCredentialOID(testCredentialOIDs);
}
- } else {
- TestCredentials testing = authoa.getTestCredentials();
+ } else {
if (testing != null) {
testing.setEnableTestCredentials(false);
}
}
-
+
+ if (testing == null) {
+ testing = new TestCredentials();
+ authoa.setTestCredentials(testing);
+ }
+
+ if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTIDLTRUSTSTORE)))
+ testing.setUseTestIDLTrustStore(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTIDLTRUSTSTORE)));
+ else
+ testing.setUseTestIDLTrustStore(false);
+ if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTAUTHBLOCKTRUSTSTORE)))
+ testing.setUseTestAuthBlockTrustStore(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_USETESTAUTHBLOCKTRUSTSTORE)));
+ else
+ testing.setUseTestAuthBlockTrustStore(false);
+
+
EncBPKInformation bPKEncDec = authoa.getEncBPKInformation();
if (bPKEncDec == null) {
bPKEncDec = new EncBPKInformation();
@@ -1188,6 +1208,9 @@ public class ConfigurationMigrationUtils {
if (authblock != null) {
result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD,
authblock.getTrustProfileID());
+ result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_TEST,
+ authblock.getTestTrustProfileID());
+
List<String> list = authblock.getVerifyTransformsInfoProfileID();
if (list.size() == 1)
@@ -1203,6 +1226,8 @@ public class ConfigurationMigrationUtils {
if (idl != null) {
result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD,
idl.getTrustProfileID());
+ result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_TEST,
+ idl.getTestTrustProfileID());
}
}
@@ -1721,12 +1746,14 @@ public class ConfigurationMigrationUtils {
dbmoasp.setVerifyIdentityLink(moaidl);
}
moaidl.setTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD));
+ moaidl.setTestTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_TEST));
VerifyAuthBlock moaauth = dbmoasp.getVerifyAuthBlock();
if (moaauth == null) {
moaauth = new VerifyAuthBlock();
dbmoasp.setVerifyAuthBlock(moaauth);
}
moaauth.setTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD));
+ moaauth.setTestTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_TEST));
if (moaauth.getVerifyTransformsInfoProfileID() == null) {
moaauth.setVerifyTransformsInfoProfileID(new ArrayList<String>());
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 07c3151a2..c338c65ba 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
@@ -107,7 +107,9 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
private static final String SERVICE_AUTH_TESTCREDENTIALS = AUTH + "." + TESTCREDENTIALS;
public static final String SERVICE_AUTH_TESTCREDENTIALS_ENABLED = SERVICE_AUTH_TESTCREDENTIALS + ".enabled";
public static final String SERVICE_AUTH_TESTCREDENTIALS_OIDs = SERVICE_AUTH_TESTCREDENTIALS + ".oids";
-
+ public static final String SERVICE_AUTH_TESTCREDENTIALS_USETESTIDLTRUSTSTORE = SERVICE_AUTH_TESTCREDENTIALS + "useTestIDLTrustStore";
+ public static final String SERVICE_AUTH_TESTCREDENTIALS_USETESTAUTHBLOCKTRUSTSTORE = SERVICE_AUTH_TESTCREDENTIALS + "useTestAuthBlockTrustStore";
+
private static final String SERVICE_AUTH_MANDATES = AUTH + "." + MANDATES;
public static final String SERVICE_AUTH_MANDATES_OVS = SERVICE_AUTH_MANDATES + ".ovs";
public static final String SERVICE_AUTH_MANDATES_OVS_USE = SERVICE_AUTH_MANDATES_OVS + ".use";