Package repoze :: Package who :: Module interfaces :: Class IIdentifier
[hide private]

Class IIdentifier

source code


On ingress: Extract credentials from the WSGI environment and turn them into an identity.

On egress (remember): Conditionally set information in the response headers allowing the remote system to remember this identity.

On egress (forget): Conditionally set information in the response headers allowing the remote system to forget this identity (during a challenge).

Instance Methods [hide private]
 
identify(environ)
On ingress:
source code
 
remember(environ, identity)
On egress (no challenge required):
source code
 
forget(environ, identity)
On egress (challenge required):
source code
Class Variables [hide private]
  _InterfaceClass__attrs = {'forget': <zope.interface.interface....
  __bases__ = (<InterfaceClass repoze.who.interfaces.IPlugin>)
  __identifier__ = 'repoze.who.interfaces.IIdentifier'
  __iro__ = (<InterfaceClass repoze.who.interfaces.IIdentifier>,...
  __name__ = 'IIdentifier'
  __sro__ = (<InterfaceClass repoze.who.interfaces.IIdentifier>,...
  _implied = {<InterfaceClass repoze.who.interfaces.IIdentifier>...
  dependents = <WeakKeyDictionary at 27503432>

Inherited from zope.interface.Interface (private): _Element__tagged_values

Method Details [hide private]

identify(environ)

source code 
On ingress:

environ -> {   k1 : v1
               ,   ...
               , kN : vN
               } | None

o 'environ' is the WSGI environment.

o If credentials are found, the returned identity mapping will
  contain an arbitrary set of key/value pairs.  If the
  identity is based on a login and password, the environment
  is recommended to contain at least 'login' and 'password'
  keys as this provides compatibility between the plugin and
  existing authenticator plugins.  If the identity can be
  'preauthenticated' (e.g. if the userid is embedded in the
  identity, such as when we're using ticket-based
  authentication), the plugin should set the userid in the
  special 'repoze.who.userid' key; no authenticators will be
  asked to authenticate the identity thereafer.

o Return None to indicate that the plugin found no appropriate
  credentials.

o Only IIdentifier plugins which match one of the the current
  request's classifications will be asked to perform
  identification.

o An identifier plugin is permitted to add a key to the
  environment named 'repoze.who.application', which should be
  an arbitrary WSGI application.  If an identifier plugin does
  so, this application is used instead of the downstream
  application set up within the middleware.  This feature is
  useful for identifier plugins which need to perform
  redirection to obtain credentials.  If two identifier
  plugins add a 'repoze.who.application' WSGI application to
  the environment, the last one consulted will"win".

remember(environ, identity)

source code 

On egress (no challenge required):

args -> [ (header-name, header-value), ...] | None

Return a list of headers suitable for allowing the requesting system to remember the identification information (e.g. a Set-Cookie header). Return None if no headers need to be set. These headers will be appended to any headers returned by the downstream application.

forget(environ, identity)

source code 

On egress (challenge required):

args -> [ (header-name, header-value), ...] | None

Return a list of headers suitable for allowing the requesting system to forget the identification information (e.g. a Set-Cookie header with an expires date in the past). Return None if no headers need to be set. These headers will be included in the response provided by the challenge app.


Class Variable Details [hide private]

_InterfaceClass__attrs

Value:
{'forget': <zope.interface.interface.Method object at 0x1a3cd10>,
 'identify': <zope.interface.interface.Method object at 0x1a3cd50>,
 'remember': <zope.interface.interface.Method object at 0x1a3cd90>}

__iro__

Value:
(<InterfaceClass repoze.who.interfaces.IIdentifier>,
 <InterfaceClass repoze.who.interfaces.IPlugin>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass repoze.who.interfaces.IIdentifier>,
 <InterfaceClass repoze.who.interfaces.IPlugin>,
 <InterfaceClass zope.interface.Interface>)

_implied

Value:
{<InterfaceClass repoze.who.interfaces.IIdentifier>: (),
 <InterfaceClass repoze.who.interfaces.IPlugin>: (),
 <InterfaceClass zope.interface.Interface>: ()}