[cpp-sp] branch main updated: Session initiator bug fixes.

Scott Cantor cantor.2 at osu.edu
Tue Feb 11 18:23:46 UTC 2025


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

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=63b746ce8c3c2d329bb14546f0117bebafbd71a7

The following commit(s) were added to refs/heads/main by this push:
     new 63b746ce Session initiator bug fixes.
63b746ce is described below

commit 63b746ce8c3c2d329bb14546f0117bebafbd71a7
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Feb 11 13:23:41 2025 -0500

    Session initiator bug fixes.
---
 shibsp/handler/impl/AbstractHandler.cpp            |  7 +++---
 .../handler/impl/DefaultHandlerConfiguration.cpp   | 25 +++++++++++++++-------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp
index 1c8850e5..73822045 100644
--- a/shibsp/handler/impl/AbstractHandler.cpp
+++ b/shibsp/handler/impl/AbstractHandler.cpp
@@ -156,7 +156,8 @@ DDF AbstractHandler::wrapRequest(const SPRequest& request, const vector<string>&
 
 pair<bool,long> AbstractHandler::unwrapResponse(SPRequest& request, DDF& wrappedResponse) const
 {
-    DDF h = wrappedResponse["headers"];
+    DDF http = wrappedResponse["http"];
+    DDF h = http["headers"];
     DDF hdr = h.first();
     while (hdr.isstring()) {
         if (!strcasecmp(hdr.name(), "Content-Type")) {
@@ -168,12 +169,12 @@ pair<bool,long> AbstractHandler::unwrapResponse(SPRequest& request, DDF& wrapped
         hdr = h.next();
     }
 
-    h = wrappedResponse["redirect"];
+    h = http["redirect"];
     if (h.isstring()) {
         return make_pair(true, request.sendRedirect(h.string()));
     }
 
-    h = wrappedResponse["response"];
+    h = http["response"];
     if (h.isstruct()) {
         const char* data = h["data"].string();
         if (data) {
diff --git a/shibsp/handler/impl/DefaultHandlerConfiguration.cpp b/shibsp/handler/impl/DefaultHandlerConfiguration.cpp
index 6db19567..a10dfbe5 100644
--- a/shibsp/handler/impl/DefaultHandlerConfiguration.cpp
+++ b/shibsp/handler/impl/DefaultHandlerConfiguration.cpp
@@ -118,9 +118,9 @@ DefaultHandlerConfiguration::DefaultHandlerConfiguration(const char* pathname)
         }
     }
 
-    // If a single token consumer with no binding label is installed, convert list to unnamed string.
+    // If a single token consumer with no binding label is installed, convert list to a string node.
     if (m_tokenConsumerConfig.integer() == 1 && !m_tokenConsumerConfig.first().name()) {
-        DDF singleEndpoint(nullptr);
+        DDF singleEndpoint("response_url");
         singleEndpoint.string(m_tokenConsumerConfig.first().string());
         m_tokenConsumerConfig.destroy();
         m_tokenConsumerConfig = singleEndpoint;
@@ -130,7 +130,9 @@ DefaultHandlerConfiguration::DefaultHandlerConfiguration(const char* pathname)
 const Handler* DefaultHandlerConfiguration::getHandler(const char* path) const
 {
     if (path) {
-        const auto& mapping = m_handlerMap.find(path);
+        string wrap(path);
+        wrap = wrap.substr(0, wrap.find(';'));
+        const auto& mapping = m_handlerMap.find(wrap.substr(0, wrap.find('?')));
         if (mapping != m_handlerMap.end()) {
             return mapping->second.get();
         }
@@ -151,12 +153,19 @@ DDF DefaultHandlerConfiguration::getTokenConsumerInfo(const char* handlerURL) co
     DDF dup = m_tokenConsumerConfig.copy();
 
     if (handlerURL) {
-        DDF endpoint = dup.first();
-        while (!endpoint.isnull()) {
+        if (dup.islist()) {
+            DDF endpoint = dup.first();
+            while (!endpoint.isnull()) {
+                string path(handlerURL);
+                path += endpoint.string();
+                endpoint.string(path.c_str());
+                endpoint = dup.next();
+            }
+        }
+        else if (dup.isstring()) {
             string path(handlerURL);
-            path += endpoint.string();
-            endpoint.string(path.c_str());
-            endpoint = dup.next();
+            path += dup.string();
+            dup.string(path.c_str());
         }
     }
 

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


More information about the commits mailing list