Fix backslashes in SHIBSP_PREFIX variable by manually creating it during the script...
[shibboleth/sp.git] / shibsp / RequestMapper.h
1 /*
2  *  Copyright 2001-2007 Internet2
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file shibsp/RequestMapper.h
19  * 
20  * Interface to a request mapping plugin
21  */
22
23 #ifndef __shibsp_reqmap_h__
24 #define __shibsp_reqmap_h__
25
26 #include <shibsp/base.h>
27 #include <xmltooling/Lockable.h>
28 #include <xmltooling/io/HTTPRequest.h>
29
30 namespace shibsp {
31
32     class SHIBSP_API AccessControl;
33     class SHIBSP_API PropertySet;
34
35     /**
36      * Interface to a request mapping plugin
37      * 
38      * Request mapping plugins return configuration settings that apply to resource requests.
39      * They can be implemented through cross-platform or platform-specific mechanisms.
40      */
41     class SHIBSP_API RequestMapper : public virtual xmltooling::Lockable
42     {
43         MAKE_NONCOPYABLE(RequestMapper);
44     protected:
45         RequestMapper() {}
46     public:
47         virtual ~RequestMapper() {}
48
49         /** Combination of configuration settings and effective access control. */
50         typedef std::pair<const PropertySet*,AccessControl*> Settings;
51
52         /**
53          * Map request to settings.
54          * 
55          * @param request   SP request
56          * @return configuration settings and effective AccessControl plugin, if any
57          */        
58         virtual Settings getSettings(const xmltooling::HTTPRequest& request) const=0;
59     };
60
61     /**
62      * Registers RequestMapper classes into the runtime.
63      */
64     void SHIBSP_API registerRequestMappers();
65
66     /** XML-based RequestMapper implementation. */
67     #define XML_REQUEST_MAPPER      "XML"
68
69     /** Hybrid of XML and platform-specific configuration. */
70     #define NATIVE_REQUEST_MAPPER   "Native"
71 };
72
73 #endif /* __shibsp_reqmap_h__ */