[java-plugin-shibd] branch main updated: Add checking of output structures to guard asserts.

Codeberg noreply at shibboleth.net
Tue May 26 14:54:18 UTC 2026


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

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

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/9641f0a5ff57b1dd133e18290f9821e3dab4c23f

The following commit(s) were added to refs/heads/main by this push:
     new 9641f0a  Add checking of output structures to guard asserts.
9641f0a is described below

commit 9641f0a5ff57b1dd133e18290f9821e3dab4c23f
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue May 26 10:54:08 2026 -0400

    Add checking of output structures to guard asserts.
---
 .../AbstractTokenConsumerResponseAction.java       | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
index c1762dd..7d4056a 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
@@ -22,6 +22,7 @@ import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
+import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.action.EventIds;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
@@ -107,11 +108,33 @@ public abstract class AbstractTokenConsumerResponseAction extends AbstractApplic
         stateDataContextLookupStrategy =
                 Constraint.isNotNull(strategy, "StateDataContext creation strategy cannot be null");
     }
+
+    /** {@inheritDoc} */
+    @Override
+    protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
+        
+        if (!super.doPreExecute(profileRequestContext) ) {
+            return false;
+        }
+        
+        final AgentRequestContext agentRequestContext = ensureAgentRequestContext();
+        
+        final DDF output = agentRequestContext.getOutput();
+        if (output == null || !output.isstruct() || agentRequestContext.getRemotedHttpServletResponse() == null) {
+            log.error("{} Output message or response structure was missing", getLogPrefix());
+            ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
+            return false;
+        }
+        
+        return true;
+    }
     
     /** {@inheritDoc} */
     @Override
     protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
 
+        // The asserts were checked above...
+        
         final AgentRequestContext agentRequestContext = ensureAgentRequestContext();
         final DDF output = agentRequestContext.getOutput();
         assert output != null;

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


More information about the commits mailing list