class documentation

class MemorySessionStore: (source)

Implements interfaces: klein.interfaces.ISessionStore

View In Hierarchy

Undocumented

Class Method fromAuthorizers Create a MemorySessionStore from a collection of callbacks which can do authorization.
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.
Method _storage Return the storage appropriate to the isConfidential flag.
Instance Variable _insecureStorage Undocumented
Instance Variable _secureStorage Undocumented
@classmethod
def fromAuthorizers(cls, authorizers): (source)

Create a MemorySessionStore from a collection of callbacks which can do authorization.

Parameters
authorizers:Iterable[_MemoryAuthorizerFunction]Undocumented
Returns
MemorySessionStoreUndocumented
def loadSession(self, 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(self, 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(self, tokens): (source)

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

Parameters
tokens:Iterable[str]Undocumented
def _storage(self, isConfidential): (source)

Return the storage appropriate to the isConfidential flag.

Parameters
isConfidential:boolUndocumented
Returns
Dict[str, Any]Undocumented
_insecureStorage: Dict[str, Any] = (source)

Undocumented

_secureStorage: Dict[str, Any] = (source)

Undocumented