[java-plugin-shibd] branch main updated: DecodeMessage subclass to handle remoted requests.

Scott Cantor cantor.2 at osu.edu
Tue Aug 27 16:42:20 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd.git;a=commit;h=deeb55281d1431a71315d708861c972dcb7b3051

The following commit(s) were added to refs/heads/main by this push:
     new deeb552  DecodeMessage subclass to handle remoted requests.
deeb552 is described below

commit deeb55281d1431a71315d708861c972dcb7b3051
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Aug 27 12:42:17 2024 -0400

    DecodeMessage subclass to handle remoted requests.
---
 .../shibboleth/sp/profile/impl/DecodeMessage.java  | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeMessage.java b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeMessage.java
new file mode 100644
index 0000000..4af2e60
--- /dev/null
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/profile/impl/DecodeMessage.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.sp.profile.impl;
+
+import javax.annotation.Nonnull;
+
+import org.opensaml.messaging.decoder.MessageDecoder;
+import org.opensaml.profile.context.ProfileRequestContext;
+
+import net.shibboleth.sp.context.AgentRequestContext;
+import net.shibboleth.sp.messaging.RemotedHttpServletRequest;
+import net.shibboleth.sp.messaging.impl.RemotedHttpServletRequestResponseContext;
+
+/**
+ * Subclass of OpenSAML {@link DecodeMessage} action that wraps the execute step to
+ * stash off the {@link RemotedHttpServletRequest} from the {@link AgentRequestContext}
+ * for access by the {@link MessageDecoder}.
+ */
+public class DecodeMessage extends org.opensaml.profile.action.impl.DecodeMessage {
+
+    /**
+     * Constructor.
+     * 
+     * @param messageDecoder the {@link MessageDecoder} used for the incoming request
+     */
+    public DecodeMessage(@Nonnull final MessageDecoder messageDecoder) {
+        super(messageDecoder);
+    }
+    
+    /** {@inheritDoc} */
+    @Override
+    protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
+        final AgentRequestContext agentRequestContext =
+                profileRequestContext.ensureSubcontext(AgentRequestContext.class);
+        
+        try {
+            RemotedHttpServletRequestResponseContext.loadCurrent(agentRequestContext.getRemotedHttpServletRequest(),
+                    agentRequestContext.getRemotedHttpServletResponse());
+            super.doExecute(profileRequestContext);
+        } finally {
+            RemotedHttpServletRequestResponseContext.clearCurrent();
+        }
+    }
+
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list