aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2013-08-12 13:31:30 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2013-08-12 13:31:30 +0200
commit7c6ecaa8adb365a6c670cb86bb68be94136dc6a0 (patch)
treef69c954a387513aa14adf86d4bf9a81a59b80c36 /id/server/idserverlib/src/main/java
parent45e170310a012dca93d5e5d4dc0b54e6b0808e95 (diff)
downloadmoa-id-spss-7c6ecaa8adb365a6c670cb86bb68be94136dc6a0.tar.gz
moa-id-spss-7c6ecaa8adb365a6c670cb86bb68be94136dc6a0.tar.bz2
moa-id-spss-7c6ecaa8adb365a6c670cb86bb68be94136dc6a0.zip
Bugfixes:
@ConfigurationTool - AuthenticationFilter: handle of non authenticated requests after restart - Legacy Import: update legacy Configuration import process @MOA-ID - Change Legacy Configuration import
Diffstat (limited to 'id/server/idserverlib/src/main/java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java5
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java20
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java21
3 files changed, 28 insertions, 18 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 f4cdeddb7..55a20d558 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
@@ -388,6 +388,11 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
Logger.info("MOA-ID 2.0 is loaded.");
+ if (moaidconfig == null) {
+ Logger.warn("NO MOA-ID configuration found.");
+ throw new ConfigurationException("config.18", null);
+ }
+
// //TODO: only for Testing!!!
// if (MiscUtil.isNotEmpty(xmlconfigout)) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
index c807fdc7d..cb35e708c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
@@ -222,16 +222,18 @@ public class BuildFromLegacyConfig {
String[] transformsInfos = builder.loadTransformsInfos(transformsInfoFileNames);
List<TransformsInfoType> auth_transformInfos = new ArrayList<TransformsInfoType>();
-
- for (int i=0; i<transformsInfos.length; i++) {
-// for (String transformInfo : transformsInfos) {
- TransformsInfoType transforminfotype = new TransformsInfoType();
- transforminfotype.setFilename(transformsInfoFileNames[i]);
+ if (transformsInfos != null && transformsInfos.length > 0) {
+ for (int i=0; i<transformsInfos.length; i++) {
+
+ TransformsInfoType transforminfotype = new TransformsInfoType();
+ transforminfotype.setFilename(transformsInfoFileNames[i]);
- //TODO: Transformation is stored in BASE64
- transforminfotype.setTransformation(Base64Utils.encode(transformsInfos[i].getBytes("UTF-8")).getBytes("UTF-8"));
- auth_transformInfos.add(transforminfotype);
- }
+ transforminfotype.setTransformation(Base64Utils.encode(transformsInfos[i].getBytes("UTF-8")).getBytes("UTF-8"));
+ auth_transformInfos.add(transforminfotype);
+ }
+
+ }
+
SecurityLayer auth_securityLayer = new SecurityLayer();
auth_securityLayer.setTransformsInfo(auth_transformInfos);
generalAuth.setSecurityLayer(auth_securityLayer);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
index 1dfebea03..3abc94b02 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java
@@ -28,6 +28,7 @@ import iaik.pki.pathvalidation.ChainingModes;
import iaik.utils.RFC2253NameParser;
import iaik.utils.RFC2253NameParserException;
+import java.io.IOException;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
@@ -409,19 +410,21 @@ public class ConfigurationBuilder {
String[] transformsInfos;
- if (MiscUtil.isNotEmpty(rootConfigFileDir_)) {
transformsInfos = new String[transformsInfoFileNames.length];
for (int i = 0; i < transformsInfoFileNames.length; i++) {
+
String fileURL = transformsInfoFileNames[i];
-
- //if fileURL is relative to rootConfigFileDir make it absolute
- fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_);
- String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING);
- transformsInfos[i] = transformsInfo;
+ try {
+ // if fileURL is relative to rootConfigFileDir make it absolute
+ fileURL = FileUtils.makeAbsoluteURL(fileURL, rootConfigFileDir_);
+
+ String transformsInfo = FileUtils.readURL(fileURL, DEFAULT_ENCODING);
+ transformsInfos[i] = transformsInfo;
+
+ } catch (IOException e) {
+ Logger.info("Transformation with URL " + fileURL + " can not be loaded");
+ }
}
-
- } else
- transformsInfos = new String[0];
return transformsInfos;
}