/usr/include/shibsp/SPRequest.h is in libshibsp-dev 2.5.3+dfsg-2+deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | /**
* Licensed to the University Corporation for Advanced Internet
* Development, Inc. (UCAID) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
/**
* @file shibsp/SPRequest.h
*
* Interface to server request being processed.
*/
#ifndef __shibsp_req_h__
#define __shibsp_req_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
*
* <p>To supply information from the surrounding web server environment,
* a shim must be supplied in the form of this interface to adapt the
* library to different proprietary server APIs.
*
* <p>This interface need not be threadsafe.
*/
class SHIBSP_API SPRequest : public virtual xmltooling::HTTPRequest, public virtual xmltooling::HTTPResponse
{
protected:
SPRequest();
public:
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& 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 nullptr
*/
virtual Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true)=0;
/**
* Returns the effective base Handler URL for a resource,
* or the current request URL.
*
* @param resource resource URL to compute handler for
* @return base location of handler
*/
virtual const char* getHandlerURL(const char* resource=nullptr) const=0;
/**
* Returns a non-spoofable request header value, if possible.
* Platforms that support environment export can redirect header
* lookups by overriding this method.
*
* @param name the name of the secure header to return
* @return the header's value, or an empty string
*/
virtual std::string getSecureHeader(const char* name) const;
/**
* Ensures no value exists for a request header.
*
* @param rawname raw name of header to clear
* @param cginame CGI-equivalent name of header
*/
virtual void clearHeader(const char* rawname, const char* cginame)=0;
/**
* Sets a value for a request header.
*
* @param name name of header to set
* @param value value to set
*/
virtual void setHeader(const char* name, const char* value)=0;
/**
* Establish REMOTE_USER identity in request.
*
* @param user REMOTE_USER value to set or nullptr to clear
*/
virtual void setRemoteUser(const char* user)=0;
/**
* Establish AUTH_TYPE for request.
*
* @param authtype AUTH_TYPE value to set or nullptr to clear
*/
virtual void setAuthType(const char* authtype);
/** Portable logging levels. */
enum SPLogLevel {
SPDebug,
SPInfo,
SPWarn,
SPError,
SPCrit
};
/**
* Log to native server environment.
*
* @param level logging level
* @param msg message to log
*/
virtual void log(SPLogLevel level, const std::string& msg) const=0;
/**
* Test logging level.
*
* @param level logging level
* @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;
};
};
#endif /* __shibsp_req_h__ */
|