From 730b8bc2de32be13016066a86498ae0181b0ee1e Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 17 Aug 2015 18:22:05 +0200 Subject: final changes for Release MOA-ID 3.0.0 --- id/ConfigWebTool/pom.xml | 2 +- .../configuration/data/FormularCustomization.java | 14 ++++-- .../moa/id/configuration/data/oa/OAPVP2Config.java | 11 ++++- .../validation/oa/OAFileUploadValidation.java | 2 +- .../validation/oa/OAPVP2ConfigValidation.java | 3 +- .../resources/applicationResources_de.properties | 2 + .../resources/applicationResources_en.properties | 3 ++ id/moa-id-webgui/pom.xml | 2 +- .../task/impl/ServicesProtocolPVP2XTask.java | 34 +++++++------ .../config/ConfigurationMigrationUtils.java | 54 +++++++++++++-------- .../dao/config/deprecated/MOAIDConfiguration.java | 2 + .../dao/config/deprecated/OnlineApplication.java | 4 ++ .../dao/config/deprecated/TransformsInfoType.java | 16 +++++- pom.xml | 2 +- .../0.3/egiz-configuration-meta-api-0.3.jar | Bin 0 -> 24396 bytes 15 files changed, 104 insertions(+), 47 deletions(-) create mode 100644 repository/at/gv/egiz/components/egiz-configuration-meta-api/0.3/egiz-configuration-meta-api-0.3.jar diff --git a/id/ConfigWebTool/pom.xml b/id/ConfigWebTool/pom.xml index 2723c0e61..10262158e 100644 --- a/id/ConfigWebTool/pom.xml +++ b/id/ConfigWebTool/pom.xml @@ -73,7 +73,7 @@ MOA.id moa-id-webgui - 1.0-SNAPSHOT + 1.0 diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java index e2d473f8a..ecf0d19d7 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/FormularCustomization.java @@ -254,12 +254,16 @@ public class FormularCustomization implements IOnlineApplicationData { //store BKU-selection and send-assertion templates if (authUser.isAdmin()) { - if (isDeleteBKUTemplate()) - templates.setBKUSelectionTemplate(null); - - if (isDeleteSendAssertionTemplate()) - templates.setSendAssertionTemplate(null); + if (isDeleteBKUTemplate() && templates.getBKUSelectionTemplate() != null) { + //templates.setBKUSelectionTemplate(null); + templates.getBKUSelectionTemplate().setDelete(true); + } + if (isDeleteSendAssertionTemplate() && templates.getSendAssertionTemplate() != null) { + //templates.setSendAssertionTemplate(null); + templates.getSendAssertionTemplate().setDelete(true); + } + if (bkuSelectionForm != null && bkuSelectionForm.size() > 0) { TransformsInfoType template = new TransformsInfoType(); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java index 07c9f5eda..4be1a81de 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAPVP2Config.java @@ -40,6 +40,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.AuthComponentOA import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OAPVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OnlineApplication; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; +import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.oa.OAPVP2ConfigValidation; import at.gv.egovernment.moa.util.Base64Utils; @@ -58,6 +59,8 @@ public class OAPVP2Config implements IOnlineApplicationData{ private String fileUploadContentType; private String fileUploadFileName; + private byte[] storedCert = null; + public OAPVP2Config() { } @@ -90,7 +93,9 @@ public class OAPVP2Config implements IOnlineApplicationData{ if (getFileUpload() != null) { pvp2.setCertificate(getCertificate()); setReLoad(true); - } + + } else if (storedCert != null) + pvp2.setCertificate(storedCert); } catch (CertificateException e) { log.info("Uploaded Certificate can not be found", e); @@ -175,6 +180,10 @@ public class OAPVP2Config implements IOnlineApplicationData{ return x509.getEncoded(); } + public void setStoredCert(byte[] storedCert) { + this.storedCert = storedCert; + } + public String getMetaDataURL() { return metaDataURL; } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAFileUploadValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAFileUploadValidation.java index de32d31c7..d2dac3b28 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAFileUploadValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAFileUploadValidation.java @@ -74,7 +74,7 @@ public class OAFileUploadValidation { try { File file = files.get(i); InputStream stream = new FileInputStream(file); - output.put(filename, IOUtils.toByteArray(stream)); + output.put(filename, Base64Utils.encode(stream).getBytes("UTF-8")); stream.close(); } catch (IOException e) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java index d850decb4..18452ed2d 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAPVP2ConfigValidation.java @@ -79,7 +79,8 @@ public class OAPVP2ConfigValidation { Map oa = ConfigurationProvider.getInstance().getDbRead().getOnlineApplicationKeyValueWithId(oaID); if (oa != null && MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE))) { - certSerialized = Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE), false); + certSerialized = Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE), false); + form.setStoredCert(certSerialized); } } catch (ConfigurationException e) { diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties index 2575fa104..9116d6ef8 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties @@ -35,6 +35,8 @@ error.oa.oauth.clientSecret=Client-Secret darf nicht leer sein error.oa.oauth.keyname=Key-Name darf nicht leer sein error.oa.oauth.keystore=Keystore darf nicht leer sein und muss eine richtige URL sein. +error.oa.reversion.log.enabled=Es muss zumindest ein EventCode konfiguriert werden. +error.oa.reversion.log.eventcodes=Eventcodes d\u00FCrfen nur Zahlen enthalten. mail.userrequest.subject=Accountanforderung MOA-ID 3.x Konfigurationstool diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties index e017b6dc3..38cc6341b 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties @@ -35,6 +35,9 @@ error.oa.oauth.clientSecret=Client-Secret cannot be blank error.oa.oauth.keyname=Key-Name cannot be blank error.oa.oauth.keystore=Keystore cannot be blank and has to be provided in the form of valid URL. +error.oa.reversion.log.enabled=One EventCode is required at minimum. +error.oa.reversion.log.eventcodes=Only numbers are allowed as EventCodes + mail.userrequest.subject=Requesting accounts - MOA-ID 3.x Config Tool diff --git a/id/moa-id-webgui/pom.xml b/id/moa-id-webgui/pom.xml index d71de8fc1..8d35abd20 100644 --- a/id/moa-id-webgui/pom.xml +++ b/id/moa-id-webgui/pom.xml @@ -9,7 +9,7 @@ 4.0.0 MOA.id moa-id-webgui - 1.0-SNAPSHOT + 1.0 MOA-ID WebGUI Module diff --git a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java index 787cd136d..c55c35da0 100644 --- a/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java +++ b/id/moa-id-webgui/src/main/java/at/gv/egovernment/moa/id/config/webgui/validation/task/impl/ServicesProtocolPVP2XTask.java @@ -104,26 +104,28 @@ public class ServicesProtocolPVP2XTask extends AbstractTaskValidator implements Map newConfigValues = new HashMap(); String certBase64 = input.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); - String[] splittet = certBase64.split(","); - if (splittet.length > 1) { - newConfigValues.put(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE, - splittet[1]); - log.debug("Extract PVP2X metadata validation certificate from GUI upload and add it to key: {}", MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); + if (MiscUtil.isNotEmpty(certBase64)) { + String[] splittet = certBase64.split(","); + if (splittet.length > 1) { + newConfigValues.put(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE, + splittet[1]); + log.debug("Extract PVP2X metadata validation certificate from GUI upload and add it to key: {}", MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE); - try { - byte[] certSerialized = null; - if (MiscUtil.isNotEmpty(splittet[1])) { - certSerialized = Base64Utils.decode(splittet[1], true); - X509Certificate cert = new X509Certificate(certSerialized); - newConfigValues.put( - MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT, - cert.getSubjectDN().getName()); + try { + byte[] certSerialized = null; + if (MiscUtil.isNotEmpty(splittet[1])) { + certSerialized = Base64Utils.decode(splittet[1], true); + X509Certificate cert = new X509Certificate(certSerialized); + newConfigValues.put( + MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT, + cert.getSubjectDN().getName()); - } + } - } catch (IOException | CertificateException e) { - log.error("PVP2X metadata signing certificate is not parseable.", e); + } catch (IOException | CertificateException e) { + log.error("PVP2X metadata signing certificate is not parseable.", e); + } } } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index 5233aa5d8..05de581d2 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -591,33 +591,44 @@ public class ConfigurationMigrationUtils { templates.getAditionalAuthBlockText()); TransformsInfoType bkuSelectTemplate = templates.getBKUSelectionTemplate(); - if (bkuSelectTemplate != null && MiscUtil.isNotEmpty(bkuSelectTemplate.getFilename())) { - try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA, - Base64Utils.encode(bkuSelectTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW, - bkuSelectTemplate.getFilename()); + if (bkuSelectTemplate != null ) { + if (bkuSelectTemplate.isDelete()) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DELETE, Boolean.TRUE.toString()); - } catch (Exception e) { - Logger.warn("BKU selection templated can not converted.", e); + if (MiscUtil.isNotEmpty(bkuSelectTemplate.getFilename())) { + try { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA, + new String(bkuSelectTemplate.getTransformation())); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW, + bkuSelectTemplate.getFilename()); + } catch (Exception e) { + Logger.warn("BKU selection templated can not converted.", e); + + } } } TransformsInfoType sendAssertionTemplate = templates.getSendAssertionTemplate(); - if (sendAssertionTemplate != null && MiscUtil.isNotEmpty(sendAssertionTemplate.getFilename())) { - try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA, - Base64Utils.encode(sendAssertionTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW, - sendAssertionTemplate.getFilename()); + if (sendAssertionTemplate != null ) { + + if (sendAssertionTemplate.isDelete()) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DELETE, Boolean.TRUE.toString()); + + if (MiscUtil.isNotEmpty(sendAssertionTemplate.getFilename())) { + try { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA, + new String(sendAssertionTemplate.getTransformation())); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW, + sendAssertionTemplate.getFilename()); - } catch (Exception e) { - Logger.warn("Send assertion templated can not converted.", e); + } catch (Exception e) { + Logger.warn("Send assertion templated can not converted.", e); - } + } + } } BKUSelectionCustomizationType formcustom = templates.getBKUSelectionCustomization(); @@ -1443,8 +1454,13 @@ public class ConfigurationMigrationUtils { dbauthgeneral.setTimeOuts(dbtimeouts); } - dbtimeouts.setAssertion(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))); - dbtimeouts.setMOASessionCreated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))) + dbtimeouts.setAssertion(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))) + dbtimeouts.setMOASessionCreated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE))) dbtimeouts.setMOASessionUpdated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE))); Protocols dbprotocols = dbauth.getProtocols(); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java index 696d7ac6d..64e4be82b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/MOAIDConfiguration.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XMLGregorianCalendarAsDateTime; @@ -190,6 +191,7 @@ public class MOAIDConfiguration @XmlAttribute(name = "Hjid") protected Long hjid; + @XmlTransient protected String eventCodes = null; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java index 79cdcacf5..6a838c261 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/OnlineApplication.java @@ -19,6 +19,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -100,7 +101,10 @@ public class OnlineApplication @XmlSchemaType(name = "boolean") protected Boolean removeBPKFromAuthBlock; + @XmlTransient protected Boolean isRevisionsLogActive = false; + + @XmlTransient protected String eventCodes = null; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/TransformsInfoType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/TransformsInfoType.java index d36e8e5e7..352d7fa4a 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/TransformsInfoType.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/deprecated/TransformsInfoType.java @@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -80,6 +81,9 @@ public class TransformsInfoType @XmlAttribute(name = "Hjid") protected Long hjid; + @XmlTransient + protected boolean delete = false; + /** * Gets the value of the transformation property. * @@ -158,7 +162,17 @@ public class TransformsInfoType this.hjid = value; } - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + + + public boolean isDelete() { + return delete; + } + + public void setDelete(boolean delete) { + this.delete = delete; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof TransformsInfoType)) { return false; } diff --git a/pom.xml b/pom.xml index 673310447..06301877f 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ egiz-commons - https://demo.egiz.gv.at/int-repo/ + http://demo.egiz.gv.at/int-repo/ true diff --git a/repository/at/gv/egiz/components/egiz-configuration-meta-api/0.3/egiz-configuration-meta-api-0.3.jar b/repository/at/gv/egiz/components/egiz-configuration-meta-api/0.3/egiz-configuration-meta-api-0.3.jar new file mode 100644 index 000000000..3065bf33c Binary files /dev/null and b/repository/at/gv/egiz/components/egiz-configuration-meta-api/0.3/egiz-configuration-meta-api-0.3.jar differ -- cgit v1.2.3