Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Mark pyldap as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tpazderka authored and andrewkrug committed Jun 6, 2019
1 parent aad7aae commit de75583
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The format is based on the [KeepAChangeLog] project.

### Changed
- [#134] ``l_registration_enpoint`` has been deprecated, use ``create_registration`` instead
- [#457] pyldap is now an optional dependency. ``oic.utils.authn.ldapc`` and ``oic.utils.userinfo.ldap_info`` raise
``ImportError`` on import if ``pyldap`` is not present

### Fixed
- [#430] Audience of a client assertion is endpoint dependent.
Expand All @@ -31,6 +33,7 @@ The format is based on the [KeepAChangeLog] project.
[#446]: https://github.com/OpenIDC/pyoidc/issues/446
[#449]: https://github.com/OpenIDC/pyoidc/issues/449
[#134]: https://github.com/OpenIDC/pyoidc/issues/134
[#457]: https://github.com/OpenIDC/pyoidc/issues/457

## 0.12.0 [2017-09-25]

Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cryptography = "*"
future = "*"
pyOpenSSL = "*"
pyjwkest = "*"
pyldap = "*"
requests = "*"
Beaker = "*"
Mako = "*"
6 changes: 0 additions & 6 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def run_tests(self):
'testing': tests_requires,
'docs': ['Sphinx', 'sphinx-autobuild'],
'quality': ['pylama', 'isort'],
'ldap_authn': ['pyldap'],
},
install_requires=[
"requests",
Expand Down
5 changes: 4 additions & 1 deletion src/oic/utils/authn/ldapc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import ldap
try:
import ldap
except ImportError:
raise ImportError('This module can be used only with pyldap installed.')

from oic.exception import PyoidcError
from oic.utils.authn.user import UsernamePasswordMako
Expand Down
7 changes: 5 additions & 2 deletions src/oic/utils/userinfo/ldap_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import logging
try:
import ldap
except ImportError:
raise ImportError('This module can be used only with pyldap installed.')

import ldap
import logging

from oic.utils.sanitize import sanitize
from oic.utils.userinfo import UserInfo
Expand Down

0 comments on commit de75583

Please sign in to comment.