[cpp-sp] branch master updated: SSPCPP-798 - Administrative logout

Scott Cantor cantor.2 at osu.edu
Wed Apr 25 13:56:47 EDT 2018


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

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

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

The following commit(s) were added to refs/heads/master by this push:
       new  1ecfb4a   SSPCPP-798 - Administrative logout
1ecfb4a is described below

commit 1ecfb4a7dee391eb03dbd5b2d7c84a3cee5241dd
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 25 13:56:11 2018 -0400

    SSPCPP-798 - Administrative logout
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-798
---
 Projects/vc15/shibsp/shibsp-lite.vcxproj         |  1 +
 Projects/vc15/shibsp/shibsp-lite.vcxproj.filters |  3 +++
 Projects/vc15/shibsp/shibsp.vcxproj              |  1 +
 Projects/vc15/shibsp/shibsp.vcxproj.filters      |  3 +++
 configs/shibboleth3.xml                          |  5 ++++-
 configs/win-shibboleth3.xml                      |  3 +++
 shibsp/Makefile.am                               |  1 +
 shibsp/SessionCache.h                            |  3 ---
 shibsp/handler/LogoutHandler.h                   | 18 ------------------
 shibsp/handler/LogoutInitiator.h                 |  3 +++
 shibsp/handler/impl/LogoutHandler.cpp            |  7 -------
 shibsp/handler/impl/LogoutInitiator.cpp          |  2 ++
 12 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/Projects/vc15/shibsp/shibsp-lite.vcxproj b/Projects/vc15/shibsp/shibsp-lite.vcxproj
index c42df16..c256dc7 100644
--- a/Projects/vc15/shibsp/shibsp-lite.vcxproj
+++ b/Projects/vc15/shibsp/shibsp-lite.vcxproj
@@ -196,6 +196,7 @@
     <ClCompile Include="..\..\..\shibsp\AbstractSPRequest.cpp" />
     <ClCompile Include="..\..\..\shibsp\Application.cpp" />
     <ClCompile Include="..\..\..\shibsp\binding\impl\XMLProtocolProvider.cpp" />
+    <ClCompile Include="..\..\..\shibsp\handler\impl\AdminLogoutInitiator.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\AttributeCheckerHandler.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\DiscoveryFeed.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\ExternalAuthHandler.cpp" />
diff --git a/Projects/vc15/shibsp/shibsp-lite.vcxproj.filters b/Projects/vc15/shibsp/shibsp-lite.vcxproj.filters
index a1f9c34..1ea4c1b 100644
--- a/Projects/vc15/shibsp/shibsp-lite.vcxproj.filters
+++ b/Projects/vc15/shibsp/shibsp-lite.vcxproj.filters
@@ -243,6 +243,9 @@
     <ClCompile Include="..\..\..\shibsp\impl\StoredSession.cpp">
       <Filter>Source Files\impl</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\shibsp\handler\impl\AdminLogoutInitiator.cpp">
+      <Filter>Source Files\handler\impl</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\shibsp\GSSRequest.h">
diff --git a/Projects/vc15/shibsp/shibsp.vcxproj b/Projects/vc15/shibsp/shibsp.vcxproj
index fb24c93..8017c91 100644
--- a/Projects/vc15/shibsp/shibsp.vcxproj
+++ b/Projects/vc15/shibsp/shibsp.vcxproj
@@ -205,6 +205,7 @@
     <ClCompile Include="..\..\..\shibsp\attribute\resolver\impl\AssertionAttributeExtractor.cpp" />
     <ClCompile Include="..\..\..\shibsp\attribute\resolver\impl\MetadataAttributeExtractor.cpp" />
     <ClCompile Include="..\..\..\shibsp\binding\impl\XMLProtocolProvider.cpp" />
+    <ClCompile Include="..\..\..\shibsp\handler\impl\AdminLogoutInitiator.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\AttributeCheckerHandler.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\DiscoveryFeed.cpp" />
     <ClCompile Include="..\..\..\shibsp\handler\impl\ExternalAuthHandler.cpp" />
diff --git a/Projects/vc15/shibsp/shibsp.vcxproj.filters b/Projects/vc15/shibsp/shibsp.vcxproj.filters
index d9bb79d..6172e0e 100644
--- a/Projects/vc15/shibsp/shibsp.vcxproj.filters
+++ b/Projects/vc15/shibsp/shibsp.vcxproj.filters
@@ -432,6 +432,9 @@
     <ClCompile Include="..\..\..\shibsp\impl\StoredSession.cpp">
       <Filter>Source Files\impl</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\shibsp\handler\impl\AdminLogoutInitiator.cpp">
+      <Filter>Source Files\handler\impl</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\shibsp\GSSRequest.h">
diff --git a/configs/shibboleth3.xml b/configs/shibboleth3.xml
index b5ea3ce..4ecd5d5 100644
--- a/configs/shibboleth3.xml
+++ b/configs/shibboleth3.xml
@@ -49,7 +49,10 @@
 
             <!-- SAML and local-only logout. -->
             <Logout>SAML2 Local</Logout>
-            
+
+            <!-- Administrative logout. -->
+            <LogoutInitiator type="Admin" Location="/Logout/Admin" acl="127.0.0.1 ::1" />
+          
             <!-- Extension service that generates "approximate" metadata based on SP configuration. -->
             <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
 
diff --git a/configs/win-shibboleth3.xml b/configs/win-shibboleth3.xml
index ffda324..755cc54 100644
--- a/configs/win-shibboleth3.xml
+++ b/configs/win-shibboleth3.xml
@@ -93,6 +93,9 @@
             <!-- SAML and local-only logout. -->
             <Logout>SAML2 Local</Logout>
 
