shibboleth-3.4.1
shibsp::SPRequest Class Referenceabstract

Interface to server request being processed. More...

#include <shibsp/SPRequest.h>

Inheritance diagram for shibsp::SPRequest:
Collaboration diagram for shibsp::SPRequest:

Public Types

enum  SPLogLevel {
  SPDebug , SPInfo , SPWarn , SPError ,
  SPCrit
}
 Portable logging levels.
 

Public Member Functions

virtual const ServiceProvidergetServiceProvider () const =0
 Returns the locked ServiceProvider processing the request.
 
virtual RequestMapper::Settings getRequestSettings () const =0
 Returns RequestMapper Settings associated with the request, guaranteed to be valid for the request's duration.
 
virtual const ApplicationgetApplication () const =0
 Returns the Application governing the request.
 
virtual SessiongetSession (bool checkTimeout=true, bool ignoreAddress=false, bool cache=true)=0
 Returns a locked Session associated with the request.
 
virtual const char * getHandlerURL (const char *resource=nullptr) const =0
 Returns the effective base Handler URL for a resource, or the current request URL.
 
virtual std::string getSecureHeader (const char *name) const =0
 Returns a non-spoofable request header value, if possible.
 
virtual void clearHeader (const char *rawname, const char *cginame)=0
 Ensures no value exists for a request header.
 
virtual void setHeader (const char *name, const char *value)=0
 Sets a value for a request header.
 
virtual void setRemoteUser (const char *user)=0
 Establish REMOTE_USER identity in request.
 
virtual void setAuthType (const char *authtype)=0
 Establish AUTH_TYPE for request.
 
virtual void log (SPLogLevel level, const std::string &msg) const =0
 Log to native server environment.
 
virtual bool isPriorityEnabled (SPLogLevel level) const =0
 Test logging level.
 
virtual long returnDecline ()=0
 Indicates that processing was declined, meaning no action is required during this phase of processing.
 
virtual long returnOK ()=0
 Indicates that processing was completed.
 

Detailed Description

Interface to server request being processed.

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.

This interface need not be threadsafe.

Member Function Documentation

◆ clearHeader()

virtual void shibsp::SPRequest::clearHeader ( const char *  rawname,
const char *  cginame 
)
pure virtual

Ensures no value exists for a request header.

Parameters
rawnameraw name of header to clear
cginameCGI-equivalent name of header

◆ getApplication()

virtual const Application & shibsp::SPRequest::getApplication ( ) const
pure virtual

Returns the Application governing the request.

Returns
reference to Application

Implemented in shibsp::AbstractSPRequest.

◆ getHandlerURL()

virtual const char * shibsp::SPRequest::getHandlerURL ( const char *  resource = nullptr) const
pure virtual

Returns the effective base Handler URL for a resource, or the current request URL.

Parameters
resourceresource URL to compute handler for
Returns
base location of handler

Implemented in shibsp::AbstractSPRequest.

◆ getRequestSettings()

virtual RequestMapper::Settings shibsp::SPRequest::getRequestSettings ( ) const
pure virtual

Returns RequestMapper Settings associated with the request, guaranteed to be valid for the request's duration.

Returns
copy of settings

Implemented in shibsp::AbstractSPRequest.

◆ getSecureHeader()

virtual std::string shibsp::SPRequest::getSecureHeader ( const char *  name) const
pure virtual

Returns a non-spoofable request header value, if possible.

Platforms that support environment export can redirect header lookups by overriding this method.

Parameters
namethe name of the secure header to return
Returns
the header's value, or an empty string

Implemented in shibsp::AbstractSPRequest.

◆ getServiceProvider()

virtual const ServiceProvider & shibsp::SPRequest::getServiceProvider ( ) const
pure virtual

Returns the locked ServiceProvider processing the request.

Returns
reference to ServiceProvider

Implemented in shibsp::AbstractSPRequest.

◆ getSession()

virtual Session * shibsp::SPRequest::getSession ( bool  checkTimeout = true,
bool  ignoreAddress = false,
bool  cache = true 
)
pure virtual

Returns a locked Session associated with the request.

Parameters
checkTimeouttrue iff the last-used timestamp should be updated and any timeout policy enforced
ignoreAddresstrue iff all address checking should be ignored, regardless of policy
cachetrue iff the request should hold the Session lock itself and unlock during cleanup
Returns
pointer to Session, or nullptr

Implemented in shibsp::AbstractSPRequest.

◆ isPriorityEnabled()

virtual bool shibsp::SPRequest::isPriorityEnabled ( SPLogLevel  level) const
pure virtual

Test logging level.

Parameters
levellogging level
Returns
true iff logging level is enabled

Implemented in shibsp::AbstractSPRequest.

◆ log()

virtual void shibsp::SPRequest::log ( SPLogLevel  level,
const std::string &  msg 
) const
pure virtual

Log to native server environment.

Parameters
levellogging level
msgmessage to log

Implemented in shibsp::AbstractSPRequest.

◆ returnDecline()

virtual long shibsp::SPRequest::returnDecline ( )
pure virtual

Indicates that processing was declined, meaning no action is required during this phase of processing.

Returns
a status code to pass back to the server-specific layer

◆ returnOK()

virtual long shibsp::SPRequest::returnOK ( )
pure virtual

Indicates that processing was completed.

Returns
a status code to pass back to the server-specific layer

◆ setAuthType()

virtual void shibsp::SPRequest::setAuthType ( const char *  authtype)
pure virtual

Establish AUTH_TYPE for request.

Parameters
authtypeAUTH_TYPE value to set or nullptr to clear

Implemented in shibsp::AbstractSPRequest.

◆ setHeader()

virtual void shibsp::SPRequest::setHeader ( const char *  name,
const char *  value 
)
pure virtual

Sets a value for a request header.

Parameters
namename of header to set
valuevalue to set

◆ setRemoteUser()

virtual void shibsp::SPRequest::setRemoteUser ( const char *  user)
pure virtual

Establish REMOTE_USER identity in request.

Parameters
userREMOTE_USER value to set or nullptr to clear

The documentation for this class was generated from the following file: