Skip to content

Commit

Permalink
Merge pull request #7 from Kinto/add-plugin-version
Browse files Browse the repository at this point in the history
Add kinto-ldap plugin version in the capability.
  • Loading branch information
Natim committed Jul 27, 2016
2 parents bc0d615 + 1a31147 commit 5a50308
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This document describes changes between each past release.
------------------

- Set default value for ``multiauth.policy.ldap.use`` (fixes #3)
- Add the plugin version in the capability.


0.1.0 (2016-06-27)
Expand Down
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
VIRTUALENV = virtualenv
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON = $(VENV)/bin/python
TOX = $(VENV)/bin/tox
TEMPDIR := $(shell mktemp -d)

build-requirements:
$(VIRTUALENV) $(TEMPDIR)
$(TEMPDIR)/bin/pip install -U pip
$(TEMPDIR)/bin/pip install -Ue .
$(TEMPDIR)/bin/pip freeze > requirements.txt

virtualenv: $(PYTHON)
$(PYTHON):
virtualenv $(VENV)

tox: $(TOX)
$(TOX): virtualenv
$(VENV)/bin/pip install tox

tests-once: tox
$(VENV)/bin/tox -e py27

tests: tox
$(VENV)/bin/tox
7 changes: 6 additions & 1 deletion kinto_ldap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import pkg_resources

from ldappool import ConnectionManager
from pyramid.exceptions import ConfigurationError

from kinto_ldap.authentication import ldap_ping

#: Module version, as defined in PEP-0396.
__version__ = pkg_resources.get_distribution(__package__).version


DEFAULT_SETTINGS = {
'multiauth.policy.ldap.use': ('kinto_ldap.authentication.'
Expand All @@ -25,7 +30,7 @@ def includeme(config):
defaults = {k: v for k, v in DEFAULT_SETTINGS.items() if k not in settings}
config.add_settings(defaults)
config.add_api_capability(
"ldap",
"ldap", version=__version__,
description="Basic Auth user are validated against an LDAP server.",
url="https://github.com/mozilla-services/kinto-ldap")

Expand Down
2 changes: 2 additions & 0 deletions kinto_ldap/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from kinto.core.utils import random_bytes_hex
from pyramid.config import Configurator

from kinto_ldap import __version__ as ldap_version
from . import unittest


Expand Down Expand Up @@ -67,6 +68,7 @@ def test_ldap_capability(self, additional_settings=None):
capabilities = resp.json['capabilities']
self.assertIn('ldap', capabilities)
expected = {
"version": ldap_version,
"url": "https://github.com/mozilla-services/kinto-ldap",
"description": "Basic Auth user are validated against an "
"LDAP server."
Expand Down

0 comments on commit 5a50308

Please sign in to comment.