From 271e22add71f0260f5d421844a2171a09093f505 Mon Sep 17 00:00:00 2001 From: Thomas Knall Date: Fri, 6 Feb 2015 11:09:59 +0100 Subject: Code cleanup - Set moa-id version to 2.2.0-SNAPSHOT. - Fix Javadoc syntax issues in newly added classes. - Add warning log when executing deprecated auth sources. --- .../doc/handbook/moduledevinfo/moduledevinfo.html | 4 ++-- id/server/idserverlib/pom.xml | 28 ++++++++++++++++++++++ .../tasks/PrepareAuthBlockSignatureTask.java | 4 ++-- .../moa/id/auth/servlet/GetForeignIDServlet.java | 4 +--- .../id/auth/servlet/GetMISSessionIDServlet.java | 4 +--- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 2 ++ .../PEPSConnectorWithLocalSigningServlet.java | 2 ++ .../auth/servlet/ProcessEngineSignalServlet.java | 2 -- .../servlet/VerifyAuthenticationBlockServlet.java | 8 ++----- .../id/auth/servlet/VerifyCertificateServlet.java | 5 ++-- .../id/auth/servlet/VerifyIdentityLinkServlet.java | 6 ++--- .../egovernment/moa/id/process/ProcessEngine.java | 2 +- .../id/process/dao/ProcessInstanceStoreDAO.java | 4 ++-- .../springweb/SpringWebExpressionEvaluator.java | 1 + pom.xml | 5 ++-- 15 files changed, 51 insertions(+), 30 deletions(-) diff --git a/id/server/doc/handbook/moduledevinfo/moduledevinfo.html b/id/server/doc/handbook/moduledevinfo/moduledevinfo.html index 6897e36d0..801bfcce6 100644 --- a/id/server/doc/handbook/moduledevinfo/moduledevinfo.html +++ b/id/server/doc/handbook/moduledevinfo/moduledevinfo.html @@ -110,7 +110,7 @@ 1 Übersicht

- MOA-ID ab Version 2.3 ermöglicht die dynamische Erweiterung um zusätzliche Funktionalität durch die Nutzung der + MOA-ID ab Version 2.2 ermöglicht die dynamische Erweiterung um zusätzliche Funktionalität durch die Nutzung der integrierten Modularchitektur.
Entwickler können nun eigene Prozesse, um die MOA-ID erweitert werden soll, definieren (z.B. Unterstützung eines speziellen Authentifizierungsworkflows, Erweiterung um Vollmachten oder ausländische Identitäten etc). @@ -367,7 +367,7 @@ at.gv.egovernment.moa.id.auth.modules.mymodule.MyAuthModuleImpl

Um einzelne Funktionen als Plug-In umzusetzen, muss nicht unbedingt ein ganzer Prozess definiert werden. MOA-ID ab - Version 2.3 unterstützt die Servlet 3.0 API, was u.a. den Einsatz von @WebServlet-Annotations ermöglicht. + Version 2.2 unterstützt die Servlet 3.0 API, was u.a. den Einsatz von @WebServlet-Annotations ermöglicht. Damit entfällt eine statische Registrierung von Servlets im web.xml.

Am Beispiel des MonitoringServlets (at.gv.egovernment.moa.id.auth.servlet.MonitoringServlet), das als diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index c0021f25e..8045ed8da 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -26,6 +26,13 @@ + + + org.testng + testng + 6.1.1 + test + eu.stork oasis-dss-api @@ -549,6 +556,27 @@ + + + maven-surefire-plugin + ${surefire.version} + + 1 + + + + org.apache.maven.surefire + surefire-junit47 + ${surefire.version} + + + org.apache.maven.surefire + surefire-testng + ${surefire.version} + + + + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java index 36d6ea555..dcea3a1dd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java @@ -27,7 +27,7 @@ import at.gv.egovernment.moa.logging.Logger; *

