[cpp-sp] branch main updated: SSPCPP-922 - Add externalParameters option to Errors element

Scott Cantor cantor.2 at osu.edu
Tue Mar 16 14:57:00 UTC 2021


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=d1dbebfadc1bdb824fea63843c4c38fa69e54379

The following commit(s) were added to refs/heads/main by this push:
       new  d1dbebfa  SSPCPP-922 - Add externalParameters option to Errors element
d1dbebfa is described below

commit d1dbebfadc1bdb824fea63843c4c38fa69e54379
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Mar 16 10:56:22 2021 -0400

    SSPCPP-922 - Add externalParameters option to Errors element
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-922
---
 config_win32.h                                  |  6 +++---
 configure.ac                                    |  2 +-
 schemas/shibboleth-3.0-native-sp-config.xsd     |  3 ++-
 shibsp/ServiceProvider.cpp                      | 11 +++++++++--
 shibsp/handler/impl/AttributeCheckerHandler.cpp | 12 ++++++++++--
 shibsp/handler/impl/FormSessionInitiator.cpp    | 12 +++++++++++-
 shibsp/handler/impl/LogoutHandler.cpp           | 10 +++++++++-
 shibsp/shibsp.rc                                |  6 +++---
 shibsp/version.h                                |  2 +-
 util/resourceCommon.rci                         |  8 ++++----
 10 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/config_win32.h b/config_win32.h
index 02771cc8..3af7ada1 100644
--- a/config_win32.h
+++ b/config_win32.h
@@ -121,13 +121,13 @@
 #define PACKAGE_NAME "shibboleth"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "shibboleth 3.2.0"
+#define PACKAGE_STRING "shibboleth 3.2.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "shibboleth-sp"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.2.0"
+#define PACKAGE_VERSION "3.2.1"
 
 /* Define to the necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -140,7 +140,7 @@
 /* #undef TM_IN_SYS_TIME */
 
 /* Version number of package */
