2 * Copyright 2001-2007 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file shibsp/RequestMapper.h
20 * Interface to a request mapping plugin
23 #ifndef __shibsp_reqmap_h__
24 #define __shibsp_reqmap_h__
26 #include <shibsp/base.h>
27 #include <xmltooling/Lockable.h>
28 #include <xmltooling/io/HTTPRequest.h>
32 class SHIBSP_API AccessControl;
33 class SHIBSP_API PropertySet;
36 * Interface to a request mapping plugin
38 * Request mapping plugins return configuration settings that apply to resource requests.
39 * They can be implemented through cross-platform or platform-specific mechanisms.
41 class SHIBSP_API RequestMapper : public virtual xmltooling::Lockable
43 MAKE_NONCOPYABLE(RequestMapper);
47 virtual ~RequestMapper() {}
49 /** Combination of configuration settings and effective access control. */
50 typedef std::pair<const PropertySet*,AccessControl*> Settings;
53 * Map request to settings.
55 * @param request SP request
56 * @return configuration settings and effective AccessControl plugin, if any
58 virtual Settings getSettings(const xmltooling::HTTPRequest& request) const=0;
62 * Registers RequestMapper classes into the runtime.
64 void SHIBSP_API registerRequestMappers();
66 /** XML-based RequestMapper implementation. */
67 #define XML_REQUEST_MAPPER "XML"
69 /** Hybrid of XML and platform-specific configuration. */
70 #define NATIVE_REQUEST_MAPPER "Native"
73 #endif /* __shibsp_reqmap_h__ */