[cpp-sp] 01/02: Add additional parameters to Passthrough handler.

Codeberg noreply at shibboleth.net
Tue Nov 10 15:03:52 UTC 2026


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

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

View the commit online:
https://codeberg.org/Shibboleth/cpp-sp/commit/098efb59fafac986dca005eac9db9def1c1e9a7f

commit 098efb59fafac986dca005eac9db9def1c1e9a7f
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue Nov 10 10:03:02 2026 -0500

    Add additional parameters to Passthrough handler.
---
 shibsp/handler/impl/Passthrough.cpp      | 18 ++++++++++++++++++
 shibsp/handler/impl/SessionInitiator.cpp |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/shibsp/handler/impl/Passthrough.cpp b/shibsp/handler/impl/Passthrough.cpp
index 14008f03..98012e25 100644
--- a/shibsp/handler/impl/Passthrough.cpp
+++ b/shibsp/handler/impl/Passthrough.cpp
@@ -47,6 +47,7 @@ namespace {
     private:
         string m_operation;
         set<string> m_remotedHeaders;
+        vector<string> m_requestMapperSettings;
         bool m_body;
         bool m_limitRedirects;
     };
@@ -65,6 +66,7 @@ Passthrough::Passthrough(const ptree& pt, const char* path)
     static const char REMOTED_HEADERS_PROP_NAME[] = "remotedHeaders";
     static const char SEND_BODY_PROP_NAME[] = "sendBody";
     static const char LIMIT_REDIRECTS_PROP_NAME[] = "limitRedirects";
+    static const char REQUEST_MAPPER_SETTINGS_PROP_NAME[] = "requestMapperSettings";
 
     static const char OPERATION_PROP_DEFAULT[] = "";
     static bool SEND_BODY_PROP_DEFAULT = false;
@@ -80,6 +82,11 @@ Passthrough::Passthrough(const ptree& pt, const char* path)
         split_to_container(m_remotedHeaders, headers);
     }
 
+    const char* settings = getString(REQUEST_MAPPER_SETTINGS_PROP_NAME);
+    if (settings) {
+        split_to_container(m_requestMapperSettings, settings);
+    }
+
     m_body = getBool(SEND_BODY_PROP_NAME, SEND_BODY_PROP_DEFAULT);
     m_limitRedirects = getBool(LIMIT_REDIRECTS_PROP_NAME, LIMIT_REDIRECTS_PROP_DEFAULT);
 }
@@ -93,6 +100,17 @@ pair<bool,long> Passthrough::run(SPRequest& request, bool isHandler) const
         DDF wrapped = wrapRequest(request, m_remotedHeaders, m_body);
         input.add(wrapped);
 
+        // Handler base can be derived from "this" URL.
+        input.addmember("handler_base").string(request.getHandlerURL());
+
+        for (const string& propname : m_requestMapperSettings) {
+            const char* prop = getString(propname.c_str(), request, nullptr,
+                HANDLER_PROPERTY_FIXED | HANDLER_PROPERTY_MAP);
+            if (prop) {
+                input.addmember(propname.c_str()).string(prop);
+            }
+        }
+
         DDF output = request.getAgent().getRemotingService()->send(input);
         DDFJanitor outputJanitor(output);
 
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index 0dfd39b6..ecb564d8 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -122,7 +122,7 @@ pair<bool,long> SessionInitiator::run(SPRequest& request, bool isHandler) const
                 
                 // handler can be derived from "this" URL since this is a re-entrant call to this handler,
                 // i.e., we know this is the right URL to use because "it already was" originally.
-                handlerBaseURL = request.getHandlerURL(request.getRequestURL());
+                handlerBaseURL = request.getHandlerURL();
                 if (!discoveryDone) {
                     handler = handlerBaseURL + m_path;
                 }

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


More information about the commits mailing list