[cpp-sp] branch main updated: Remove Form SessionInitiator.

Scott Cantor cantor.2 at osu.edu
Mon Nov 4 19:11:22 UTC 2024


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

The following commit(s) were added to refs/heads/main by this push:
     new c381de69 Remove Form SessionInitiator.
c381de69 is described below

commit c381de690c2a1f2d478d57e27a541d6567b7de9b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Nov 4 14:11:18 2024 -0500

    Remove Form SessionInitiator.
---
 Projects/vc15/shibsp/shibsp.vcxproj          |   1 -
 shibsp/Makefile.am                           |   1 -
 shibsp/handler/SessionInitiator.h            |   2 -
 shibsp/handler/impl/FormSessionInitiator.cpp | 147 ---------------------------
 shibsp/handler/impl/SessionInitiator.cpp     |   2 -
 5 files changed, 153 deletions(-)

diff --git a/Projects/vc15/shibsp/shibsp.vcxproj b/Projects/vc15/shibsp/shibsp.vcxproj
index 8ff3d7df..813d610f 100644
--- a/Projects/vc15/shibsp/shibsp.vcxproj
+++ b/Projects/vc15/shibsp/shibsp.vcxproj
@@ -231,7 +231,6 @@
     <ClCompile Include="..\..\..\shibsp\handler\impl\AssertionLookup.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\ChainingLogoutInitiator.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\ChainingSessionInitiator.cpp" />
-    <ClCompile Include="..\..\..\shibsp\handler\impl\FormSessionInitiator.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\LocalLogoutInitiator.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\LogoutHandler.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\MetadataGenerator.cpp" />
diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am
index 057a18ae..9963a27e 100644
--- a/shibsp/Makefile.am
+++ b/shibsp/Makefile.am
@@ -88,7 +88,6 @@ libshibsp_la_SOURCES = \
 	handler/impl/ChainingLogoutInitiator.cpp \
 	handler/impl/ChainingSessionInitiator.cpp \
 	handler/impl/DiscoveryFeed.cpp \
-	handler/impl/FormSessionInitiator.cpp \
 	handler/impl/LocalLogoutInitiator.cpp \
 	handler/impl/LogoutHandler.cpp \
 	handler/impl/LogoutInitiator.cpp \
diff --git a/shibsp/handler/SessionInitiator.h b/shibsp/handler/SessionInitiator.h
index b527ffab..35a96fb2 100644
--- a/shibsp/handler/SessionInitiator.h
+++ b/shibsp/handler/SessionInitiator.h
@@ -103,8 +103,6 @@ namespace shibsp {
     /** SessionInitiator that supports SAML Discovery Service protocol. */
     #define SAMLDS_SESSION_INITIATOR "SAMLDS"
     
-    /** SessionInitiator that uses HTML form submission from the user. */
-    #define FORM_SESSION_INITIATOR "Form"
 };
 
 #endif /* __shibsp_sesinitiator_h__ */
