Imported Upstream version 2.4+dfsg
[shibboleth/sp.git] / shibsp / handler / RemotedHandler.h
index 37c6e53..ef1a25c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #ifndef __shibsp_remhandler_h__
 #define __shibsp_remhandler_h__
 
-#include <shibsp/SPRequest.h>
 #include <shibsp/handler/Handler.h>
 #include <shibsp/remoting/ListenerService.h>
 
+#include <set>
+
+namespace xmltooling {
+    class XMLTOOL_API HTTPRequest;
+    class XMLTOOL_API HTTPResponse;
+};
+
 namespace shibsp {
 
     /**
@@ -34,11 +40,20 @@ namespace shibsp {
      */
     class SHIBSP_API RemotedHandler : public virtual Handler, public Remoted 
     {
+        static std::set<std::string> m_remotedHeaders;
+
     public:
         virtual ~RemotedHandler();
 
+        /**
+         * Ensures that a request header will be remoted.
+         *
+         * @param header    name of request header to remote
+         */
+        static void addRemotedHeader(const char* header);
+
     protected:
-        RemotedHandler() {}
+        RemotedHandler();
 
         /**
          * Establishes message remoting using the supplied address.
@@ -52,11 +67,11 @@ namespace shibsp {
          * to remote the request information.
          *
          * @param request   an SPRequest to remote
-         * @param headers   array of request headers to copy to remote request
+         * @param headers   array of additional request headers to copy to remote request
          * @param certs     true iff client certificates should be available for the remote request
          * @return  the input dataflow object
          */
-        DDF wrap(const SPRequest& request, const std::vector<std::string>* headers=NULL, bool certs=false) const;
+        DDF wrap(const SPRequest& request, const std::vector<std::string>* headers=nullptr, bool certs=false) const;
         
         /**
          * Unwraps a response by examining an incoming data flow to determine