Draft artifact resolver.
[shibboleth/sp.git] / shibsp / handler / AbstractHandler.h
index bc17689..5e12fc1 100644 (file)
 #include <shibsp/util/DOMPropertySet.h>
 
 #include <log4cpp/Category.hh>
-#include <saml/binding/HTTPRequest.h>
-#include <saml/binding/HTTPResponse.h>
+#ifndef SHIBSP_LITE
+# include <saml/saml2/core/Protocols.h>
+#endif
 #include <xmltooling/XMLObject.h>
+#include <xmltooling/io/HTTPRequest.h>
+#include <xmltooling/io/HTTPResponse.h>
 
 namespace shibsp {
 
@@ -61,6 +64,7 @@ namespace shibsp {
             const std::map<std::string,std::string>* remapper=NULL
             );
 
+#ifndef SHIBSP_LITE
         /**
          * Examines a protocol response message for errors and raises an annotated exception
          * if an error is found.
@@ -70,7 +74,19 @@ namespace shibsp {
          * @param response      a response message of some known protocol
          */
         virtual void checkError(const xmltooling::XMLObject* response) const;
-        
+
+        /**
+         * Prepares Status information in a SAML 2.0 response.
+         * 
+         * @param response  a SAML 2.0 response message
+         * @param code      SAML status code
+         * @param ex        optional message to pass back
+         */
+        void prepareResponse(
+            opensaml::saml2p::StatusResponseType& response, const XMLCh* code, const XMLCh* subcode=NULL, const char* msg=NULL
+            ) const;
+#endif
+
         /**
          * Implements various mechanisms to preserve RelayState,
          * such as cookies or StorageService-backed keys.
@@ -82,7 +98,7 @@ namespace shibsp {
          * @param response      outgoing HTTP response
          * @param relayState    RelayState token to supply with message
          */
-        virtual void preserveRelayState(const Application& application, opensaml::HTTPResponse& response, std::string& relayState) const;
+        virtual void preserveRelayState(const Application& application, xmltooling::HTTPResponse& response, std::string& relayState) const;
 
         /**
          * Implements various mechanisms to recover RelayState,
@@ -97,12 +113,15 @@ namespace shibsp {
          * @param clear         true iff the token state should be cleared
          */
         virtual void recoverRelayState(
-            const Application& application, opensaml::HTTPRequest& request, std::string& relayState, bool clear=true
+            const Application& application, xmltooling::HTTPRequest& request, std::string& relayState, bool clear=true
             ) const;
         
         /** Logging object. */
         log4cpp::Category& m_log;
         
+        /** Configuration namespace for custom properties. */
+        xmltooling::auto_ptr_char m_configNS;
+
     public:
         virtual ~AbstractHandler() {}
     };