diff --git a/shibsp/handler/impl/FormSessionInitiator.cpp b/shibsp/handler/impl/FormSessionInitiator.cpp
deleted file mode 100644
index 79ba87c2..00000000
--- a/shibsp/handler/impl/FormSessionInitiator.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * Licensed to the University Corporation for Advanced Internet
- * Development, Inc. (UCAID) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for
- * additional information regarding copyright ownership.
- *
- * UCAID licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the
- * License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the License.
- */
-
-/**
- * FormSessionInitiator.cpp
- * 
- * HTML form-based IdP discovery.
- */
-
-#include "internal.h"
-#include "Application.h"
-#include "exceptions.h"
-#include "handler/AbstractHandler.h"
-#include "handler/SessionInitiator.h"
-#include "util/TemplateParameters.h"
-
-#include <fstream>
-#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/util/PathResolver.h>
-#include <xmltooling/util/URLEncoder.h>
-
-using namespace shibsp;
-using namespace opensaml;
-using namespace xmltooling;
-using namespace std;
-
-namespace shibsp {
-
-#if defined (_MSC_VER)
-    #pragma warning( push )
-    #pragma warning( disable : 4250 )
-#endif
-
-    class SHIBSP_DLLLOCAL FormSessionInitiator : public SessionInitiator, public AbstractHandler
-    {
-    public:
-        FormSessionInitiator(const DOMElement* e, const char* appId)
-            : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT ".SessionInitiator.Form")), m_template(getString("template").second) {
-            if (!m_template)
-                throw ConfigurationException("Form SessionInitiator requires a template property.");
-
-            SPConfig::getConfig().deprecation().warn(FORM_SESSION_INITIATOR" SessionInitiator is slated for removal");
-        }
-        virtual ~FormSessionInitiator() {}
-        
-        pair<bool,long> run(SPRequest& request, string& entityID, bool isHandler=true) const;
-
-    private:
-        const char* m_template;
-    };
-
-#if defined (_MSC_VER)
-    #pragma warning( pop )
-#endif
-
-    SessionInitiator* SHIBSP_DLLLOCAL FormSessionInitiatorFactory(const pair<const DOMElement*,const char*>& p, bool)
-    {
-        return new FormSessionInitiator(p.first, p.second);
-    }
-
-};
-
-pair<bool,long> FormSessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const
-{
-    if (!checkCompatibility(request, isHandler))
-        return make_pair(false,0L);
-
-    string target;
-    pair<bool,const char*> prop;
-    const Application& app=request.getApplication();
-
-    if (isHandler) {
-        prop = getString("target", request);
-        if (prop.first)
-            target = prop.second;
-        recoverRelayState(app, request, request, target, false);
-    }
-    else {
-        // Check for a hardwired target value in the map or handler.
-        prop = getString("target", request, HANDLER_PROPERTY_MAP|HANDLER_PROPERTY_FIXED);
-        if (prop.first)
-            target = prop.second;
-        else
-            target = request.getRequestURL();
-    }
-
-    // Compute the return URL. We start with a self-referential link.
-    string returnURL=request.getHandlerURL(target.c_str());
-    pair<bool,const char*> thisloc = getString("Location");
-    if (thisloc.first)
-        returnURL += thisloc.second;
-
-    if (isHandler) {
-        // We may already have RelayState set if we looped back here,
-        // but we've turned it back into a resource by this point, so if there's
-        // a target on the URL, reset to that value.
-        prop.second = request.getParameter("target");
-        if (prop.second && *prop.second)
-            target = prop.second;
-    }
-
-    preserveRelayState(app, request, target);
-
-    request.setContentType("text/html");
-    request.setResponseHeader("Expires","Wed, 01 Jan 1997 12:00:00 GMT");
-    request.setResponseHeader("Cache-Control","private,no-store,no-cache,max-age=0");
-    string fname(m_template);
-    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;
-
-    // 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())
-        tp.m_map["target"] = target;
-    stringstream str;
-    XMLToolingConfig::getConfig().getTemplateEngine()->run(infile, str, tp);
-    return make_pair(true,request.sendResponse(str));
-}
diff --git a/shibsp/handler/impl/SessionInitiator.cpp b/shibsp/handler/impl/SessionInitiator.cpp
index 12f5cf8c..c79d8a89 100644
--- a/shibsp/handler/impl/SessionInitiator.cpp
+++ b/shibsp/handler/impl/SessionInitiator.cpp
@@ -42,7 +42,6 @@ namespace shibsp {
     SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory ChainingSessionInitiatorFactory;
     SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory SAML2SessionInitiatorFactory;
     SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory SAMLDSSessionInitiatorFactory;
-    SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory FormSessionInitiatorFactory;
 };
 
 void SHIBSP_API shibsp::registerSessionInitiators()
@@ -51,7 +50,6 @@ void SHIBSP_API shibsp::registerSessionInitiators()
     conf.SessionInitiatorManager.registerFactory(CHAINING_SESSION_INITIATOR, ChainingSessionInitiatorFactory);
     conf.SessionInitiatorManager.registerFactory(SAML2_SESSION_INITIATOR, SAML2SessionInitiatorFactory);
     conf.SessionInitiatorManager.registerFactory(SAMLDS_SESSION_INITIATOR, SAMLDSSessionInitiatorFactory);
-    conf.SessionInitiatorManager.registerFactory(FORM_SESSION_INITIATOR, FormSessionInitiatorFactory);
 }
 
 SessionInitiator::SessionInitiator()

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


More information about the commits mailing list