Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Add kinto-signer plugin version in the capability.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Jul 27, 2016
1 parent 5bc8594 commit 887851e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document describes changes between each past release.
0.8.0 (unreleased)
------------------

- Nothing changed yet.
- Add the plugin version in the capability.


0.7.2 (2016-07-25)
Expand Down
5 changes: 5 additions & 0 deletions kinto_signer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pkg_resources
import functools

from kinto.core.events import ACTIONS, ResourceChanged
Expand All @@ -8,6 +9,9 @@
from kinto_signer.signer import heartbeat
from kinto_signer import utils

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


def on_collection_changed(event, resources):
"""
Expand Down Expand Up @@ -108,6 +112,7 @@ def includeme(config):
message = "Digital signatures for integrity and authenticity of records."
docs = "https://github.com/Kinto/kinto-signer#kinto-signer"
config.add_api_capability("signer", message, docs,
version=__version__,
resources=resources.values())

config.add_subscriber(
Expand Down
3 changes: 2 additions & 1 deletion kinto_signer/tests/test_plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pyramid.exceptions import ConfigurationError
from requests import exceptions as requests_exceptions

from kinto_signer import on_collection_changed
from kinto_signer import on_collection_changed, __version__ as signer_version
from kinto_signer.signer.autograph import AutographSigner
from kinto_signer import includeme
from kinto_signer import utils
Expand All @@ -24,6 +24,7 @@ def test_capability_is_exposed(self):
expected = {
"description": "Digital signatures for integrity and authenticity of records.", # NOQA
"url": ("https://github.com/Kinto/kinto-signer#kinto-signer"),
"version": signer_version,
"resources": [
{"destination": {"bucket": "alice",
"collection": "destination"},
Expand Down

0 comments on commit 887851e

Please sign in to comment.