-#define VERSION "3.2.0"
+#define VERSION "3.2.1"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
diff --git a/configure.ac b/configure.ac
index 385d11d0..ddae5880 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.50])
-AC_INIT([shibboleth],[3.2.0],[https://issues.shibboleth.net/],[shibboleth-sp])
+AC_INIT([shibboleth],[3.2.1],[https://issues.shibboleth.net/],[shibboleth-sp])
 AC_CONFIG_SRCDIR(shibsp)
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_MACRO_DIR(m4)
diff --git a/schemas/shibboleth-3.0-native-sp-config.xsd b/schemas/shibboleth-3.0-native-sp-config.xsd
index e8d3fab5..3f39260c 100644
--- a/schemas/shibboleth-3.0-native-sp-config.xsd
+++ b/schemas/shibboleth-3.0-native-sp-config.xsd
@@ -9,7 +9,7 @@
 	elementFormDefault="qualified"
 	attributeFormDefault="unqualified"
 	blockDefault="substitution"
-	version="3.1">
+	version="3.2">
 
   <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd" />
   <import namespace="urn:oasis:names:tc:SAML:2.0:assertion" schemaLocation="saml-schema-assertion-2.0.xsd"/>
@@ -754,6 +754,7 @@
     <attribute name="localLogout" type="conf:anyURI"/>
     <attribute name="globalLogout" type="conf:anyURI"/>
     <attribute name="partialLogout" type="conf:anyURI"/>
+    <attribute name="externalParameters" type="boolean" />
     <anyAttribute namespace="##any" processContents="lax"/>
   </complexType>
 
diff --git a/shibsp/ServiceProvider.cpp b/shibsp/ServiceProvider.cpp
index 0b184eb1..7f1d9f4d 100644
--- a/shibsp/ServiceProvider.cpp
+++ b/shibsp/ServiceProvider.cpp
@@ -71,9 +71,16 @@ namespace shibsp {
         if (!app)
             app = request.getServiceProvider().getApplication(nullptr);
 
-        const PropertySet* props=app->getPropertySet("Errors");
+        const PropertySet* props = app->getPropertySet("Errors");
 
-        // First look for settings in the request map of the form pageError.
+        // If the externalParameters option isn't set, clear out the request field.
+        pair<bool,bool> externalParameters =
+                props ? props->getBool("externalParameters") : pair<bool,bool>(false,false);
+        if (!externalParameters.first || !externalParameters.second) {
+            tp.m_request = nullptr;
+        }
+
+        // Now look for settings in the request map of the form pageError.
         try {
             RequestMapper::Settings settings = request.getRequestSettings();
             if (mderror)
diff --git a/shibsp/handler/impl/AttributeCheckerHandler.cpp b/shibsp/handler/impl/AttributeCheckerHandler.cpp
index 49044dbb..548b870e 100644
--- a/shibsp/handler/impl/AttributeCheckerHandler.cpp
+++ b/shibsp/handler/impl/AttributeCheckerHandler.cpp
@@ -188,8 +188,16 @@ pair<bool,long> AttributeCheckerHandler::run(SPRequest& request, bool isHandler)
 
     ifstream infile(m_template.c_str());
     if (infile) {
-        TemplateParameters tp(nullptr, request.getApplication().getPropertySet("Errors"), session);
-        tp.m_request = &request;
+        const PropertySet* props = request.getApplication().getPropertySet("Errors");
+        TemplateParameters tp(nullptr, props, session);
+
+        // If the externalParameters option isn't set, don't populate the request field.
+        pair<bool,bool> externalParameters =
+                props ? props->getBool("externalParameters") : pair<bool,bool>(false,false);
+        if (externalParameters.first && externalParameters.second) {
+            tp.m_request = &request;
+        }
+
         stringstream str;
         XMLToolingConfig::getConfig().getTemplateEngine()->run(infile, str, tp);
         if (m_flushSession && session) {
diff --git a/shibsp/handler/impl/FormSessionInitiator.cpp b/shibsp/handler/impl/FormSessionInitiator.cpp
index 522b31b8..24dd77d8 100644
--- a/shibsp/handler/impl/FormSessionInitiator.cpp
+++ b/shibsp/handler/impl/FormSessionInitiator.cpp
@@ -123,8 +123,18 @@ pair<bool,long> FormSessionInitiator::run(SPRequest& request, string& entityID,
     ifstream infile(XMLToolingConfig::getConfig().getPathResolver()->resolve(fname, PathResolver::XMLTOOLING_CFG_FILE).c_str());
     if (!infile)
         throw ConfigurationException("Unable to access HTML template ($1).", params(1, m_template));
+
+    const PropertySet* props = app.getPropertySet("Errors");
+
     TemplateParameters tp;
-    tp.m_request = &request;
+
+    // If the externalParameters option isn't set, don't populate the request field.
+    pair<bool,bool> externalParameters =
+            props ? props->getBool("externalParameters") : pair<bool,bool>(false,false);
+    if (externalParameters.first && externalParameters.second) {
+        tp.m_request = &request;
+    }
+
     tp.setPropertySet(app.getPropertySet("Errors"));
     tp.m_map["action"] = returnURL;
     if (!target.empty())
diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp
index 026be560..5673a121 100644
--- a/shibsp/handler/impl/LogoutHandler.cpp
+++ b/shibsp/handler/impl/LogoutHandler.cpp
@@ -63,6 +63,7 @@ pair<bool,long> LogoutHandler::sendLogoutPage(
 {
     string tname = string(type) + "Logout";
     const PropertySet* props = application.getPropertySet("Errors");
+
     pair<bool,const char*> prop = props ? props->getString(tname.c_str()) : pair<bool,const char*>(false,nullptr);
     if (!prop.first) {
         tname += ".html";
@@ -76,7 +77,14 @@ pair<bool,long> LogoutHandler::sendLogoutPage(
     if (!infile)
         throw ConfigurationException("Unable to access $1 HTML template.", params(1,prop.second));
     TemplateParameters tp;
-    tp.m_request = &request;
+
+    // If the externalParameters option isn't set, don't populate the request field.
+    pair<bool,bool> externalParameters =
+            props ? props->getBool("externalParameters") : pair<bool,bool>(false,false);
+    if (externalParameters.first && externalParameters.second) {
+        tp.m_request = &request;
+    }
+
     tp.setPropertySet(props);
     tp.m_map["logoutStatus"] = "Logout completed successfully.";  // Backward compatibility.
     stringstream str;
diff --git a/shibsp/shibsp.rc b/shibsp/shibsp.rc
index b33cd1d6..9a177c41 100644
--- a/shibsp/shibsp.rc
+++ b/shibsp/shibsp.rc
@@ -64,7 +64,7 @@ BEGIN
             VALUE "InternalName", "shibsp3_2\0"
 #endif
 #endif
-            VALUE "LegalCopyright", "Copyright 2020 UCAID\0"
+            VALUE "LegalCopyright", "Copyright 2021 Various\0"
             VALUE "LegalTrademarks", "\0"
 #ifdef SHIBSP_LITE
 #ifdef _DEBUG
@@ -80,8 +80,8 @@ BEGIN
 #endif
 #endif
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "Shibboleth 3.2.0\0"
-            VALUE "ProductVersion", "3, 2, 0, 0\0"
+            VALUE "ProductName", "Shibboleth 3.2.1\0"
+            VALUE "ProductVersion", "3, 2, 1, 0\0"
             VALUE "SpecialBuild", "\0"
         END
     END
diff --git a/shibsp/version.h b/shibsp/version.h
index 98a27c85..320ec3ae 100644
--- a/shibsp/version.h
+++ b/shibsp/version.h
@@ -44,7 +44,7 @@
 
 #define SHIBSP_VERSION_MAJOR 3
 #define SHIBSP_VERSION_MINOR 2
-#define SHIBSP_VERSION_REVISION 0
+#define SHIBSP_VERSION_REVISION 1
 
 /** DO NOT MODIFY BELOW THIS LINE */
 
diff --git a/util/resourceCommon.rci b/util/resourceCommon.rci
index 43ab262a..001b03f3 100644
--- a/util/resourceCommon.rci
+++ b/util/resourceCommon.rci
@@ -1,10 +1,10 @@
 
             VALUE "Comments", "\0"
             VALUE "CompanyName", "Shibboleth Consortium\0"
-            VALUE "FileVersion", "3,2,0,0\0"
-            VALUE "LegalCopyright", "Copyright 2020 Various\0"
+            VALUE "FileVersion", "3,2,1,0\0"
+            VALUE "LegalCopyright", "Copyright 2021 Various\0"
             VALUE "LegalTrademarks", "\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "Shibboleth 3.2.0\0"
-            VALUE "ProductVersion", "3, 2, 0, 0\0"
+            VALUE "ProductName", "Shibboleth 3.2.1\0"
+            VALUE "ProductVersion", "3, 2, 1, 0\0"
             VALUE "SpecialBuild", "\0"

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


More information about the commits mailing list