interface documentation

class ISessionStore(Interface): (source)

Known implementations: klein.storage.memory.MemorySessionStore

View In Hierarchy

Backing storage for sessions.

Method loadSession Load a session given the given identifier and security properties.
Method newSession Create a new ISession.
Method sentInsecurely The transport layer has detected that the given identifiers have been sent over an unauthenticated transport.
def loadSession(identifier, isConfidential, authenticatedBy): (source)

Load a session given the given identifier and security properties.

As an optimization for session stores where the back-end can generate session identifiers when the presented one is not found in the same round-trip to a data store, this method may return a Session object with an identifier attribute that does not match identifier. However, please keep in mind when implementing ISessionStore that this behavior is only necessary for requests where authenticatedBy is SessionMechanism.Cookie; an unauthenticated SessionMechanism.Header session is from an API client and its session should be valid already.

Parameters
identifier:strUndocumented
isConfidential:boolUndocumented
authenticatedBy:SessionMechanismUndocumented
Returns
Deferred firing with ISession or failing with NoSuchSession.an existing session with the given identifier.
def newSession(isConfidential, authenticatedBy): (source)

Create a new ISession.

Parameters
isConfidential:boolUndocumented
authenticatedBy:SessionMechanismUndocumented
Returns
Deferred firing with ISession.a new session with a new identifier.
def sentInsecurely(identifiers): (source)

The transport layer has detected that the given identifiers have been sent over an unauthenticated transport.

Parameters
identifiers:Sequence[str]Undocumented