aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/stork2-saml-engine')
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java18
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml6
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml)0
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml)0
4 files changed, 16 insertions, 8 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
index 9ae8bb669..e9b067e76 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
@@ -15,6 +15,7 @@
package eu.stork.peps.configuration;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -119,8 +120,14 @@ public final class ConfigurationReader {
*/
public static Map<String, InstanceEngine> readConfiguration()
throws SAMLEngineException {
-
- LOGGER.info("Init reader: " + ENGINE_CONF_FILE);
+
+ // fetch base from system properties, give a default if there is nothing configured
+ String base = System.getProperty("eu.stork.samlengine.config.location");
+ if(null != base)
+ if(!base.endsWith("/"))
+ base += "/";
+
+ LOGGER.info("Init reader: " + base + ENGINE_CONF_FILE);
final Map<String, InstanceEngine> instanceConfs =
new HashMap<String, InstanceEngine>();
@@ -137,9 +144,10 @@ public final class ConfigurationReader {
builder = factory.newDocumentBuilder();
- engineConf = ConfigurationReader.class
- .getResourceAsStream("/" + ENGINE_CONF_FILE);
-
+ if(null != base)
+ engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
+ else
+ engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
document = builder.parse(engineConf);
diff --git a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
index d9dcb34f8..48fd9adff 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
@@ -3,10 +3,10 @@
<!-- Configuration name-->
- <instance name="CONF0">
+ <instance name="outgoing">
<!-- Configurations parameters StorkSamlEngine -->
<configuration name="SamlEngineConf">
- <parameter name="fileConfiguration" value="StorkSamlEngine_demo.xml" />
+ <parameter name="fileConfiguration" value="StorkSamlEngine_outgoing.xml" />
</configuration>
<!-- Settings module signature-->
@@ -14,7 +14,7 @@
<!-- Specific signature module -->
<parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
<!-- Settings specific module -->
- <parameter name="fileConfiguration" value="SignModule_demo.xml" />
+ <parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
</configuration>
</instance>
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
index c7cee3af4..c7cee3af4 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml
index f8fc4f91a..f8fc4f91a 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml