#include <shibsp/SessionCache.h>
Public Member Functions | |
virtual void | insert (const Application &application, const xmltooling::HTTPRequest &httpRequest, xmltooling::HTTPResponse &httpResponse, time_t expires, const opensaml::saml2md::EntityDescriptor *issuer=nullptr, const XMLCh *protocol=nullptr, const opensaml::saml2::NameID *nameid=nullptr, const XMLCh *authn_instant=nullptr, const XMLCh *session_index=nullptr, const XMLCh *authncontext_class=nullptr, const XMLCh *authncontext_decl=nullptr, const std::vector< const opensaml::Assertion * > *tokens=nullptr, const std::vector< Attribute * > *attributes=nullptr)=0 |
virtual void | insert (std::string &sessionID, const Application &application, const xmltooling::HTTPRequest &httpRequest, xmltooling::HTTPResponse &httpResponse, time_t expires, const opensaml::saml2md::EntityDescriptor *issuer=nullptr, const XMLCh *protocol=nullptr, const opensaml::saml2::NameID *nameid=nullptr, const XMLCh *authn_instant=nullptr, const XMLCh *session_index=nullptr, const XMLCh *authncontext_class=nullptr, const XMLCh *authncontext_decl=nullptr, const std::vector< const opensaml::Assertion * > *tokens=nullptr, const std::vector< Attribute * > *attributes=nullptr) |
Inserts a new session into the cache and binds the session to the outgoing client response. | |
virtual bool | matches (const Application &application, const xmltooling::HTTPRequest &request, const opensaml::saml2md::EntityDescriptor *issuer, const opensaml::saml2::NameID &nameid, const std::set< std::string > *indexes)=0 |
Determines whether the Session bound to a client request matches a set of input criteria. | |
virtual void | test ()=0 |
Executes a test of the cache's general health. | |
virtual std::string | active (const Application &application, const xmltooling::HTTPRequest &request)=0 |
Returns the ID of the session bound to the specified client request, if possible. | |
virtual Session * | find (const Application &application, const xmltooling::HTTPRequest &request, const char *client_addr=nullptr, time_t *timeout=nullptr)=0 |
Locates an existing session bound to a request. | |
virtual Session * | find (const Application &application, xmltooling::HTTPRequest &request, const char *client_addr=nullptr, time_t *timeout=nullptr) |
Locates an existing session bound to a request. | |
virtual void | remove (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse *response=nullptr)=0 |
Deletes an existing session bound to a request. |
The cache abstracts a persistent (meaning across requests) cache of instances of the Session interface. Creation of new entries and entry lookup are confined to this interface to enable the implementation to remote and/or optimize calls by implementing custom versions of the Session interface as required.
virtual void shibsp::SessionCache::insert | ( | const Application & | application, | |
const xmltooling::HTTPRequest & | httpRequest, | |||
xmltooling::HTTPResponse & | httpResponse, | |||
time_t | expires, | |||
const opensaml::saml2md::EntityDescriptor * | issuer = nullptr , |
|||
const XMLCh * | protocol = nullptr , |
|||
const opensaml::saml2::NameID * | nameid = nullptr , |
|||
const XMLCh * | authn_instant = nullptr , |
|||
const XMLCh * | session_index = nullptr , |
|||
const XMLCh * | authncontext_class = nullptr , |
|||
const XMLCh * | authncontext_decl = nullptr , |
|||
const std::vector< const opensaml::Assertion * > * | tokens = nullptr , |
|||
const std::vector< Attribute * > * | attributes = nullptr | |||
) | [pure virtual] |
The SSO tokens and Attributes remain owned by the caller and are copied by the cache.
application | reference to Application that owns the Session | |
httpRequest | request that initiated session | |
httpResponse | current response to client | |
expires | expiration time of session | |
issuer | issuing metadata of assertion issuer, if known | |
protocol | protocol family used to initiate the session | |
nameid | principal identifier, normalized to SAML 2, if any | |
authn_instant | UTC timestamp of authentication at IdP, if known | |
session_index | index of session between principal and IdP, if any | |
authncontext_class | method/category of authentication event, if known | |
authncontext_decl | specifics of authentication event, if known | |
tokens | assertions to cache with session, if any | |
attributes | optional array of resolved Attributes to cache with session |
virtual void shibsp::SessionCache::insert | ( | std::string & | sessionID, | |
const Application & | application, | |||
const xmltooling::HTTPRequest & | httpRequest, | |||
xmltooling::HTTPResponse & | httpResponse, | |||
time_t | expires, | |||
const opensaml::saml2md::EntityDescriptor * | issuer = nullptr , |
|||
const XMLCh * | protocol = nullptr , |
|||
const opensaml::saml2::NameID * | nameid = nullptr , |
|||
const XMLCh * | authn_instant = nullptr , |
|||
const XMLCh * | session_index = nullptr , |
|||
const XMLCh * | authncontext_class = nullptr , |
|||
const XMLCh * | authncontext_decl = nullptr , |
|||
const std::vector< const opensaml::Assertion * > * | tokens = nullptr , |
|||
const std::vector< Attribute * > * | attributes = nullptr | |||
) | [virtual] |
Inserts a new session into the cache and binds the session to the outgoing client response.
The newly created session ID is placed into the first parameter.
The SSO tokens and Attributes remain owned by the caller and are copied by the cache.
sessionID | reference to string to capture newly inserted session ID | |
application | reference to Application that owns the Session | |
httpRequest | request that initiated session | |
httpResponse | current response to client | |
expires | expiration time of session | |
issuer | issuing metadata of assertion issuer, if known | |
protocol | protocol family used to initiate the session | |
nameid | principal identifier, normalized to SAML 2, if any | |
authn_instant | UTC timestamp of authentication at IdP, if known | |
session_index | index of session between principal and IdP, if any | |
authncontext_class | method/category of authentication event, if known | |
authncontext_decl | specifics of authentication event, if known | |
tokens | assertions to cache with session, if any | |
attributes | optional array of resolved Attributes to cache with session |
virtual bool shibsp::SessionCache::matches | ( | const Application & | application, | |
const xmltooling::HTTPRequest & | request, | |||
const opensaml::saml2md::EntityDescriptor * | issuer, | |||
const opensaml::saml2::NameID & | nameid, | |||
const std::set< std::string > * | indexes | |||
) | [pure virtual] |
Determines whether the Session bound to a client request matches a set of input criteria.
application | reference to Application that owns the Session | |
request | request in which to locate Session | |
issuer | required source of session(s) | |
nameid | required name identifier | |
indexes | session indexes |
virtual std::string shibsp::SessionCache::active | ( | const Application & | application, | |
const xmltooling::HTTPRequest & | request | |||
) | [pure virtual] |
Returns the ID of the session bound to the specified client request, if possible.
application | reference to Application that owns the Session | |
request | request from client containing session, or a reference to it |
virtual Session* shibsp::SessionCache::find | ( | const Application & | application, | |
const xmltooling::HTTPRequest & | request, | |||
const char * | client_addr = nullptr , |
|||
time_t * | timeout = nullptr | |||
) | [pure virtual] |
Locates an existing session bound to a request.
If the client address is supplied, then a check will be performed against the address recorded in the record.
application | reference to Application that owns the Session | |
request | request from client bound to session | |
client_addr | network address of client (if known) | |
timeout | inactivity timeout to enforce (0 for none, nullptr to bypass check/update of last access) |
virtual Session* shibsp::SessionCache::find | ( | const Application & | application, | |
xmltooling::HTTPRequest & | request, | |||
const char * | client_addr = nullptr , |
|||
time_t * | timeout = nullptr | |||
) | [virtual] |
Locates an existing session bound to a request.
If the client address is supplied, then a check will be performed against the address recorded in the record.
If a bound session is found to have expired, be invalid, etc., and if the request can be used to "clear" the session from subsequent client requests, then it may be cleared.
application | reference to Application that owns the Session | |
request | request from client bound to session | |
client_addr | network address of client (if known) | |
timeout | inactivity timeout to enforce (0 for none, nullptr to bypass check/update of last access) |
virtual void shibsp::SessionCache::remove | ( | const Application & | application, | |
const xmltooling::HTTPRequest & | request, | |||
xmltooling::HTTPResponse * | response = nullptr | |||
) | [pure virtual] |
Deletes an existing session bound to a request.
application | reference to Application that owns the Session | |
request | request from client containing session, or a reference to it | |
response | optional response to client enabling removal of session or reference |