[cpp-sp] branch main updated: Add option to bypass event detection on remote ops.

Codeberg noreply at shibboleth.net
Wed Dec 10 02:40:33 UTC 2025


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/c801eacf6a12b3ba776a60a2d54c5c12aad86cc1

The following commit(s) were added to refs/heads/main by this push:
     new c801eacf Add option to bypass event detection on remote ops.
c801eacf is described below

commit c801eacf6a12b3ba776a60a2d54c5c12aad86cc1
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Dec 9 19:40:13 2025 -0700

    Add option to bypass event detection on remote ops.
---
 shibsp/remoting/RemotingService.h                | 15 ++++++++++++++-
 shibsp/remoting/impl/AbstractRemotingService.cpp |  6 +++++-
 shibsp/remoting/impl/AbstractRemotingService.h   |  2 +-
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/shibsp/remoting/RemotingService.h b/shibsp/remoting/RemotingService.h
index 3c0ce021..22853253 100644
--- a/shibsp/remoting/RemotingService.h
+++ b/shibsp/remoting/RemotingService.h
@@ -42,11 +42,24 @@ namespace shibsp {
 
         /**
          * Send a remoted message and return the response.
+         * 
+         * <p>The second parameter controls error detection. Operations typically
+         * return an event field that will contain either "success" or signal some
+         * error condition. If the flag is true/defaulted, the remoting layer will
+         * examine the field and raise an OperationException containing the detected
+         * event. If the flag is false, no detection occurs and the output is returned
+         * without an exception.</p>
+         * 
+         * <p>Callers that invooke operations that are "expected" to produce
+         * unusual events may use the flag to avoid triggering exceptions on what are
+         * essentially "expected" control paths.</p>
          *
          * @param in    input message to send
+         * @param checkEvent controls whether the event in the output is checked
+         * 
          * @return      response from remote service
          */
-        virtual DDF send(const DDF& in) const=0;
+        virtual DDF send(const DDF& in, bool checkEvent=true) const=0;
     };
 
     /**
diff --git a/shibsp/remoting/impl/AbstractRemotingService.cpp b/shibsp/remoting/impl/AbstractRemotingService.cpp
index f53170da..ed83d9e8 100644
--- a/shibsp/remoting/impl/AbstractRemotingService.cpp
+++ b/shibsp/remoting/impl/AbstractRemotingService.cpp
@@ -33,7 +33,7 @@ AbstractRemotingService::AbstractRemotingService(const ptree&) {}
 
 AbstractRemotingService::~AbstractRemotingService() {}
 
-DDF AbstractRemotingService::send(const DDF& in) const
+DDF AbstractRemotingService::send(const DDF& in, bool checkEvent) const
 {
     stringstream instream;
     instream << in;
@@ -44,6 +44,10 @@ DDF AbstractRemotingService::send(const DDF& in) const
     DDF output;
     outstream >> output;
 
+    if (!checkEvent) {
+        return output;
+    }
+
     const char* event = output.getmember("event").string();
     if (event && strcmp(event, "success")) {
         OperationException ex("Remote operation was unsuccessful.");
diff --git a/shibsp/remoting/impl/AbstractRemotingService.h b/shibsp/remoting/impl/AbstractRemotingService.h
index 380f1b3f..ea052121 100644
--- a/shibsp/remoting/impl/AbstractRemotingService.h
+++ b/shibsp/remoting/impl/AbstractRemotingService.h
@@ -42,7 +42,7 @@ namespace shibsp {
          * @param in    input message to send
          * @return      response from remote service
          */
-        DDF send(const DDF& in) const;
+        DDF send(const DDF& in, bool checkEvent=true) const;
 
     protected:
         AbstractRemotingService(const boost::property_tree::ptree& pt);

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


More information about the commits mailing list