First cut at logout race detection in cache.
[shibboleth/sp.git] / shibsp / handler / LogoutHandler.h
index 1c97ba3..8c79666 100644 (file)
 
 namespace shibsp {
 
+#if defined (_MSC_VER)
+    #pragma warning( push )
+    #pragma warning( disable : 4251 )
+#endif
+
     /**
      * Base class for logout-related handlers.
      */
     class SHIBSP_API LogoutHandler : public RemotedHandler
     {
-    protected:
-        LogoutHandler() {}
-
     public:
         virtual ~LogoutHandler() {}
 
@@ -67,25 +69,28 @@ namespace shibsp {
         void receive(DDF& in, std::ostream& out);
 
     protected:
+        LogoutHandler() : m_initiator(true) {}
+        
+        /** Flag indicating whether the subclass is acting as a LogoutInitiator. */
+        bool m_initiator;
+
+        /** Array of query string parameters to preserve across front-channel notifications, if present. */
+        std::vector<std::string> m_preserve;
+
         /**
          * Perform front-channel logout notifications for an Application.
          *
-         * If no sessions are supplied directly, the request object's "sessions" query string
-         * parameter will be used.
-         *
          * @param application   the Application to notify
          * @param request       last request from browser
          * @param response      response to use for next notification
-         * @param params        map of query string parameters to preserve across notifications, optionally with initial values
-         * @param sessions      optional array of session keys being logged out
+         * @param params        map of query string parameters to preserve across this notification
          * @return  indicator of a completed response along with the status code to return from the handler
          */
         std::pair<bool,long> notifyFrontChannel(
             const Application& application,
             const xmltooling::HTTPRequest& request,
             xmltooling::HTTPResponse& response,
-            const std::map<std::string,std::string>* params=NULL,
-            const std::vector<std::string>* sessions=NULL
+            const std::map<std::string,std::string>* params=NULL
             ) const;
 
         /**
@@ -104,12 +109,29 @@ namespace shibsp {
          * Perform back-channel logout notifications for an Application.
          *
          * @param application   the Application to notify
+         * @param requestURL    requestURL that resulted in method call
          * @param sessions      array of session keys being logged out
+         * @param local         true iff the logout operation is local to the SP, false iff global
          * @return  true iff all notifications succeeded
          */
-        bool notifyBackChannel(const Application& application, const std::vector<std::string>& sessions) const;
+        bool notifyBackChannel(
+            const Application& application, const char* requestURL, const std::vector<std::string>& sessions, bool local
+            ) const;
     };
 
+#if defined (_MSC_VER)
+    #pragma warning( pop )
+#endif
+
+    /** LogoutInitiator that iterates through a set of protocol-specific versions. */
+    #define CHAINING_LOGOUT_INITIATOR "Chaining"
+
+    /** LogoutInitiator that supports SAML 2.0 LogoutRequests. */
+    #define SAML2_LOGOUT_INITIATOR "SAML2"
+
+    /** LogoutInitiator that supports local-only logout. */
+    #define LOCAL_LOGOUT_INITIATOR "Local"
+
 };
 
 #endif /* __shibsp_logout_h__ */