aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main
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
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')
-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
-rw-r--r--id/server/moa-id-commons/src/main/resources/configuration.beans.xml34
-rw-r--r--id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml13
7 files changed, 43 insertions, 44 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;
+ }
}
diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
index 775d02d05..4d3caea8c 100644
--- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
+++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml
@@ -11,44 +11,10 @@
<context:annotation-config />
- <!-- context:property-placeholder location="${location}"/-->
-
-<!-- <bean class="at.gv.egovernment.moa.id.commons.config.persistence.JPAPropertiesWithJavaConfig">
- </bean> -->
-
<bean id="configPropertyDao"
class="at.gv.egovernment.moa.id.commons.db.dao.config.DatabaseConfigPropertyImpl"/>
<bean id="moaidconfig" class="at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfigurationImpl" />
-<!-- <property name="configPropertyDao" ref="configPropertyDao" />
- </bean> -->
-
-
-<!-- <bean id="configRead" class="at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead"/> -->
-<!-- <bean id="configWrite" class="at.gv.egovernment.moa.id.commons.db.NewConfigurationDBWrite"/> -->
-
-<!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" lazy-init="true" destroy-method="close">
- <aop:scoped-proxy/>
- <property name="driverClassName" value="${hibernate.connection.driver_class}" />
- <property name="url" value="${hibernate.connection.url}"/>
- <property name="username" value="${hibernate.connection.username}" />
- <property name="password" value="${hibernate.connection.password}" />
- <property name="testOnBorrow" value="true" />
- <property name="validationQuery" value="SELECT 1" />
- </bean> -->
-
-
-<!-- <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
- <property name="showSql" value="true" />
- <property name="generateDdl" value="${jpaVendorAdapter.generateDdl}" />
- <property name="generateDdl">
- <bean class="java.lang.Boolean">
- <constructor-arg value="${jpaVendorAdapter.generateDdl}"/>
- </bean>
- </property>
- <property name="databasePlatform" value="${hibernate.dialect}" />
- </bean> -->
-
<bean name="config" id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
diff --git a/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml b/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml
index a0923c03f..3bd122254 100644
--- a/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml
+++ b/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml
@@ -21,13 +21,22 @@
<property name="url" value="${hibernate.connection.url}"/>
<property name="username" value="${hibernate.connection.username}" />
<property name="password" value="${hibernate.connection.password}" />
- <property name="testOnBorrow" value="true" />
+
+ <property name="connectionProperties" value="${dbcp.connectionProperties}" />
+ <property name="initialSize" value="${dbcp.initialSize}" />
+ <property name="maxActive" value="${dbcp.maxActive}" />
+ <property name="maxIdle" value="${dbcp.maxIdle}" />
+ <property name="minIdle" value="${dbcp.minIdle}" />
+ <property name="maxWait" value="${dbcp.maxWaitMillis}" />
+ <property name="testOnBorrow" value="${dbcp.testOnBorrow}" />
+ <property name="testOnReturn" value="${dbcp.testOnReturn}" />
+ <property name="testWhileIdle" value="${dbcp.testWhileIdle}" />
<property name="validationQuery" value="SELECT 1" />
</bean>
<bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
- <property name="showSql" value="true" />
+ <property name="showSql" value="${hibernate.show_sql}" />
<property name="generateDdl" value="${jpaVendorAdapter.generateDdl}" />
<property name="databasePlatform" value="${hibernate.dialect}" />
</bean>