Metadata-Version: 2.0
Name: kinto-changes
Version: 0.1.0
Summary: Plug Kinto notifications to a collection endpoint.
Home-page: https://github.com/kinto/kinto-changes
Author: Mozilla Services
Author-email: services-dev@mozilla.com
License: Apache License (2.0)
Keywords: kinto changes notification
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: kinto (>=1.10)

=============
Kinto Changes
=============

.. image:: https://img.shields.io/travis/kinto/kinto-changes.svg
        :target: https://travis-ci.org/kinto/kinto-changes

.. image:: https://img.shields.io/pypi/v/kinto-changes.svg
        :target: https://pypi.python.org/pypi/kinto-changes

**proof-of-concept**: Track modifications of records in Kinto and store the
collection timestamps into a specific bucket and collection.


This plugin is useful to allow for polling on several collections
changes with one HTTP request.


Install
-------

::

    pip install kinto-changes

Setup
-----

In the `Kinto <http://kinto.readthedocs.org/>`_ settings:

::

    kinto.includes = kinto_changes

    kinto.event_listeners = changes
    kinto.event_listeners.changes.use = kinto_changes.listener


Now everytime a record is modified, the list of current timestamps is available
at ``GET /v1/buckets/monitor/collections/changes/records``.


Filter collections
''''''''''''''''''

It is possible to choose which collections are monitored:

::

    kinto.event_listeners.changes.collections = <list of URIs>

For example, to be notified of record updates in the ``certificates`` collection,
or every collections of the ``settings`` bucket:

::

    kinto.event_listeners.changes.collections =
        /buckets/blocklists/collections/certificates
        /buckets/settings


Permissions
'''''''''''

By default the list of timestamps is readable by everyone. The list of authorized
principals can be specified in settings:

::

    kinto.event_listeners.changes.principals =
        system.Authenticated
        group:admins
        twitter:@natim


Advanced options
''''''''''''''''

By default, the list of timestamps is available in the ``changes`` collection in
the ``monitor`` bucket. This can be specified in settings:

::

    kinto.event_listeners.changes.bucket = monitor
    kinto.event_listeners.changes.collection = changes


If specified in settings, the changes will have a ``http_host`` attribute.
This can be used to distinguish changes from several Kinto instances.

::

    kinto.http_host = website.domain.tld


Changelog
=========


0.1.0 (2015-12-22)
------------------

- Initial code.
- Bucket and collection name configuration.
- Changes read permissions configuration.
- Selection of buckets and collections to follow configuration.


