aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at/gv
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2015-07-21 15:30:40 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2015-07-21 15:30:40 +0200
commit4795b273bb734f04056babe963d8588ffbf50fb0 (patch)
tree4c38c2a7b957608ad21034ec40b96466d3f3f98e /id/server/moa-id-commons/src/main/java/at/gv
parenta10034425b325acaf9796183d1206979664e483d (diff)
downloadmoa-id-spss-4795b273bb734f04056babe963d8588ffbf50fb0.tar.gz
moa-id-spss-4795b273bb734f04056babe963d8588ffbf50fb0.tar.bz2
moa-id-spss-4795b273bb734f04056babe963d8588ffbf50fb0.zip
fix MOA-ID-Auth problems
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java4
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java6
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java4
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java24
5 files changed, 32 insertions, 8 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java
index e084c07e5..b97813681 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java
@@ -81,8 +81,8 @@ public class MOAIDConstants {
ALLOWED_WBPK_PREFIXES = Collections.unmodifiableList(awbpk);
List<String> keyboxIDs = new ArrayList<String>();
- awbpk.add(KEYBOXIDENTIFIER_SECURE);
- awbpk.add(KEYBOXIDENTIFIER_CERTIFIED);
+ keyboxIDs.add(KEYBOXIDENTIFIER_SECURE);
+ keyboxIDs.add(KEYBOXIDENTIFIER_CERTIFIED);
ALLOWED_KEYBOXIDENTIFIER = Collections.unmodifiableList(keyboxIDs);
List<String> redirectTargets = new ArrayList<String>();
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
index 762ae44a0..a9d8d92da 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java
@@ -52,7 +52,7 @@ public class ConfigurationUtil {
try (FileOutputStream outStream = new FileOutputStream(outFile);) {
// get config from xml file
- JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config");
+ JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config.deprecated");
Unmarshaller m = jc.createUnmarshaller();
MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream);
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 bd5c9e73c..ad34360d8 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
@@ -112,8 +112,7 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
public static final String SERVICE_AUTH_MANDATES_OVS_PROFILES = SERVICE_AUTH_MANDATES_OVS + ".profiles";
public static final String SERVICE_AUTH_MANDATES_HVB = SERVICE_AUTH_MANDATES + ".hvb";
public static final String SERVICE_AUTH_MANDATES_HVB_USE = SERVICE_AUTH_MANDATES_HVB + ".use";
-
-
+
public static final String SERVICE_AUTH_FOREIGNBPK = AUTH + "." + FOREIGNBPK;
public static final String SERVICE_AUTH_FOREIGNBPK_DECRYPT = SERVICE_AUTH_FOREIGNBPK + ".decrypt";
public static final String SERVICE_AUTH_FOREIGNBPK_DECRYPT_IV = SERVICE_AUTH_FOREIGNBPK_DECRYPT + ".iv";
@@ -175,7 +174,8 @@ public final class MOAIDConfigurationConstants extends MOAIDConstants {
public static final String SERVICE_INTERFEDERATION_FORWARD_PROTOCOL = INTERFEDERATION + ".forward.protocol";
public static final String SERVICE_REVERSION = "reversion";
- public static final String SERVICE_REVERSION_EVENTCODES = SERVICE_REVERSION + ".eventcodes";
+ public static final String SERVICE_REVERSION_LOGS_ENABLED = SERVICE_REVERSION + ".log.enabled";
+ public static final String SERVICE_REVERSION_LOGS_EVENTCODES = SERVICE_REVERSION + ".log.eventcodes";
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
index 805bcb33e..20e2ba598 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java
@@ -144,7 +144,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement
//load all online application key/value pairs from database
String oaType = KeyValueUtils.getFirstChildAfterPrefix(oaIdKey, MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES);
String oaKey = KeyValueUtils.getPrefixFromKey(oaIdKey, MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER);
-
+
TypedQuery<ConfigProperty> oaConfigQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class);
oaConfigQuery.setParameter("key", oaKey + ".%");
List<ConfigProperty> oaConfigResult = oaConfigQuery.getResultList();
@@ -157,7 +157,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement
//build key/value configuration map from database entries
Map<String, String> result = getKeyValueFromDatabaseDAO(
- oaConfigResult.iterator(), oaKey, true);
+ oaConfigResult.iterator(), oaKey, true);
result.put(MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES, oaType);
return result;
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java
index f20647fb0..04eb30f72 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java
@@ -227,4 +227,28 @@ public class KeyValueUtils {
return findNextFreeListCounter((String[]) keySet.toArray(), listPrefix);
}
+
+ /**
+ * Normalize a CSV encoded list of value of an key/value pair
+ *
+ * This method removes all whitespace at the begin or the
+ * end of CSV values
+ *
+ * @param value CSV encoded input data
+ * @return normalized CSV encoded data or null if {value} is null or empty
+ */
+ public static String normalizeCSVValueString(String value) {
+ String normalizedCodes = null;
+ if (MiscUtil.isNotEmpty(value)) {
+ String[] codes = value.split(",");
+ for (String el: codes) {
+ if (normalizedCodes == null)
+ normalizedCodes = el.trim();
+ else
+ normalizedCodes += "," + el;
+
+ }
+ }
+ return normalizedCodes;
+ }
}