From 92094305b901df13e21d0d856fe4ce5deeaf27f8 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 17 Jan 2014 16:49:03 +0100 Subject: changing to utf8 in spss messages --- common/src/main/java/at/gv/egovernment/moa/util/Messages.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Messages.java b/common/src/main/java/at/gv/egovernment/moa/util/Messages.java index 94dc3ab47..3214e649f 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/Messages.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/Messages.java @@ -47,7 +47,7 @@ public class Messages { + "Die Fehlertexte konnten nicht geladen werden."; /** Error message indicating that the message is not available. */ private static final String ERROR_NO_MESSAGE = - "Keine Fehlermeldung für Fehler-Nr.={0}"; + "Keine Fehlermeldung fĂĽr Fehler-Nr.={0}"; /** The names of the resources containing the messages. */ private String[] resourceNames; -- cgit v1.2.3 From ce0962d20a720e6c16adfd89ee8d71639d65dd52 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Thu, 27 Feb 2014 14:32:30 +0100 Subject: build stork euid --- .../java/at/gv/egovernment/moa/util/Constants.java | 5 +- .../moa/id/auth/builder/BPKBuilder.java | 196 +++++++++++++-------- .../id/protocols/stork2/AuthenticationRequest.java | 13 +- 3 files changed, 140 insertions(+), 74 deletions(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java index 213eb6242..ed75768ba 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/Constants.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/Constants.java @@ -429,7 +429,10 @@ public interface Constants { /** URN prefix for context dependent id (wbPK). */ public static final String URN_PREFIX_WBPK = URN_PREFIX + ":wbpk"; - + + /** URN prefix for context dependent id (stork). */ + public static final String URN_PREFIX_STORK = URN_PREFIX + ":storkid"; + /** URN prefix for context dependent id. */ public static final String URN_PREFIX_BASEID = URN_PREFIX + ":baseid"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java index bd87737ed..fd8f3f875 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/BPKBuilder.java @@ -2,19 +2,19 @@ * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * + * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. - * + * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works @@ -46,91 +46,143 @@ package at.gv.egovernment.moa.id.auth.builder; -import java.security.MessageDigest; - import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.util.Base64Utils; import at.gv.egovernment.moa.util.Constants; +import java.security.MessageDigest; + /** * Builder for the bPK, as defined in * "Ableitung f¨r die bereichsspezifische Personenkennzeichnung" * version 1.0.1 from "reference.e-government.gv.at". - * + * * @author Paul Schamberger * @version $Id$ */ public class BPKBuilder { - /** - * Builds the bPK from the given parameters. - * @param identificationValue Base64 encoded "Stammzahl" - * @param target "Bereich lt. Verordnung des BKA" - * @return bPK in a BASE64 encoding - * @throws BuildException if an error occurs on building the bPK - */ - public String buildBPK(String identificationValue, String target) - throws BuildException { - - if ((identificationValue == null || - identificationValue.length() == 0 || - target == null || - target.length() == 0)) - { - throw new BuildException("builder.00", - new Object[] {"BPK", "Unvollständige Parameterangaben: identificationValue=" + - identificationValue + ",target=" + target}); + /** + * Builds the bPK from the given parameters. + * + * @param identificationValue Base64 encoded "Stammzahl" + * @param target "Bereich lt. Verordnung des BKA" + * @return bPK in a BASE64 encoding + * @throws BuildException if an error occurs on building the bPK + */ + public String buildBPK(String identificationValue, String target) + throws BuildException { + + if ((identificationValue == null || + identificationValue.length() == 0 || + target == null || + target.length() == 0)) { + throw new BuildException("builder.00", + new Object[]{"BPK", "Unvollständige Parameterangaben: identificationValue=" + + identificationValue + ",target=" + target}); + } + String basisbegriff; + if (target.startsWith(Constants.URN_PREFIX_CDID + "+")) + basisbegriff = identificationValue + "+" + target; + else + basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_CDID + "+" + target; + + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); + String hashBase64 = Base64Utils.encode(hash); + return hashBase64; + } catch (Exception ex) { + throw new BuildException("builder.00", new Object[]{"bPK", ex.toString()}, ex); + } } - String basisbegriff; - if (target.startsWith(Constants.URN_PREFIX_CDID + "+")) - basisbegriff = identificationValue + "+" + target; - else - basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_CDID + "+" + target; - - try { - MessageDigest md = MessageDigest.getInstance("SHA-1"); - byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); - String hashBase64 = Base64Utils.encode(hash); - return hashBase64; - } catch (Exception ex) { - throw new BuildException("builder.00", new Object[] {"bPK", ex.toString()}, ex); + + /** + * Builds the wbPK from the given parameters. + * + * @param identificationValue Base64 encoded "Stammzahl" + * @param registerAndOrdNr type of register + "+" + number in register. + * @return wbPK in a BASE64 encoding + * @throws BuildException if an error occurs on building the wbPK + */ + public String buildWBPK(String identificationValue, String registerAndOrdNr) + throws BuildException { + + if ((identificationValue == null || + identificationValue.length() == 0 || + registerAndOrdNr == null || + registerAndOrdNr.length() == 0)) { + throw new BuildException("builder.00", + new Object[]{"wbPK", "Unvollständige Parameterangaben: identificationValue=" + + identificationValue + ",Register+Registernummer=" + registerAndOrdNr}); + } + + String basisbegriff; + if (registerAndOrdNr.startsWith(Constants.URN_PREFIX_WBPK + "+")) + basisbegriff = identificationValue + "+" + registerAndOrdNr; + else + basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr; + + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); + String hashBase64 = Base64Utils.encode(hash); + return hashBase64; + } catch (Exception ex) { + throw new BuildException("builder.00", new Object[]{"wbPK", ex.toString()}, ex); + } } - } - - /** - * Builds the wbPK from the given parameters. - * @param identificationValue Base64 encoded "Stammzahl" - * @param registerAndOrdNr type of register + "+" + number in register. - * @return wbPK in a BASE64 encoding - * @throws BuildException if an error occurs on building the wbPK - */ - public String buildWBPK(String identificationValue, String registerAndOrdNr) - throws BuildException { - - if ((identificationValue == null || - identificationValue.length() == 0 || - registerAndOrdNr == null || - registerAndOrdNr.length() == 0)) - { - throw new BuildException("builder.00", - new Object[] {"wbPK", "Unvollständige Parameterangaben: identificationValue=" + - identificationValue + ",Register+Registernummer=" + registerAndOrdNr}); + + /** + * Builds the wbPK from the given parameters. + * + * @param identificationValue Base64 encoded "Stammzahl" + * @param destinationCountry destination country code (2 chars) + * @return storkid in a BASE64 encoding + * @throws BuildException if an error occurs on building the wbPK + */ + public String buildStorkPK(String identificationValue, String destinationCountry) + throws BuildException { + return buildStorkPK(identificationValue, "AT", destinationCountry); } - - String basisbegriff; - if (registerAndOrdNr.startsWith(Constants.URN_PREFIX_WBPK + "+" )) - basisbegriff = identificationValue + "+" + registerAndOrdNr; - else - basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_WBPK + "+" + registerAndOrdNr; - - try { - MessageDigest md = MessageDigest.getInstance("SHA-1"); - byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); - String hashBase64 = Base64Utils.encode(hash); - return hashBase64; - } catch (Exception ex) { - throw new BuildException("builder.00", new Object[] {"wbPK", ex.toString()}, ex); + + + /** + * Builds the wbPK from the given parameters. + * + * @param identificationValue Base64 encoded "Stammzahl" + * @param sourceCountry source country code (2 chars) + * @param destinationCountry destination country code (2 chars) + * @return storkid in a BASE64 encoding + * @throws BuildException if an error occurs on building the wbPK + */ + public String buildStorkPK(String identificationValue, String sourceCountry, String destinationCountry) + throws BuildException { + + if ((identificationValue == null || + identificationValue.length() == 0 || + destinationCountry == null || + destinationCountry.length() == 0 || + destinationCountry.length() != 2 || + sourceCountry == null || + sourceCountry.length() == 0 || + sourceCountry.length() != 2)) { + throw new BuildException("builder.00", + new Object[]{"storkid", "Unvollständige Parameterangaben: identificationValue=" + + identificationValue + ", Zielland=" + destinationCountry + ", Ursprungsland=" + sourceCountry}); + } + + String basisbegriff = identificationValue + "+" + Constants.URN_PREFIX_STORK + "+" + sourceCountry + "+" + destinationCountry; + + try { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] hash = md.digest(basisbegriff.getBytes("ISO-8859-1")); + String hashBase64 = Base64Utils.encode(hash); + return hashBase64; + } catch (Exception ex) { + throw new BuildException("builder.00", new Object[]{"storkid", ex.toString()}, ex); + } } - } + } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java index d4996c26a..3288e064f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java @@ -10,6 +10,7 @@ import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IRequest; import at.gv.egovernment.moa.id.storage.AssertionStorage; +import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate; import at.gv.egovernment.moa.logging.Logger; import edu.emory.mathcs.backport.java.util.Collections; import eu.stork.peps.auth.commons.*; @@ -29,6 +30,7 @@ import javax.servlet.http.HttpSession; import java.io.*; import java.util.HashMap; import eu.stork.peps.auth.engine.SAMLEngine; +import org.w3c.dom.Element; /** @@ -52,6 +54,15 @@ public class AuthenticationRequest implements IAction { this.moaSession = moasession; this.moaStorkAuthnRequest = (MOASTORKAuthnRequest)req; + MISMandate mandate = moasession.getMISMandate(); + String owbpk = mandate.getOWbPK(); + byte[] mand = mandate.getMandate(); + String profprep = mandate.getProfRep(); + //String textdesc = mandate.getTextualDescriptionOfOID(); + Element mndt = moasession.getMandate(); + + + Logger.debug("mandate encoded: " + new String(org.bouncycastle.util.encoders.Base64.encode(mand))); Logger.debug("Starting AuthenticationRequest"); //AuthenticationServer.getInstance().startSTORKAuthentication(httpReq, httpResp, moasession); @@ -61,7 +72,7 @@ public class AuthenticationRequest implements IAction { httpResp.reset(); STORKAuthnResponse authnResponse = new STORKAuthnResponse(); - authnResponse.setCountry("AT"); + authnResponse.setCountry("EU"); OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); if (oaParam == null) -- cgit v1.2.3 From 6cc5cd2311c9e6cde062fa4034444969f9c293e0 Mon Sep 17 00:00:00 2001 From: Klaus Stranacher Date: Sun, 9 Mar 2014 21:04:57 +0100 Subject: POMs added to dependencies maven-assembly-plugin version set to 2.2-beta-1 (for MOA-SPSS) Update TSL parts --- .../java/at/gv/egovernment/moa/util/MiscUtil.java | 28 ++++++++++----------- pom.xml | 10 +++++--- .../1.0/iaik_javax_crypto-1.0.pom | 9 +++++++ .../3.181/iaik_jce_eval_signed-3.181.jar | Bin 890328 -> 921338 bytes .../3.181/iaik_jce_eval_signed-3.181.pom | 9 +++++++ repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom | 9 +++++++ .../iaik_pki_module/1.0/iaik_pki_module-1.0.pom | 9 +++++++ repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom | 9 +++++++ repository/iaik/iaik_util/0.23/iaik_util-0.23.jar | Bin 39377 -> 39372 bytes repository/iaik/iaik_util/0.23/iaik_util-0.23.pom | 9 +++++++ .../1.1709142/iaik_xsect_eval-1.1709142.pom | 9 +++++++ repository/iaik/w3c_http/1.0/w3c_http-1.0.pom | 9 +++++++ .../server/config/ConfigurationPartsBuilder.java | 24 +++++++++++++++--- .../spss/server/config/ConfigurationProvider.java | 5 ++-- spss/server/serverws/pom.xml | 2 +- 15 files changed, 116 insertions(+), 25 deletions(-) create mode 100644 repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom create mode 100644 repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom create mode 100644 repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom create mode 100644 repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom create mode 100644 repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom create mode 100644 repository/iaik/iaik_util/0.23/iaik_util-0.23.pom create mode 100644 repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom create mode 100644 repository/iaik/w3c_http/1.0/w3c_http-1.0.pom (limited to 'common/src/main/java') diff --git a/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java b/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java index 043baea0e..c2f2c9f47 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/MiscUtil.java @@ -143,20 +143,20 @@ public class MiscUtil { return out.toByteArray(); } - public static Document parseDocument(InputStream inputStream) - throws IOException { - try { - DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory - .newInstance(); - docBuilderFactory.setNamespaceAware(true); - DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); - return docBuilder.parse(inputStream); - } catch (ParserConfigurationException e) { - throw new IOException(e); - } catch (SAXException e) { - throw new IOException(e); - } - } +// public static Document parseDocument(InputStream inputStream) +// throws IOException { +// try { +// DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory +// .newInstance(); +// docBuilderFactory.setNamespaceAware(true); +// DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); +// return docBuilder.parse(inputStream); +// } catch (ParserConfigurationException e) { +// throw new IOException(e); +// } catch (SAXException e) { +// throw new IOException(e); +// } +// } public static String removePrecedingSlash(String path, String slash) { assertNotEmpty(slash, "Shash"); diff --git a/pom.xml b/pom.xml index 2ac793aa2..c8fc00ea1 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ ${basedir}/repository + UTF-8 @@ -64,7 +65,8 @@ false maven-assembly-plugin - 2.4 + 2.2-beta-1 + moa @@ -204,7 +206,7 @@ MOA.spss.server moa-spss-lib - 2.0.0 + 1.5.2 compile @@ -217,7 +219,7 @@ MOA.spss.server moa-spss-tools - 2.0.0 + 1.5.2 test @@ -354,7 +356,7 @@ iaik.prod iaik_tsl - 1.0 + 1.0.5 iaik.prod diff --git a/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom b/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom new file mode 100644 index 000000000..b4ff61576 --- /dev/null +++ b/repository/iaik/iaik_javax_crypto/1.0/iaik_javax_crypto-1.0.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_javax_crypto + 1.0 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar index 98b5e27a2..932e4310f 100644 Binary files a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar and b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.jar differ diff --git a/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom new file mode 100644 index 000000000..9bcbb93a5 --- /dev/null +++ b/repository/iaik/iaik_jce_eval_signed/3.181/iaik_jce_eval_signed-3.181.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_jce_eval_signed + 3.181 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom b/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom new file mode 100644 index 000000000..382c12003 --- /dev/null +++ b/repository/iaik/iaik_jsse/4.4/iaik_jsse-4.4.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_jsse + 4.4 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom b/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom new file mode 100644 index 000000000..e78656647 --- /dev/null +++ b/repository/iaik/iaik_pki_module/1.0/iaik_pki_module-1.0.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_pki_module + 1.0 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom b/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom new file mode 100644 index 000000000..32c610268 --- /dev/null +++ b/repository/iaik/iaik_ssl/4.4/iaik_ssl-4.4.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_ssl + 4.4 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar b/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar index 1bc0cde7c..78370c31e 100644 Binary files a/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar and b/repository/iaik/iaik_util/0.23/iaik_util-0.23.jar differ diff --git a/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom b/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom new file mode 100644 index 000000000..75fdc3692 --- /dev/null +++ b/repository/iaik/iaik_util/0.23/iaik_util-0.23.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_util + 0.23 + POM was created from install:install-file + diff --git a/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom b/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom new file mode 100644 index 000000000..2697348bd --- /dev/null +++ b/repository/iaik/iaik_xsect_eval/1.1709142/iaik_xsect_eval-1.1709142.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + iaik_xsect_eval + 1.1709142 + POM was created from install:install-file + diff --git a/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom b/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom new file mode 100644 index 000000000..81f3e826c --- /dev/null +++ b/repository/iaik/w3c_http/1.0/w3c_http-1.0.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + iaik + w3c_http + 1.0 + POM was created from install:install-file + diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java index 0908d88c9..287d8225b 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java @@ -1385,6 +1385,22 @@ public class ConfigurationPartsBuilder { Logger.warn(new LogMsg(txt)); warnings.add(txt); } + + /** + * Log a warning. + * + * @param messageId The message ID. + * @param args Additional parameters for the message. + * @see at.gv.egovernment.moa.spss.server.util.MessageProvider + */ + private void debug(String messageId, Object[] args) { + MessageProvider msg = MessageProvider.getInstance(); + String txt = msg.getMessage(messageId, args); + + Logger.debug(new LogMsg(txt)); + + } + /** * Log a debug message. @@ -1581,27 +1597,27 @@ public class ConfigurationPartsBuilder { String euTSLUrl = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "EUTSLUrl", null); if (StringUtils.isEmpty(euTSLUrl)) { euTSLUrl = TSLConfiguration.DEFAULT_EU_TSL_URL; - warn("config.39", new Object[] { "EUTSL", euTSLUrl }); + debug("config.39", new Object[] { "EUTSL", euTSLUrl }); } String updateSchedulePeriod = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "UpdateSchedule/" + CONF + "Period" , null); if (StringUtils.isEmpty(updateSchedulePeriod)) { updateSchedulePeriod = TSLConfiguration.DEFAULT_UPDATE_SCHEDULE_PERIOD; - warn("config.39", new Object[] { "UpdateSchedule/Period", updateSchedulePeriod }); + debug("config.39", new Object[] { "UpdateSchedule/Period", updateSchedulePeriod }); } String updateScheduleStartTime = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "UpdateSchedule/" + CONF + "StartTime", null); if (StringUtils.isEmpty(updateScheduleStartTime)) { updateScheduleStartTime = TSLConfiguration.DEFAULT_UPDATE_SCHEDULE_STARTTIME; - warn("config.39", new Object[] { "UpdateSchedule/StartTime", updateScheduleStartTime }); + debug("config.39", new Object[] { "UpdateSchedule/StartTime", updateScheduleStartTime }); } String workingDirectoryStr = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "WorkingDirectory", null); if (StringUtils.isEmpty(workingDirectoryStr)) { workingDirectoryStr = TSLConfiguration.DEFAULT_WORKING_DIR; - warn("config.39", new Object[] { "WorkingDirectory", workingDirectoryStr }); + debug("config.39", new Object[] { "WorkingDirectory", workingDirectoryStr }); } // convert update schedule starting time to Date object diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java index 2cad35763..87a4b50f4 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java @@ -347,6 +347,8 @@ public class ConfigurationProvider try { builder = new ConfigurationPartsBuilder(configElem, configRoot); + tslconfiguration_ = builder.getTSLConfiguration(); + digestMethodAlgorithmName = builder.getDigestMethodAlgorithmName(); canonicalizationAlgorithmName = builder.getCanonicalizationAlgorithmName(); @@ -361,8 +363,6 @@ public class ConfigurationProvider keyGroupMappings = builder.buildKeyGroupMappings(keyGroups, ANONYMOUS_ISSUER_SERIAL); - tslconfiguration_ = builder.getTSLConfiguration(); - xadesVersion = builder.getXAdESVersion(); defaultChainingMode = builder.getDefaultChainingMode(); chainingModes = builder.buildChainingModes(); @@ -379,6 +379,7 @@ public class ConfigurationProvider revocationArchiveJDBCDriverClass_ = builder.getRevocationArchiveJDBCDriverClass(); + //check TSL configuration checkTSLConfiguration(); diff --git a/spss/server/serverws/pom.xml b/spss/server/serverws/pom.xml index 4372c76d0..0314cb454 100644 --- a/spss/server/serverws/pom.xml +++ b/spss/server/serverws/pom.xml @@ -22,7 +22,7 @@ org.apache.maven.plugins maven-war-plugin - 2.1.1 + 2.3 -- cgit v1.2.3 From e9375ac9b0dbd5e9c5e19f0d2779dd94385b0040 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 14 Mar 2014 10:43:20 +0100 Subject: bufix: convert relativ path to absolut path --- common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java index cac179a75..ff22c7313 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java @@ -133,7 +133,8 @@ public class FileUtils { keyFile = new File(url); if (!keyFile.isAbsolute()) { keyFile = new File(root, url); - newURL = keyFile.getPath(); + newURL = keyFile.toURI().toString(); + } return newURL; } -- cgit v1.2.3 From 185aa361aec65c967d2908f69db4abbe9d3d9b2e Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Mar 2014 18:32:14 +0100 Subject: introduced log4j logging system --- .../java/at/gv/egovernment/moa/logging/Logger.java | 67 +++++++++------------- .../id/protocols/stork2/AttributeCollector.java | 1 - .../protocols/stork2/AttributeProviderFactory.java | 1 - .../id/protocols/stork2/AuthenticationRequest.java | 1 - .../stork2/EHvdAttributeProviderPlugin.java | 1 - .../id/protocols/stork2/MOAAttributeProvider.java | 3 - .../stork2/MandateAttributeRequestProvider.java | 2 - .../protocols/stork2/MandateRetrievalRequest.java | 1 - .../moa/id/protocols/stork2/STORKProtocol.java | 1 - .../stork2/SignedDocAttributeRequestProvider.java | 3 - .../stork2/StorkAttributeRequestProvider.java | 3 - 11 files changed, 27 insertions(+), 57 deletions(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java index 07f9e27af..2e76325a5 100644 --- a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java +++ b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java @@ -24,9 +24,6 @@ package at.gv.egovernment.moa.logging; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * A utility class acting as a facade to the logging subsystem. * @@ -39,35 +36,13 @@ import org.apache.commons.logging.LogFactory; */ public class Logger { - /** The default logging hierarchy. */ - private static String defaultHierarchy = ""; - - /** - * Get the Log object for the default hierarchy. - * - * @return The Log object to write log messages to. - */ - private static Log getLog() { - return LogFactory.getLog(defaultHierarchy); - } - - /** - * Get the Log object for a given hierarchy. - * - * @param hierarchy The logging hierarchy for which to return the logger. - * @return The Log object to write log messages to. - */ - private static Log getLog(String hierarchy) { - return LogFactory.getLog(hierarchy); - } - /** * Set the default hierarchy to which the Logger should send its * logging output. * @param hierarchy The logging defaultHierarchy. */ public static void setHierarchy(String hierarchy) { - defaultHierarchy = hierarchy; + // there is no need for that anymore } /** @@ -77,7 +52,8 @@ public class Logger { * false otherwise. */ public static boolean isTraceEnabled() { - return getLog().isTraceEnabled(); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + return logger.isTraceEnabled(); } /** @@ -88,7 +64,8 @@ public class Logger { * false otherwise. */ public static boolean isTraceEnabled(String hierarchy) { - return getLog(hierarchy).isTraceEnabled(); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + return logger.isTraceEnabled(); } /** @@ -97,7 +74,8 @@ public class Logger { * @param message The message to trace. */ public static void trace(Object message) { - getLog().trace(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.trace(message); } /** @@ -107,7 +85,8 @@ public class Logger { * false otherwise. */ public static boolean isDebugEnabled() { - return getLog().isDebugEnabled(); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + return logger.isDebugEnabled(); } /** @@ -118,7 +97,8 @@ public class Logger { * false otherwise. */ public static boolean isDebugEnabled(String hierarchy) { - return getLog(hierarchy).isDebugEnabled(); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + return logger.isDebugEnabled(); } /** @@ -127,7 +107,8 @@ public class Logger { * @param message The message to log. */ public static void debug(Object message) { - getLog().debug(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.debug(message); } /** @@ -136,7 +117,8 @@ public class Logger { * @param message The message to log. */ public static void info(Object message) { - getLog().info(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.info(message); } /** @@ -145,7 +127,8 @@ public class Logger { * @param message The message to log. */ public static void warn(Object message) { - getLog().warn(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.warn(message); } /** @@ -155,7 +138,8 @@ public class Logger { * @param t An exception that may be the cause of the warning. */ public static void warn(Object message, Throwable t) { - getLog().warn(message, t); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.warn(message, t); } /** @@ -164,7 +148,8 @@ public class Logger { * @param message The message to log. */ public static void error(Object message) { - getLog().error(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.error(message); } /** @@ -174,7 +159,8 @@ public class Logger { * @param t An exception that may be the cause of the error. */ public static void error(Object message, Throwable t) { - getLog().error(message, t); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.error(message, t); } /** @@ -183,7 +169,8 @@ public class Logger { * @param message The message to log. */ public static void fatal(Object message) { - getLog().fatal(message); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.fatal(message); } /** @@ -193,7 +180,7 @@ public class Logger { * @param t An exception that may be the cause of the error. */ public static void fatal(Object message, Throwable t) { - getLog().fatal(message, t); + org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(Thread.currentThread().getStackTrace()[2].getClassName()); + logger.fatal(message, t); } - } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java index 31114a319..1d9e31674 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java @@ -99,7 +99,6 @@ public class AttributeCollector implements IAction { * @throws MOAIDException */ public String processRequest(DataContainer container, HttpServletRequest request, HttpServletResponse response, AuthenticationSession moasession, OAAuthParameter oaParam) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); // check if there are attributes we need to fetch IPersonalAttributeList requestAttributeList = container.getRequest().getPersonalAttributeList(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java index 7fb7a7bc6..a339cff23 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java @@ -60,7 +60,6 @@ public class AttributeProviderFactory { */ public static List getConfiguredPlugins( List configuredAPs) { - Logger.setHierarchy("moa.id.protocols.stork2"); List result = new ArrayList(); for (AttributeProviderPlugin current : configuredAPs) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java index 88c0e889d..5e49fe413 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java @@ -39,7 +39,6 @@ public class AuthenticationRequest implements IAction { public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); this.moaSession = moasession; if (req instanceof MOASTORKRequest) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java index f7d105ab8..a257474e3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/EHvdAttributeProviderPlugin.java @@ -71,7 +71,6 @@ public class EHvdAttributeProviderPlugin implements AttributeProvider { throw new UnsupportedAttributeException(); try { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.debug("initializing SOAP connections..."); // create SOAP connection SOAPConnection soapConnection = SOAPConnectionFactory.newInstance().createConnection(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java index 44b140548..873ec1e26 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java @@ -43,7 +43,6 @@ public class MOAAttributeProvider { public void populateAttribute(PersonalAttributeList attributeList, PersonalAttribute requestedAttribute ) { String storkAttribute = requestedAttribute.getName(); - Logger.setHierarchy("moa.id.protocols.stork2"); if (storkAttributeSimpleMapping.containsKey(storkAttribute)) { Logger.debug("Trying to get value for attribute using simple mapping [" + storkAttribute + "]"); try { @@ -70,7 +69,6 @@ public class MOAAttributeProvider { } private String geteIdentifier() { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.debug("Using base urn for identification value: " + identityLink.getIdentificationType() + " and target country: " + moastorkRequest.getStorkAuthnRequest().getSpCountry()); try { return new BPKBuilder().buildStorkbPK(identityLink.getIdentificationValue(), moastorkRequest.getStorkAuthnRequest().getSpCountry()); @@ -82,7 +80,6 @@ public class MOAAttributeProvider { private void populateAttributeWithMethod(Method method, Object object, PersonalAttributeList attributeList, String storkAttribute, Boolean isRequired) { - Logger.setHierarchy("moa.id.protocols.stork2"); try { String attributeValue = method.invoke(object, new Class[]{}).toString(); PersonalAttribute newAttribute = new PersonalAttribute(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java index e691f87e1..0e94600db 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateAttributeRequestProvider.java @@ -37,7 +37,6 @@ public class MandateAttributeRequestProvider implements AttributeProvider { private PersonalAttributeList requestedAttributes; public MandateAttributeRequestProvider(String aPurl, String supportedAttributes) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); destination = aPurl; attributes = supportedAttributes; } @@ -64,7 +63,6 @@ public class MandateAttributeRequestProvider implements AttributeProvider { } public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); String spSector = "Business"; String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java index 4e99cc8aa..3bd1686b4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java @@ -14,7 +14,6 @@ import javax.servlet.http.HttpServletResponse; */ public class MandateRetrievalRequest implements IAction { public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.info("Entering mandateretrievalrequest"); return null; // } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java index ec77109af..5b844580d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java @@ -58,7 +58,6 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { and other info are obtained, in the second step the request will be processed and the user redirected */ public IRequest preProcess(HttpServletRequest request, HttpServletResponse response, String action) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.info("Starting preprocessing for Stork2 protocol"); Logger.debug("Request method: " + request.getMethod()); Logger.debug("Request content length: " + request.getContentLength()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java index 01297c963..89eb07815 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java @@ -75,7 +75,6 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider { * .servlet.http.HttpServletRequest) */ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws MOAIDException, UnsupportedAttributeException { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.debug("Beginning to extract OASIS-DSS response out of HTTP Request"); try { @@ -107,8 +106,6 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider { public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); - try { Logger.trace("Initialize VelocityEngine..."); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java index 449fef1cb..c0e613b82 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/StorkAttributeRequestProvider.java @@ -73,7 +73,6 @@ public class StorkAttributeRequestProvider implements AttributeProvider { */ public IPersonalAttributeList parse(HttpServletRequest httpReq) throws MOAIDException, UnsupportedAttributeException { - Logger.setHierarchy("moa.id.protocols.stork2"); Logger.info(this.getClass().getSimpleName() + " tries to extract SAMLResponse out of HTTP Request"); //extract STORK Response from HTTP Request @@ -107,8 +106,6 @@ public class StorkAttributeRequestProvider implements AttributeProvider { */ public void performRedirect(String url, HttpServletRequest req, HttpServletResponse resp, OAAuthParameter oaParam) throws MOAIDException { - Logger.setHierarchy("moa.id.protocols.stork2"); - String spSector = "Business"; String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName(); String spApplication = spInstitution; -- cgit v1.2.3