* Expects: * * Result: * * Code taken from {@link at.gv.egovernment.moa.id.auth.servlet.VerifyIdentityLinkServlet}. * @see #execute(ExecutionContext, HttpServletRequest, HttpServletResponse) diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java index 64899565b..41c2a9c6a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java @@ -136,9 +136,7 @@ public class GetForeignIDServlet extends AuthServlet { Logger.debug("POST GetForeignIDServlet"); - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); resp.setHeader(MOAIDAuthConstants.HEADER_EXPIRES,MOAIDAuthConstants.HEADER_VALUE_EXPIRES); resp.setHeader(MOAIDAuthConstants.HEADER_PRAGMA,MOAIDAuthConstants.HEADER_VALUE_PRAGMA); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java index ffd01299e..043b660c1 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java @@ -137,9 +137,7 @@ public class GetMISSessionIDServlet extends AuthServlet { Logger.debug("POST GetMISSessionIDServlet"); - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); resp.setHeader(MOAIDAuthConstants.HEADER_EXPIRES, MOAIDAuthConstants.HEADER_VALUE_EXPIRES); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index af4b7ffbb..e45418b4b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -138,6 +138,8 @@ public class PEPSConnectorServlet extends AuthServlet { try { + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); + Logger.info("PEPSConnector Servlet invoked, expecting C-PEPS message."); Logger.debug("This ACS endpoint is: " + HTTPUtils.getBaseURL(request)); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java index c01a356f6..337a9ed31 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java @@ -132,6 +132,8 @@ public class PEPSConnectorWithLocalSigningServlet extends AuthServlet { */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); + String moaSessionID1 = request.getParameter("moaSessionID"); String signResponse = request.getParameter("signresponse"); Logger.info("moaSessionID1:"+moaSessionID1); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java index a40c7982b..a99b7aeef 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java @@ -9,11 +9,9 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringEscapeUtils; import at.gv.egovernment.moa.id.auth.AuthenticationServer; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; -import at.gv.egovernment.moa.id.process.ProcessInstance; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java index 67c42cd07..a8fe71485 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java @@ -153,19 +153,15 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } Logger.debug("POST VerifyAuthenticationBlock"); + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); + resp.setHeader(MOAIDAuthConstants.HEADER_EXPIRES,MOAIDAuthConstants.HEADER_VALUE_EXPIRES); resp.setHeader(MOAIDAuthConstants.HEADER_PRAGMA,MOAIDAuthConstants.HEADER_VALUE_PRAGMA); resp.setHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL,MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL); resp.addHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL,MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL_IE); - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } String pendingRequestID = null; Map parameters; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java index 82cdb2778..2aa717a65 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java @@ -126,11 +126,10 @@ public class VerifyCertificateServlet extends AuthServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } Logger.debug("POST VerifyCertificateServlet"); + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); + resp.setHeader(MOAIDAuthConstants.HEADER_EXPIRES,MOAIDAuthConstants.HEADER_VALUE_EXPIRES); resp.setHeader(MOAIDAuthConstants.HEADER_PRAGMA,MOAIDAuthConstants.HEADER_VALUE_PRAGMA); resp.setHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL,MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java index 6f2ee2d89..b8e57ed43 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java @@ -134,11 +134,9 @@ public class VerifyIdentityLinkServlet extends AuthServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (System.currentTimeMillis() > 0) { - throw new IllegalStateException(getClass().getName() + " should not be called any more."); - } - Logger.debug("POST VerifyIdentityLink"); + + Logger.warn(getClass().getName() + " is deprecated and should not be used any more."); Map parameters; String pendingRequestID = null; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java index 032cb6369..5cf84abed 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/ProcessEngine.java @@ -50,7 +50,7 @@ public interface ProcessEngine { * Creates a process instance according to the referenced process definition, persists it into the database and returns it identifier. *

* Note that the method returns the identifier of a process instance which will be needed in order to start a process or to continue - * process execution after asynchronous task execution (refer to {@link #start(String))} and + * process execution after asynchronous task execution (refer to {@link #start(String)} and * {@link #signal(String)} for further information). * * @param processDefinitionId diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java index 92ffe11db..57ce70c08 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/dao/ProcessInstanceStoreDAO.java @@ -21,7 +21,7 @@ public interface ProcessInstanceStoreDAO { * {@code processInstanceID} from the database, or {@code null} if the * object could not be found. * - * @param processInstanceID + * @param processInstanceId * the id of the {@code ProcessInstanceStore} to retrieve. * @return a ProcessInstanceStore, or {@code null}. * @throws MOADatabaseException @@ -33,7 +33,7 @@ public interface ProcessInstanceStoreDAO { * Deletes the {@link ProcessInstance} corresponding with the * {@code processInstanceId}. * - * @param processInstanceID + * @param processInstanceId * the id of the {@code ProcessInstance} to be deleted. * @throws MOADatabaseException * is thrown if a problem occurs while accessing the database. diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java index 9dd7bc61e..499e86fa0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/process/springweb/SpringWebExpressionEvaluator.java @@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.expression.BeanFactoryResolver; import org.springframework.expression.Expression; +import at.gv.egovernment.moa.id.process.api.ExecutionContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; diff --git a/pom.xml b/pom.xml index 8bcbe8154..ecd22a778 100644 --- a/pom.xml +++ b/pom.xml @@ -22,13 +22,14 @@ --> 2.0.2-SNAPSHOT - 3.0.0-SNAPSHOT + 2.2.0-SNAPSHOT 2.0.1-SNAPSHOT 2.0.4-SNAPSHOT 1.1.5-SNAPSHOT 2.0.3-SNAPSHOT 4.1.4.RELEASE + 2.18.1 @@ -101,7 +102,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.17 + ${surefire.version} eu/stork/peps/test/simple/SimpleBaseTest.java -- cgit v1.2.3