Fix backslashes in SHIBSP_PREFIX variable by manually creating it during the script...
[shibboleth/sp.git] / shibsp / SPRequest.h
index b57e2b3..97fadc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 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_req_h__
 #define __shibsp_req_h__
 
-#include <shibsp/base.h>
-#include <saml/binding/HTTPRequest.h>
-#include <saml/binding/HTTPResponse.h>
+#include <shibsp/RequestMapper.h>
+#include <xmltooling/io/HTTPRequest.h>
+#include <xmltooling/io/HTTPResponse.h>
 
 namespace shibsp {
     
     class SHIBSP_API Application;
+    class SHIBSP_API ServiceProvider;
+    class SHIBSP_API Session;
     
     /**
      * Interface to server request being processed
@@ -40,7 +42,7 @@ namespace shibsp {
      * 
      * <p>This interface need not be threadsafe.
      */
-    class SHIBSP_API SPRequest : public virtual opensaml::HTTPRequest, public virtual opensaml::HTTPResponse
+    class SHIBSP_API SPRequest : public virtual xmltooling::HTTPRequest, public virtual xmltooling::HTTPResponse
     {
     protected:
         SPRequest() {}
@@ -48,12 +50,37 @@ namespace shibsp {
         virtual ~SPRequest() {}
         
         /**
+         * Returns the locked ServiceProvider processing the request.
+         * 
+         * @return reference to ServiceProvider
+         */
+        virtual const ServiceProvider& getServiceProvider() const=0;
+
+        /**
+         * Returns RequestMapper Settings associated with the request, guaranteed
+         * to be valid for the request's duration.
+         * 
+         * @return copy of settings
+         */
+        virtual RequestMapper::Settings getRequestSettings() const=0;
+        
+        /**
          * Returns the Application governing the request.
          * 
          * @return reference to Application
          */
-        virtual const Application& getSPApplication() const=0;
-        
+        virtual const Application& getApplication() const=0;
+
+        /**
+         * Returns a locked Session associated with the request.
+         *
+         * @param checkTimeout  true iff the last-used timestamp should be updated and any timeout policy enforced
+         * @param ignoreAddress true iff all address checking should be ignored, regardless of policy
+         * @param cache         true iff the request should hold the Session lock itself and unlock during cleanup
+         * @return pointer to Session, or NULL
+         */
+        virtual Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true) const=0;
+
         /**
          * Returns the effective base Handler URL for a resource,
          * or the current request URL.
@@ -64,14 +91,6 @@ namespace shibsp {
         virtual const char* getHandlerURL(const char* resource=NULL) const=0;
 
         /**
-         * Get a cookie value supplied by the client.
-         * 
-         * @param name  name of cookie
-         * @return  cookie value or NULL
-         */
-        virtual const char* getCookie(const char* name) const=0;
-        
-        /**
          * Returns a non-spoofable request header value, if possible.
          * Platforms that support environment export can redirect header
          * lookups by overriding this method.
@@ -86,9 +105,10 @@ namespace shibsp {
         /**
          * Ensures no value exists for a request header.
          * 
-         * @param name  name of header to clear 
+         * @param rawname  raw name of header to clear
+         * @param cginame  CGI-equivalent name of header
          */
-        virtual void clearHeader(const char* name)=0;
+        virtual void clearHeader(const char* rawname, const char* cginame)=0;
 
         /**
          * Sets a value for a request header.
@@ -129,6 +149,20 @@ namespace shibsp {
          * @return true iff logging level is enabled
          */
         virtual bool isPriorityEnabled(SPLogLevel level) const=0;
+
+        /**
+         * Indicates that processing was declined, meaning no action is required during this phase of processing.
+         * 
+         * @return  a status code to pass back to the server-specific layer
+         */        
+        virtual long returnDecline()=0;
+
+        /**
+         * Indicates that processing was completed.
+         * 
+         * @return  a status code to pass back to the server-specific layer
+         */        
+        virtual long returnOK()=0;
     };
 };