2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file shibsp/AbstractSPRequest.h
24 * Abstract base for SPRequest implementations.
27 #ifndef __shibsp_abstreq_h__
28 #define __shibsp_abstreq_h__
30 #include <shibsp/SPRequest.h>
34 class SHIBSP_API CGIParser;
36 #if defined (_MSC_VER)
37 #pragma warning( push )
38 #pragma warning( disable : 4251 )
42 * Abstract base for SPRequest implementations
44 class SHIBSP_API AbstractSPRequest : public virtual SPRequest
50 * @param category logging category to use
52 AbstractSPRequest(const char* category);
55 * Stores a normalized request URI to ensure it contains no %-encoded characters
56 * or other undesirable artifacts.
58 * @param uri the request URI as obtained from the client
60 void setRequestURI(const char* uri);
63 virtual ~AbstractSPRequest();
65 // Virtual function overrides.
66 const ServiceProvider& getServiceProvider() const;
67 RequestMapper::Settings getRequestSettings() const;
68 const Application& getApplication() const;
69 Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true);
70 const char* getRequestURI() const;
71 const char* getRequestURL() const;
72 std::string getRemoteAddr() const;
73 const char* getParameter(const char* name) const;
74 std::vector<const char*>::size_type getParameters(const char* name, std::vector<const char*>& values) const;
75 const char* getHandlerURL(const char* resource=nullptr) const;
76 void log(SPLogLevel level, const std::string& msg) const;
77 bool isPriorityEnabled(SPLogLevel level) const;
80 ServiceProvider* m_sp;
81 mutable RequestMapper* m_mapper;
82 mutable RequestMapper::Settings m_settings;
83 mutable const Application* m_app;
84 mutable bool m_sessionTried;
85 mutable Session* m_session;
87 mutable std::string m_url;
88 void* m_log; // declared void* to avoid log4cpp header conflicts in Apache
89 mutable std::string m_handlerURL;
90 mutable CGIParser* m_parser;
93 #if defined (_MSC_VER)
94 #pragma warning( pop )
99 #endif /* __shibsp_abstreq_h__ */