[java-opensaml] branch maint-5.1 updated: OSJ-427: Simple signature verification fails to detect parameter ...
Brent Putman
putmanb at georgetown.edu
Mon Mar 17 19:24:48 UTC 2025
This is an automated email from the git hooks/post-receive script.
putmanb pushed a commit to branch maint-5.1
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=e6eda0a2358fca07e88206bdbba7d779c4e5e4a9
The following commit(s) were added to refs/heads/maint-5.1 by this push:
new e6eda0a23 OSJ-427: Simple signature verification fails to detect parameter ...
e6eda0a23 is described below
commit e6eda0a2358fca07e88206bdbba7d779c4e5e4a9
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Mon Mar 17 15:23:32 2025 -0400
OSJ-427: Simple signature verification fails to detect parameter ...
Fix botched cherry-pick in 44b148172ef1145731fb39a6a893d2e7ed49fb99.
Eliminate use of new base class introduced only in 5.2.
---
...pServletRequestParametersValidationHandler.java | 51 +++++++++++++++++++++-
1 file changed, 49 insertions(+), 2 deletions(-)
diff --git a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HttpServletRequestParametersValidationHandler.java b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HttpServletRequestParametersValidationHandler.java
index 1c3dc2ce6..1bca00cff 100644
--- a/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HttpServletRequestParametersValidationHandler.java
+++ b/opensaml-messaging-impl/src/main/java/org/opensaml/messaging/handler/impl/HttpServletRequestParametersValidationHandler.java
@@ -21,19 +21,22 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensaml.messaging.context.MessageContext;
-import org.opensaml.messaging.handler.AbstractHttpServletRequestMessageHandler;
+import org.opensaml.messaging.handler.AbstractMessageHandler;
import org.opensaml.messaging.handler.MessageHandlerException;
import org.slf4j.Logger;
import jakarta.servlet.http.HttpServletRequest;
+import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.collection.CollectionSupport;
+import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.primitive.NonnullSupplier;
import net.shibboleth.shared.primitive.StringSupport;
/**
* Message handler that validates HTTP request parameters for required presence, uniqueness and mutual exclusivity.
*/
-public class HttpServletRequestParametersValidationHandler extends AbstractHttpServletRequestMessageHandler {
+public class HttpServletRequestParametersValidationHandler extends AbstractMessageHandler {
/** Logger. */
@Nonnull private Logger log = LoggerFactory.getLogger(HttpServletRequestParametersValidationHandler.class);
@@ -46,6 +49,40 @@ public class HttpServletRequestParametersValidationHandler extends AbstractHttpS
/** Mutually exclusive parameters. */
@Nonnull private Set<Set<String>> mutuallyExclusiveParameters = CollectionSupport.emptySet();
+
+ /** The HttpServletRequest being processed. */
+ @NonnullAfterInit private NonnullSupplier<HttpServletRequest> httpServletRequestSupplier;
+
+ /**
+ * Get the HTTP servlet request being processed.
+ *
+ * @return Returns the request.
+ */
+ @NonnullAfterInit public HttpServletRequest getHttpServletRequest() {
+ if (httpServletRequestSupplier == null) {
+ return null;
+ }
+ return httpServletRequestSupplier.get();
+ }
+
+ /**
+ * Get the supplier for HTTP request if available.
+ *
+ * @return current HTTP request
+ */
+ @NonnullAfterInit public NonnullSupplier<HttpServletRequest> getHttpServletRequestSupplier() {
+ return httpServletRequestSupplier;
+ }
+
+ /**
+ * Set the current HTTP request Supplier.
+ *
+ * @param requestSupplier Supplier for the current HTTP request
+ */
+ public void setHttpServletRequestSupplier(@Nullable final NonnullSupplier<HttpServletRequest> requestSupplier) {
+ checkSetterPreconditions();
+ httpServletRequestSupplier = requestSupplier;
+ }
/**
* Get the required parameters.
@@ -124,6 +161,16 @@ public class HttpServletRequestParametersValidationHandler extends AbstractHttpS
.collect(CollectionSupport.nonnullCollector(Collectors.toSet())).get();
}
}
+
+ /** {@inheritDoc} */
+ @Override
+ protected void doInitialize() throws ComponentInitializationException {
+ super.doInitialize();
+
+ if (getHttpServletRequest() == null) {
+ throw new ComponentInitializationException("HttpServletRequest cannot be null");
+ }
+ }
/** {@inheritDoc} */
@Override
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list