+            <!-- Administrative logout. -->
+            <LogoutInitiator type="Admin" Location="/Logout/Admin" acl="127.0.0.1 ::1" />
+
             <!-- Extension service that generates "approximate" metadata based on SP configuration. -->
             <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
 
diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am
index bc2187b..5a19269 100644
--- a/shibsp/Makefile.am
+++ b/shibsp/Makefile.am
@@ -124,6 +124,7 @@ common_sources = \
 	attribute/XMLAttribute.cpp \
 	binding/impl/XMLProtocolProvider.cpp \
 	handler/impl/AbstractHandler.cpp \
+	handler/impl/AdminLogout.cpp \
 	handler/impl/AssertionConsumerService.cpp \
 	handler/impl/AssertionLookup.cpp \
     handler/impl/AttributeCheckerHandler.cpp \
diff --git a/shibsp/SessionCache.h b/shibsp/SessionCache.h
index eca14db..4977dba 100644
--- a/shibsp/SessionCache.h
+++ b/shibsp/SessionCache.h
@@ -368,9 +368,6 @@ namespace shibsp {
         /**
         * Locates an existing session by ID.
         *
-        * <p>If the client address is supplied, then a check will be performed against
-        * the address recorded in the record.</p>
-        *
         * @param application   reference to Application that owns the Session
         * @param key           session key
         * @return  pointer to locked Session, or nullptr
diff --git a/shibsp/handler/LogoutHandler.h b/shibsp/handler/LogoutHandler.h
index a0db1c7..6407e2f 100644
--- a/shibsp/handler/LogoutHandler.h
+++ b/shibsp/handler/LogoutHandler.h
@@ -116,24 +116,6 @@ namespace shibsp {
             ) const;
 
         /**
-         * @deprecated
-         * Sends a response template to the user agent informing it of the results of a logout attempt.
-         *
-         * @param application   the Application to use in determining the logout template
-         * @param request       the HTTP client request to supply to the template
-         * @param response      the HTTP response to use
-         * @param local         true iff the logout operation was local to the SP, false iff global
-         * @param status        optional logoutStatus key value to add to template
-         */
-        std::pair<bool,long> sendLogoutPage(
-            const Application& application,
-            const xmltooling::HTTPRequest& request,
-            xmltooling::HTTPResponse& response,
-            bool local=true,
-            const char* status=nullptr
-            ) const;
-
-        /**
          * Sends a response template to the user agent informing it of the results of a logout attempt.
          *
          * @param application   the Application to use in determining the logout template
diff --git a/shibsp/handler/LogoutInitiator.h b/shibsp/handler/LogoutInitiator.h
index 25e8e97..2144bf4 100644
--- a/shibsp/handler/LogoutInitiator.h
+++ b/shibsp/handler/LogoutInitiator.h
@@ -49,6 +49,9 @@ namespace shibsp {
     /** Registers LogoutInitiator implementations. */
     void SHIBSP_API registerLogoutInitiators();
 
+    /** LogoutInitiator that supports administrative logout. */
+    #define ADMIN_LOGOUT_INITIATOR "Admin"
+
     /** LogoutInitiator that iterates through a set of protocol-specific versions. */
     #define CHAINING_LOGOUT_INITIATOR "Chaining"
 
diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp
index 81946ad..dfdb305 100644
--- a/shibsp/handler/impl/LogoutHandler.cpp
+++ b/shibsp/handler/impl/LogoutHandler.cpp
@@ -58,13 +58,6 @@ const char* LogoutHandler::getEventType() const {
 }
 
 pair<bool,long> LogoutHandler::sendLogoutPage(
-    const Application& application, const HTTPRequest& request, HTTPResponse& response, bool local, const char* status
-    ) const
-{
-    return sendLogoutPage(application, request, response, local ? "local" : "global");
-}
-
-pair<bool,long> LogoutHandler::sendLogoutPage(
     const Application& application, const HTTPRequest& request, HTTPResponse& response, const char* type
     ) const
 {
diff --git a/shibsp/handler/impl/LogoutInitiator.cpp b/shibsp/handler/impl/LogoutInitiator.cpp
index e1646b9..ed4636c 100644
--- a/shibsp/handler/impl/LogoutInitiator.cpp
+++ b/shibsp/handler/impl/LogoutInitiator.cpp
@@ -32,6 +32,7 @@ using namespace xmltooling;
 using namespace std;
 
 namespace shibsp {
+    SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory AdminLogoutInitiatorFactory;
     SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory ChainingLogoutInitiatorFactory;
     SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SAML2LogoutInitiatorFactory;
     SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory LocalLogoutInitiatorFactory;
@@ -40,6 +41,7 @@ namespace shibsp {
 void SHIBSP_API shibsp::registerLogoutInitiators()
 {
     SPConfig& conf=SPConfig::getConfig();
+    conf.LogoutInitiatorManager.registerFactory(ADMIN_LOGOUT_INITIATOR, AdminLogoutInitiatorFactory);
     conf.LogoutInitiatorManager.registerFactory(CHAINING_LOGOUT_INITIATOR, ChainingLogoutInitiatorFactory);
     conf.LogoutInitiatorManager.registerFactory(SAML2_LOGOUT_INITIATOR, SAML2LogoutInitiatorFactory);
     conf.LogoutInitiatorManager.registerFactory(LOCAL_LOGOUT_INITIATOR, LocalLogoutInitiatorFactory);

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


More information about the commits mailing list