shibboleth-2.6.1
shibsp::ServiceProvider Class Referenceabstract

Interface to a Shibboleth ServiceProvider instance. More...

#include <shibsp/ServiceProvider.h>

Inheritance diagram for shibsp::ServiceProvider:
shibsp::PropertySet

Public Member Functions

virtual void init ()=0
 Loads a configuration and prepares the instance for use. More...
 
virtual TransactionLoggetTransactionLog () const =0
 Returns a TransactionLog instance. More...
 
virtual xmltooling::StorageService * getStorageService (const char *id) const =0
 Returns a StorageService instance based on an ID. More...
 
virtual SessionCachegetSessionCache (bool required=true) const =0
 Returns a SessionCache instance. More...
 
virtual ListenerServicegetListenerService (bool required=true) const =0
 Returns a ListenerService instance. More...
 
virtual SecurityPolicyProvidergetSecurityPolicyProvider (bool required=true) const
 Returns a SecurityPolicyProvider instance. More...
 
virtual const PropertySetgetPolicySettings (const char *id) const =0
 
virtual const std::vector< const opensaml::SecurityPolicyRule * > & getPolicyRules (const char *id) const =0
 
virtual bool setTransportOptions (xmltooling::SOAPTransport &transport) const =0
 Sets implementation-specific transport options. More...
 
virtual RequestMappergetRequestMapper (bool required=true) const =0
 Returns a RequestMapper instance. More...
 
virtual const ApplicationgetApplication (const char *applicationId) const =0
 Returns an Application instance matching the specified ID. More...
 
virtual std::pair< bool, long > doAuthentication (SPRequest &request, bool handler=false) const
 Enforces requirements for an authenticated session. More...
 
virtual std::pair< bool, long > doAuthorization (SPRequest &request) const
 Enforces authorization requirements based on the authenticated session. More...
 
virtual std::pair< bool, long > doExport (SPRequest &request, bool requireSession=true) const
 Publishes session contents to the request in the form of headers or environment variables. More...
 
virtual std::pair< bool, long > doHandler (SPRequest &request) const
 Services requests for registered Handler locations. More...
 
virtual RemotedregListener (const char *address, Remoted *svc)
 Register for a message. More...
 
virtual bool unregListener (const char *address, Remoted *current, Remoted *restore=nullptr)
 Unregisters service from an address, possibly restoring an original. More...
 
virtual RemotedlookupListener (const char *address) const
 Returns current service registered at an address, if any. 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 void getAll (std::map< std::string, const char *> &properties) const =0
 Returns a map of all known properties in string form. More...
 
