aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/test/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2020-08-31 13:51:14 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2020-08-31 13:51:14 +0200
commit3ead2fee52a1e43e12610fda8175cb1a74e8b1f0 (patch)
tree8b3f52b6366b9d326704a125ebc9e4dc9b30b4d3 /id/server/idserverlib/src/test/java/at
parent8322112004a0334a5d73795760880e635813793b (diff)
downloadmoa-id-spss-3ead2fee52a1e43e12610fda8175cb1a74e8b1f0.tar.gz
moa-id-spss-3ead2fee52a1e43e12610fda8175cb1a74e8b1f0.tar.bz2
moa-id-spss-3ead2fee52a1e43e12610fda8175cb1a74e8b1f0.zip
update validation in case of file:/ paths because trusted templates can be relative to config directory
Diffstat (limited to 'id/server/idserverlib/src/test/java/at')
-rw-r--r--id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java32
1 files changed, 26 insertions, 6 deletions
diff --git a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
index 7707f3b90..b2f425a2c 100644
--- a/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
+++ b/id/server/idserverlib/src/test/java/at/gv/egovernment/moa/id/config/auth/data/DummyAuthConfig.java
@@ -2,7 +2,9 @@ package at.gv.egovernment.moa.id.config.auth.data;
import java.io.IOException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -20,6 +22,7 @@ import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
import at.gv.egovernment.moa.id.commons.api.IStorkConfig;
import at.gv.egovernment.moa.id.commons.api.data.ProtocolAllowed;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
+import at.gv.egovernment.moa.util.MiscUtil;
import at.gv.util.config.EgovUtilPropertiesConfiguration;
public class DummyAuthConfig implements AuthConfiguration {
@@ -28,11 +31,12 @@ public class DummyAuthConfig implements AuthConfiguration {
private Map<String, String> basicConfig = new HashMap<>();
private List<String> slRequestTemplates;
-
+ private String configRootDir;
+
@Override
public String getRootConfigFileDir() {
- // TODO Auto-generated method stub
- return null;
+ return configRootDir;
+
}
@Override
@@ -246,7 +250,7 @@ public class DummyAuthConfig implements AuthConfiguration {
@Override
public List<String> getSLRequestTemplates() throws ConfigurationException {
- return slRequestTemplates;
+ return new ArrayList<>(slRequestTemplates);
}
@@ -451,8 +455,18 @@ public class DummyAuthConfig implements AuthConfiguration {
@Override
public URI getConfigurationRootDirectory() {
- // TODO Auto-generated method stub
- return null;
+ try {
+ if (MiscUtil.isNotEmpty(configRootDir)) {
+ return new URI(configRootDir);
+
+ }
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+
+ }
+
+ return null;
+
}
@Override
@@ -501,5 +515,11 @@ public class DummyAuthConfig implements AuthConfiguration {
slRequestTemplates = templates;
}
+
+ public void setConfigRootDir(String configRootDir) {
+ this.configRootDir = configRootDir;
+ }
+
+
}