Skip to content

Is 'bind' and 'passwd' mandatory? #19

@fklemme

Description

@fklemme

According to the documentation, ldap_setup doesn't seem to need values for bindand passwd. But if you leave them None (as they are by default) you will end up with an AttributeError within ldappool.

2015-06-12 14:52:10,165 ERROR [phoenix.views][MainThread] unknown failure
Traceback (most recent call last):
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/config/views.py", line 329, in attr_view
    return view(context, request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/config/views.py", line 305, in predicate_wrapper
    return view(context, request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/config/views.py", line 245, in _secured_view
    return view(context, request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/config/views.py", line 385, in viewresult_to_response
    result = view(context, request)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid-1.5.7-py2.7.egg/pyramid/config/views.py", line 477, in _class_requestonly_view
    response = getattr(inst, attr)()
  File "/home/fklemme/Repositories/pyramid-phoenix/phoenix/views/account.py", line 177, in ldap
    auth = connector.authenticate(username, password)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/pyramid_ldap-0.1-py2.7.egg/pyramid_ldap/__init__.py", line 111, in authenticate
    with self.manager.connection() as conn:
  File "/home/fklemme/.conda/envs/birdhouse/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/ldappool-1.0-py2.7.egg/ldappool/__init__.py", line 291, in connection
    conn = self._get_connection(bind, passwd)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/ldappool-1.0-py2.7.egg/ldappool/__init__.py", line 235, in _get_connection
    conn = self._match(bind, passwd)
  File "/home/fklemme/Repositories/pyramid-phoenix/eggs/ldappool-1.0-py2.7.egg/ldappool/__init__.py", line 142, in _match
    passwd = passwd.encode('utf8')
AttributeError: 'NoneType' object has no attribute 'encode'

If bindand passwd are mandatory, should we remove these misleading default values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions