From 35993eab38db2aa67137d674baa31031266c2b2e Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 4 Jul 2014 14:41:55 +0200 Subject: fix: overwrite single config instead of deleting old one --- .../java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java index 88220cded..e890e2145 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java @@ -147,8 +147,8 @@ public class ConfigurationDBRead { Logger.trace("Found entries: " + result.size()); if (result.size() == 0) { - Logger.trace("No entries found."); - return null; + Logger.trace("No entries found. Create fresh instance."); + return new MOAIDConfiguration(); } return (MOAIDConfiguration) result.get(0); -- cgit v1.2.3 From 27c5460e2138fbb7de64214a7538b98effb5a7a6 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 4 Jul 2014 14:44:26 +0200 Subject: fix: CPEPS list is now edited in place instead of clean and refill --- .../java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java index 6bd987f96..cdb19340d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java @@ -154,7 +154,7 @@ public final class ConfigurationDBUtils { synchronized (session) { tx.begin(); - session.persist(dbo); + session.merge(dbo); tx.commit(); //session.clear(); -- cgit v1.2.3 From 5e77090ce5f718f5d6c50e4d2e2a2337a92e91a6 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 7 Jul 2014 09:19:40 +0200 Subject: many-to-many around cpeps list handling --- .../src/main/resources/config/bindings.xjb | 20 ++++++++++++++++++++ .../src/main/resources/config/moaid_config_2.0.xsd | 2 ++ 2 files changed, 22 insertions(+) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb index cf04319c8..43fe21465 100644 --- a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb +++ b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb @@ -2,6 +2,8 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" + xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations" + xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" jaxb:extensionBindingPrefixes="hj"> @@ -12,4 +14,22 @@ adapter="com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter"/> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index 8bc532236..f99304dcc 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -803,6 +803,7 @@ Name zum Key eines KeyStores, der den privaten Schlüssel zum Erstellen einer Signatur darstellt + @@ -822,6 +823,7 @@ + -- cgit v1.2.3 From f595cb0d46358e44fad838dd01a449e40c52e18b Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 7 Jul 2014 10:33:51 +0200 Subject: fixed many-to-many sql syntax hibernate problem with linux mysqlserver --- id/server/moa-id-commons/src/main/resources/config/bindings.xjb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb index 43fe21465..21714849b 100644 --- a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb +++ b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + -- cgit v1.2.3 From 45727ed45e3deec0fff835a26f9b87adcfd0c6ba Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 8 Jul 2014 09:38:37 +0200 Subject: fix exception if attribute is not provided --- .../moa/id/auth/stork/STORKResponseProcessor.java | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 2c8b44404..2f1e50a05 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -136,8 +136,10 @@ public class STORKResponseProcessor { Logger.trace("Starting call..."); // if there is no signedDoc attribute, we cannot go on + String fiscalNumber = null; String citizenSignature = getAttributeValue("signedDoc", attributeList); - String fiscalNumber = getAttributeValue("fiscalNumber", attributeList); + if (hasAttribute("fiscalNumber", attributeList)) + fiscalNumber = getAttributeValue("fiscalNumber", attributeList); // if we have a signedDoc we test for a representation case // - according to stork samlengine and commons @@ -156,14 +158,15 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList); String givenName = getAttributeValue("givenName", attributeList); String lastName = getAttributeValue("surname", attributeList); - String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + String dateOfBirth = null; + if (hasAttribute("dateOfBirth", attributeList)) { + dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); + } // gender attribute is mandatory here because of some legal stuff String gender = getAttributeValue("gender", attributeList); - if (!StringUtils.isEmpty(dateOfBirth)) - dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, null, null, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber); @@ -187,14 +190,15 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList); String givenName = getAttributeValue("givenName", attributeList); String lastName = getAttributeValue("surname", attributeList); - String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + String dateOfBirth = null; + if (hasAttribute("dateOfBirth", attributeList)) { + dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); + } // gender attribute is mandatory here because of some legal stuff String gender = getAttributeValue("gender", attributeList); - - if (!StringUtils.isEmpty(dateOfBirth)) - dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate, targetType, targetValue, oaFriendlyName, filters, fiscalNumber); @@ -204,9 +208,11 @@ public class STORKResponseProcessor { String eIdentifier = getAttributeValue("eIdentifier", attributeList); String givenName = getAttributeValue("givenName", attributeList); String lastName = getAttributeValue("surname", attributeList); - String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); - if (!StringUtils.isEmpty(dateOfBirth)) + String dateOfBirth = null; + if (hasAttribute("dateOfBirth", attributeList)) { + dateOfBirth = getAttributeValue("dateOfBirth", attributeList); dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); + } identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, fiscalNumber); } -- cgit v1.2.3