shibboleth-3.0.4
shibsp::Handler Class Referenceabstract

Pluggable runtime functionality that implement protocols and services. More...

#include <shibsp/handler/Handler.h>

Inheritance diagram for shibsp::Handler:
Collaboration diagram for shibsp::Handler:

Public Member Functions

virtual const XMLCh * getProtocolFamily () const
 Returns an identifier for the protocol family associated with the handler, if any. More...
 
virtual std::pair< bool, long > run (SPRequest &request, bool isHandler=true) const =0
 Executes handler functionality as an incoming request. More...
 
virtual void generateMetadata (opensaml::saml2md::SPSSODescriptor &role, const char *handlerURL) const
 Generates and/or modifies metadata reflecting the Handler. More...
 
virtual const char * getType () const
 Returns the "type" of the Handler plugin. More...
 
virtual const char * getEventType () const
 Get the type of event, as input to error handling in response to errors raised by this handler. More...
 
- Public Member Functions inherited from shibsp::PropertySet
virtual const PropertySetgetParent () const =0
 Returns parent of this PropertySet, if any. More...
 
virtual void setParent (const PropertySet *parent)=0
 Establishes a "parent" PropertySet to supply inherited settings. More...
 
virtual std::pair< bool, bool > getBool (const char *name, const char *ns=nullptr) const =0
 Returns a boolean-valued property. More...
 
virtual std::pair< bool, const char * > getString (const char *name, const char *ns=nullptr) const =0
 Returns a string-valued property. More...
 
virtual std::pair< bool, const XMLCh * > getXMLString (const char *name, const char *ns=nullptr) const =0
 Returns a Unicode string-valued property. More...
 
virtual std::pair< bool, unsigned int > getUnsignedInt (const char *name, const char *ns=nullptr) const =0
 Returns an unsigned integer-valued property. More...
 
virtual std::pair< bool, int > getInt (const char *name, const char *ns=nullptr) const =0
 Returns an integer-valued property. More...
 
virtual const PropertySetgetPropertySet (const char *name, const char *ns=shibspconstants::ASCII_SHIBSPCONFIG_NS) const =0
 Returns a nested property set. More...
 
virtual const xercesc::DOMElement * getElement () const =0
 Returns a DOM element representing the property container, if any. More...
 

Protected Member Functions

virtual void log (SPRequest::SPLogLevel level, const std::string &msg) const
 Log using handler's specific logging object. More...
 
virtual void cleanRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response) const
 Prevents unused relay state from building up by cleaning old state from the client. More...
 
virtual void preserveRelayState (const Application &application, xmltooling::HTTPResponse &response, std::string &relayState) const
 Implements various mechanisms to preserve RelayState, such as cookies or StorageService-backed keys. More...
 
virtual void recoverRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, std::string &relayState, bool clear=true) const
 Implements various mechanisms to recover RelayState, such as cookies or StorageService-backed keys. More...
 

Detailed Description

Pluggable runtime functionality that implement protocols and services.

Member Function Documentation

◆ cleanRelayState()

virtual void shibsp::Handler::cleanRelayState ( const Application application,
const xmltooling::HTTPRequest &  request,
xmltooling::HTTPResponse &  response 
) const
protectedvirtual

Prevents unused relay state from building up by cleaning old state from the client.

Handlers that generate relay state should call this method as a house cleaning step.

Parameters
applicationthe associated Application
requestincoming HTTP request
responseoutgoing HTTP response

◆ generateMetadata()

virtual void shibsp::Handler::generateMetadata ( opensaml::saml2md::SPSSODescriptor &  role,
const char *  handlerURL 
) const
virtual

Generates and/or modifies metadata reflecting the Handler.

The default implementation does nothing.

Parameters
rolemetadata role to decorate
handlerURLbase location of handler's endpoint

Reimplemented in shibsp::AssertionConsumerService, and shibsp::SessionInitiator.

◆ getEventType()

virtual const char* shibsp::Handler::getEventType ( ) const
virtual

Get the type of event, as input to error handling in response to errors raised by this handler.

Returns
an event type for error handling

Reimplemented in shibsp::AssertionConsumerService, shibsp::SessionInitiator, and shibsp::LogoutHandler.

◆ getProtocolFamily()

virtual const XMLCh* shibsp::Handler::getProtocolFamily ( ) const
virtual

Returns an identifier for the protocol family associated with the handler, if any.

Returns
a protocol identifier, or nullptr

Reimplemented in shibsp::AssertionConsumerService.

◆ getType()

virtual const char* shibsp::Handler::getType ( ) const
virtual

Returns the "type" of the Handler plugin.

Returns
a Handler type

Reimplemented in shibsp::AssertionConsumerService, shibsp::SessionInitiator, and shibsp::LogoutInitiator.

◆ log()

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

Log using handler's specific logging object.

Parameters
levellogging level
msgmessage to log

Reimplemented in shibsp::AbstractHandler.

◆ preserveRelayState()

virtual void shibsp::Handler::preserveRelayState ( const Application application,
xmltooling::HTTPResponse &  response,
std::string &  relayState 
) const
protectedvirtual

Implements various mechanisms to preserve RelayState, such as cookies or StorageService-backed keys.

If a supported mechanism can be identified, the input parameter will be replaced with a suitable state key.

Parameters
applicationthe associated Application
responseoutgoing HTTP response
relayStateRelayState token to supply with message

◆ recoverRelayState()

virtual void shibsp::Handler::recoverRelayState ( const Application application,
const xmltooling::HTTPRequest &  request,
xmltooling::HTTPResponse &  response,
std::string &  relayState,
bool  clear = true 
) const
protectedvirtual

Implements various mechanisms to recover RelayState, such as cookies or StorageService-backed keys.

If a supported mechanism can be identified, the input parameter will be replaced with the recovered state information.

Parameters
applicationthe associated Application
requestincoming HTTP request
responseoutgoing HTTP response
relayStateRelayState token supplied with message
cleartrue iff the token state should be cleared

◆ run()

virtual std::pair<bool,long> shibsp::Handler::run ( SPRequest request,
bool  isHandler = true 
) const
pure virtual

Executes handler functionality as an incoming request.

Handlers can be run either directly by incoming web requests or indirectly/implicitly during other SP processing.

Parameters
requestSP request context
isHandlertrue iff executing in the context of a direct handler invocation
Returns
a pair containing a "request completed" indicator and a server-specific response code

Implemented in shibsp::SessionInitiator, shibsp::AssertionConsumerService, shibsp::SecuredHandler, and shibsp::LogoutHandler.


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