Package repoze :: Package who :: Package plugins :: Package ldap :: Module plugins :: Class LDAPAttributesPlugin
[hide private]

Class LDAPAttributesPlugin

source code


Loads LDAP attributes of the authenticated user.

Instance Methods [hide private]
 
__init__(self, ldap_connection, attributes=None, filterstr='(objectClass=*)', start_tls='', bind_dn='', bind_pass='')
Fetch LDAP attributes of the authenticated user.
source code
 
add_metadata(self, environ, identity)
Add metadata about the authenticated user to the identity.
source code
 
__providedBy__(...)
Object Specification Descriptor
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  dnrx = re.compile(r'<dn:(?P<b64dn>[A-Za-z0-9\+/]+=*)>')
  __implemented__ = <implementedBy repoze.who.plugins.ldap.plugi...
  __provides__ = <zope.interface.declarations.ClassProvides obje...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ldap_connection, attributes=None, filterstr='(objectClass=*)', start_tls='', bind_dn='', bind_pass='')
(Constructor)

source code 

Fetch LDAP attributes of the authenticated user.

@param ldap_connection: The LDAP connection to use to fetch this data.
@type ldap_connection: C{ldap.ldapobject.SimpleLDAPObject} or C{str}
@param attributes: The authenticated user's LDAP attributes you want to
    use in your application; an interable or a comma-separate list of
    attributes in a string, or C{None} to fetch them all.
@type attributes: C{iterable} or C{str}
@param filterstr: A filter for the search, as documented in U{RFC4515
    <http://www.faqs.org/rfcs/rfc4515.html>}; the results won't be
    filtered unless you define this.
@type filterstr: C{str}
@param start_tls: Should we negotiate a TLS upgrade on the connection with
    the directory server?
@type start_tls: C{str}
@param bind_dn: Operate as the bind_dn directory entry
@type bind_dn: C{str}
@param bind_pass: The password for bind_dn directory entry
@type bind_pass: C{str}
@raise ValueError: If L{make_ldap_connection} could not create a
    connection from C{ldap_connection}, or if C{attributes} is not an
    iterable.

The following parameters are inherited from 
L{LDAPBaseAuthenticatorPlugin.__init__}
@param base_dn: The base for the I{Distinguished Name}. Something like
    C{ou=employees,dc=example,dc=org}, to which will be prepended the
    user id: C{uid=jsmith,ou=employees,dc=example,dc=org}.
@param returned_id: Should we return full Directory Names or just the
    naming attribute value on successful authentication?
@param start_tls: Should we negotiate a TLS upgrade on the connection with
    the directory server?
@param bind_dn: Operate as the bind_dn directory entry
@param bind_pass: The password for bind_dn directory entry

Overrides: object.__init__

add_metadata(self, environ, identity)

source code 

Add metadata about the authenticated user to the identity.

It modifies the identity dictionary to add the metadata.

Parameters:
  • environ - The WSGI environment.
  • identity - The repoze.who's identity dictionary.

Class Variable Details [hide private]

__implemented__

Value:
<implementedBy repoze.who.plugins.ldap.plugins.LDAPAttributesPlugin>

__provides__

Value:
<zope.interface.declarations.ClassProvides object at 0x1e54910>