aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java15
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java13
2 files changed, 21 insertions, 7 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
index a143eb636..087b331b5 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
@@ -274,6 +274,12 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements
}
/**
+ * Protected constructor. Used by unit tests.
+ */
+ protected AuthConfigurationProvider() {
+ }
+
+ /**
* Load the configuration data from XML file with the given name and build
* the internal data structures representing the MOA ID configuration.
*
@@ -493,12 +499,15 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements
throw new ConfigurationException("config.02", null, t);
}
}
-
+
+ protected MOAIDConfiguration loadDataBaseConfig() {
+ return ConfigurationDBRead.getMOAIDConfiguration();
+ }
+
public synchronized void reloadDataBaseConfig() throws ConfigurationException {
Logger.info("Read MOA-ID 2.0 configuration from database.");
- //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
- moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration();
+ moaidconfig = loadDataBaseConfig();
Logger.info("MOA-ID 2.0 is loaded.");
if (moaidconfig == null) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java
index 77a9f032c..0ee143a1a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java
@@ -54,10 +54,12 @@ import com.datentechnik.moa.id.conf.persistence.Configuration;
*/
public class NewAuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration {
- @Autowired
private Configuration configuration;
private final Properties properties = new Properties();
+
+ public NewAuthConfigurationProvider() {
+ }
public NewAuthConfigurationProvider(String fileName) throws ConfigurationException {
File propertiesFile = new File(fileName);
@@ -71,6 +73,11 @@ public class NewAuthConfigurationProvider extends ConfigurationProvider implemen
throw new ConfigurationException("config.03", null, e);
}
}
+
+ @Autowired
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
private Properties getProperties() {
return properties;
@@ -105,11 +112,9 @@ public class NewAuthConfigurationProvider extends ConfigurationProvider implemen
} catch (ConfigurationException e) {
return null;
}
- ProtocolAllowed allowedProtcols = new ProtocolAllowed();
Protocols protocols = authComponentGeneral.getProtocols();
if (protocols != null) {
- allowedProtcols = new ProtocolAllowed();
-
+ ProtocolAllowed allowedProtcols = new ProtocolAllowed();
if (protocols.getSAML1() != null) {
allowedProtcols.setSAML1Active(protocols.getSAML1().isIsActive());
}