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 --- .../moa/id/configuration/data/FormularCustomization.java | 14 +++++++++----- .../moa/id/configuration/data/oa/OAPVP2Config.java | 11 ++++++++++- .../validation/oa/OAFileUploadValidation.java | 2 +- .../validation/oa/OAPVP2ConfigValidation.java | 3 ++- .../src/main/resources/applicationResources_de.properties | 2 ++ .../src/main/resources/applicationResources_en.properties | 3 +++ 6 files changed, 27 insertions(+), 8 deletions(-) (limited to 'id/ConfigWebTool/src/main') 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 -- cgit v1.2.3