virtual const PropertySetgetPropertySet (const char *name, const char *ns=shibspconstants::ASCII_SHIB2SPCONFIG_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 Attributes

std::set< std::string > m_authTypes
 The AuthTypes to "recognize" (defaults to "shibboleth"). More...
 

Detailed Description

Interface to a Shibboleth ServiceProvider instance.

A ServiceProvider exposes configuration and infrastructure services required by the SP implementation, allowing a flexible configuration format.

Member Function Documentation

◆ doAuthentication()

virtual std::pair<bool,long> shibsp::ServiceProvider::doAuthentication ( SPRequest request,
bool  handler = false 
) const
virtual

Enforces requirements for an authenticated session.

If the return value's first member is true, then request processing should terminate with the second member as a status value. If false, processing can continue.

Parameters
requestSP request interface
handlertrue iff a request to a registered Handler location can be directly executed
Returns
a pair containing a "request completed" indicator and a server-specific response code

◆ doAuthorization()

virtual std::pair<bool,long> shibsp::ServiceProvider::doAuthorization ( SPRequest request) const
virtual

Enforces authorization requirements based on the authenticated session.

If the return value's first member is true, then request processing should terminate with the second member as a status value. If false, processing can continue.

Parameters
requestSP request interface
Returns
a pair containing a "request completed" indicator and a server-specific response code

◆ doExport()

virtual std::pair<bool,long> shibsp::ServiceProvider::doExport ( SPRequest request,
bool  requireSession = true 
) const
virtual

Publishes session contents to the request in the form of headers or environment variables.

If the return value's first member is true, then request processing should terminate with the second member as a status value. If false, processing can continue.

Parameters
requestSP request interface
requireSessionset to true iff an error should result if no session exists
Returns
a pair containing a "request completed" indicator and a server-specific response code

◆ doHandler()

virtual std::pair<bool,long> shibsp::ServiceProvider::doHandler ( SPRequest request) const
virtual

Services requests for registered Handler locations.

If the return value's first member is true, then request processing should terminate with the second member as a status value. If false, processing can continue.

Parameters
requestSP request interface
Returns
a pair containing a "request completed" indicator and a server-specific response code

◆ getApplication()

virtual const Application* shibsp::ServiceProvider::getApplication ( const char *  applicationId) const
pure virtual

Returns an Application instance matching the specified ID.

Parameters
applicationIdthe ID of the application, or nullptr for the default
Returns
pointer to the application, or nullptr

◆ getListenerService()

virtual ListenerService* shibsp::ServiceProvider::getListenerService ( bool  required = true) const
pure virtual

Returns a ListenerService instance.

Parameters
requiredtrue iff an exception should be thrown if no ListenerService is available
Returns
a ListenerService

◆ getPolicyRules()

virtual const std::vector<const opensaml::SecurityPolicyRule*>& shibsp::ServiceProvider::getPolicyRules ( const char *  id) const
pure virtual
Deprecated:
Returns the security policy rules for an identified policy.
Parameters
ididentifies the policy to return, or nullptr for default
Returns
an array of policy rules

◆ getPolicySettings()

virtual const PropertySet* shibsp::ServiceProvider::getPolicySettings ( const char *  id) const
pure virtual
Deprecated:
Returns the security policy settings for an identified policy.
Parameters
ididentifies the policy to return, or nullptr for default
Returns
a PropertySet

◆ getRequestMapper()

virtual RequestMapper* shibsp::ServiceProvider::getRequestMapper ( bool  required = true) const
pure virtual

Returns a RequestMapper instance.

Parameters
requiredtrue iff an exception should be thrown if no RequestMapper is available
Returns
a RequestMapper

◆ getSecurityPolicyProvider()

virtual SecurityPolicyProvider* shibsp::ServiceProvider::getSecurityPolicyProvider ( bool  required = true) const
virtual

Returns a SecurityPolicyProvider instance.

Parameters
requiredtrue iff an exception should be thrown if no SecurityPolicyProvider is available
Returns
a SecurityPolicyProvider

◆ getSessionCache()

virtual SessionCache* shibsp::ServiceProvider::getSessionCache ( bool  required = true) const
pure virtual

Returns a SessionCache instance.

Parameters
requiredtrue iff an exception should be thrown if no SessionCache is available
Returns
a SessionCache

◆ getStorageService()

virtual xmltooling::StorageService* shibsp::ServiceProvider::getStorageService ( const char *  id) const
pure virtual

Returns a StorageService instance based on an ID.

Parameters
ida nullptr-terminated key identifying the StorageService to the configuration
Returns
a StorageService if available, or nullptr

◆ getTransactionLog()

virtual TransactionLog* shibsp::ServiceProvider::getTransactionLog ( ) const
pure virtual

Returns a TransactionLog instance.

Returns
a TransactionLog instance

◆ init()

virtual void shibsp::ServiceProvider::init ( )
pure virtual

Loads a configuration and prepares the instance for use.

Implemented as a separate method so that services can rely on other services while they initialize by accessing the ServiceProvider from the SPConfig singleton.

◆ lookupListener()

virtual Remoted* shibsp::ServiceProvider::lookupListener ( const char *  address) const
virtual

Returns current service registered at an address, if any.

Parameters
addressmessage address to access
Returns
registered service, or nullptr

◆ regListener()

virtual Remoted* shibsp::ServiceProvider::regListener ( const char *  address,
Remoted svc 
)
virtual

Register for a message.

Returns existing remote service, allowing message hooking.

Parameters
addressmessage address to register
svcpointer to remote service
Returns
previous service registered for message, if any

◆ setTransportOptions()

virtual bool shibsp::ServiceProvider::setTransportOptions ( xmltooling::SOAPTransport &  transport) const
pure virtual

Sets implementation-specific transport options.

Parameters
transporta SOAPTransport object
Returns
true iff all options were successfully set

◆ unregListener()

virtual bool shibsp::ServiceProvider::unregListener ( const char *  address,
Remoted current,
Remoted restore = nullptr 
)
virtual

Unregisters service from an address, possibly restoring an original.

Parameters
addressmessage address to modify
currentpointer to unregistering service
restoreservice to "restore" registration for
Returns
true iff the current service was still registered

Member Data Documentation

◆ m_authTypes

std::set<std::string> shibsp::ServiceProvider::m_authTypes
protected

The AuthTypes to "recognize" (defaults to "shibboleth").


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