Skip to content

Commit

Permalink
Merge branch 'master' into add-groups-to-@user
Browse files Browse the repository at this point in the history
  • Loading branch information
tisto committed Jul 21, 2018
2 parents fe6e834 + 0dc2ee6 commit 39f7db7
Show file tree
Hide file tree
Showing 300 changed files with 2,313 additions and 678 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Expand Up @@ -17,6 +17,10 @@ env:
- PLONE_VERSION=5.1.x
before_install:
- mkdir -p $HOME/buildout-cache/{eggs,downloads}
- mkdir $HOME/.buildout
- echo "[buildout]" > $HOME/.buildout/default.cfg
- echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
- echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- pip install -r requirements.txt
install:
- sed -ie "s#plone-x.x.x.cfg#plone-$PLONE_VERSION.cfg#" travis.cfg
Expand All @@ -31,7 +35,7 @@ after_success:
- bin/test-coverage
- pip install coverage==3.7.1 coveralls
- coveralls
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- if [ ! $TRAVIS_TAG ]; then docker build --tag plone/plone.restapi:plone-$PLONE_VERSION-$(git rev-parse HEAD) --tag plone/plone.restapi:latest . ; fi
- if [ $TRAVIS_TAG ]; then docker build --tag plone/plone.restapi:plone-$PLONE_VERSION-$(git rev-parse HEAD) . --tag plone/plone.restapi:plone-$PLONE_VERSION-$TRAVIS_TAG --tag plone/plone.restapi:latest ; fi
- docker push plone/plone.restapi
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
# - if [ ! $TRAVIS_TAG ]; then docker build --tag plone/plone.restapi:plone-$PLONE_VERSION-$(git rev-parse HEAD) --tag plone/plone.restapi:latest . ; fi
# - if [ $TRAVIS_TAG ]; then docker build --tag plone/plone.restapi:plone-$PLONE_VERSION-$(git rev-parse HEAD) . --tag plone/plone.restapi:plone-$PLONE_VERSION-$TRAVIS_TAG --tag plone/plone.restapi:latest ; fi
# - docker push plone/plone.restapi
113 changes: 108 additions & 5 deletions CHANGES.rst
@@ -1,7 +1,111 @@
Changelog
=========

2.1.1 (unreleased)
3.3.1 (unreleased)
------------------

- Nothing changed yet.


3.3.0 (2018-07-20)
------------------

New Features:

- Return member fields based on user schema in `@users` endpoint instead of a
fixed list of member properties.
[buchi]


3.2.2 (2018-07-19)
------------------

Bugfixes:

- Do not include HTTP examples using data_files anymore, but move them below
src/plone/restapi instead and use package_data to include them.
[lgraf]

- Rename Dexterity content before adding it to a container.
[buchi]

- Avoid hard dependency on Archetypes introduced in 3.0.0.
This fixes `issue 570 <https://github.com/plone/plone.restapi/issues/570>`_.
[buchi]

- Make setup.py require plone.behavior >= 1.1. This fixes #575.
[timo]

- Fixes ``test_search`` to work with bug fixed ``plone.indexer``.
Now ``DXTestDocument`` explicit got an attribute ``exclude_from_nav``.
This fixes `issue 579 <https://github.com/plone/plone.restapi/issues/579>`_.
Refers to `Products.CMFPlone Issue 2469 <https://github.com/plone/Products.CMFPlone/issues/2469>`_
[jensens]


3.2.1 (2018-06-28)
------------------

Bugfixes:

- Require plone.schema >= 1.2.0 in setup.py for new tiles endpoint.
[timo]

3.2.0 (2018-06-28)
------------------

New Features:

- Add tiles endpoint for getting all available content tiles and its JSONSchema.
[sneridagh]

- Add a tiles behavior to support the new tiles implementation for plone.restapi.
[sneridagh]

- Make sure to include HTTP examples in installed egg, so test_documentation
tests also work against a installed release of plone.restapi.
[lgraf]


3.1.0 (2018-06-27)
------------------

New Features:

- Plone 5.2 compatibility.
[sunew, davisagli, timo]


3.0.0 (2018-06-26)
------------------

Breaking Changes:

- Fix object creation events. Before this fix, creation events were fired on
empty not yet deserialized objects. Also a modified event was fired after
deserializing e newly created object.
Custom content deserializers now must handle the `create` keyword argument,
which determines if deserialization is performed during object creation or
while updating an object.
[buchi]

- Include translated role titles in `@sharing` GET.
[lgraf]

- Image URLs are now created using the cache optimized way. Fixes #494.
[erral]


2.2.1 (2018-06-25)
------------------

Bugfixes:

- Fix ReST on PyPi.
[timo]


2.2.0 (2018-06-25)
------------------

New Features:
Expand All @@ -13,6 +117,9 @@ New Features:
- Document the use of the `Accept-Language` HTTP header.
[erral]

- Translate FTI titles on `@types` endpoint. Fixes #337.
[erral]

- Translate action name, workflow state and transition names in @history endpoint.
[erral]

Expand Down Expand Up @@ -40,14 +147,10 @@ Bugfixes:

New Features:

- Translate FTI titles on `@types` endpoint. Fixes #337.
[erral]

- Include translated role title in `@roles` GET.
[lgraf]



2.0.1 (2018-06-22)
------------------

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Expand Up @@ -14,3 +14,4 @@
- Tom Gross
- Roel Bruggink
- Yann Fouillat, alias Gagaro
- Sune Brøndum Wøller
8 changes: 8 additions & 0 deletions MANIFEST.in
@@ -1,7 +1,15 @@
graft src/plone/restapi
graft docs
include *.rst
include *.txt
exclude *.cfg
exclude *.yml
exclude *.in
exclude *.jmx
exclude *.yaml
exclude .coveragerc
exclude .editorconfig
exclude Dockerfile
exclude Makefile
exclude bootstrap-buildout.py
global-exclude *.pyc
29 changes: 28 additions & 1 deletion base.cfg
Expand Up @@ -23,6 +23,16 @@ sources-dir = extras
auto-checkout =
# plone.rest

allow-hosts =
*.python.org
*.plone.org
*.zope.org
pypi.org
files.pythonhosted.org
launchpad.net
code.google.com
robotframework.googlecode.com

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
Expand All @@ -36,6 +46,19 @@ eggs =
environment-vars =
zope_i18n_compile_mo_files true

zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:4300,http://127.0.0.1:4300,http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
allow_headers="Accept,Authorization,Content-Type,X-Custom-Header"
max_age="3600"
/>
</configure>

[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
Expand Down Expand Up @@ -95,7 +118,10 @@ scripts = dependencychecker

[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser
eggs =
zest.releaser[recommended]
readme
docutils

[pocompile]
recipe = zc.recipe.egg
Expand Down Expand Up @@ -162,3 +188,4 @@ mode = 755

[sources]
plone.rest = git git://github.com/plone/plone.rest.git pushurl=git@github.com:plone/plone.rest.git branch=master
plone.schema = git git://github.com/plone/plone.schema.git pushurl=git@github.com:plone/plone.schema.git branch=newjsonschemafield
4 changes: 2 additions & 2 deletions docs/source/actions.rst
Expand Up @@ -21,13 +21,13 @@ Listing available actions
To list the available actions, send a GET request to the '@actions' endpoint on a specific content object:

.. http:example:: curl httpie python-requests
:request: _json/actions_get.req
:request: ../../src/plone/restapi/tests/http-examples/actions_get.req

The server will respond with a `200 OK` status code.
The JSON response contains the available actions categories (object, object_buttons, user) on the top level.
Each category contains a list of the available actions in that category:

.. literalinclude:: _json/actions_get.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/actions_get.resp
:language: http

If you want to limit the categories that are retured, pass one or more parameters
Expand Down
14 changes: 7 additions & 7 deletions docs/source/authentication.rst
Expand Up @@ -47,11 +47,11 @@ A JWT token can be acquired by posting a user's credentials to the ``@login``
endpoint.

.. http:example:: curl httpie python-requests
:request: _json/jwt_login.req
:request: ../../src/plone/restapi/tests/http-examples/jwt_login.req

The server responds with a JSON object containing the token.

.. literalinclude:: _json/jwt_login.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/jwt_login.resp
:language: http

Authenticating with a token
Expand All @@ -61,7 +61,7 @@ The token can now be used in subsequent requests by including it in the
``Authorization`` header with the ``Bearer`` scheme:

.. http:example:: curl httpie python-requests
:request: _json/jwt_logged_in.req
:request: ../../src/plone/restapi/tests/http-examples/jwt_logged_in.req


Renewing a token (@login-renew)
Expand All @@ -71,11 +71,11 @@ By default the token will expire after 12 hours and thus must be renewed before
expiration. To renew the token simply post to the ``@login-renew`` endpoint.

.. http:example:: curl httpie python-requests
:request: _json/jwt_login_renew.req
:request: ../../src/plone/restapi/tests/http-examples/jwt_login_renew.req

The server returns a JSON object with a new token:

.. literalinclude:: _json/jwt_login_renew.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/jwt_login_renew.resp
:language: http

Invalidating a token (@logout)
Expand All @@ -90,11 +90,11 @@ keyring in the PAS plugin (option ``use_keyring``).
The logout request must contain the existing token in the ``Authorization`` header.

.. http:example:: curl httpie python-requests
:request: _json/jwt_logout.req
:request: ../../src/plone/restapi/tests/http-examples/jwt_logout.req

If invalidation succeeds, the server responds with an empty 204 reponse:

.. literalinclude:: _json/jwt_logout.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/jwt_logout.resp
:language: http

Permissions
Expand Down
4 changes: 2 additions & 2 deletions docs/source/batching.rst
Expand Up @@ -79,8 +79,8 @@ Parameter Description
Full example of a batched request and response:

.. http:example:: curl httpie python-requests
:request: _json/batching.req
:request: ../../src/plone/restapi/tests/http-examples/batching.req

.. literalinclude:: _json/batching.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/batching.resp
:language: http

4 changes: 2 additions & 2 deletions docs/source/breadcrumbs.rst
Expand Up @@ -6,9 +6,9 @@ Breadcrumbs
Getting the breadcrumbs for the current page:

.. http:example:: curl httpie python-requests
:request: _json/breadcrumbs.req
:request: ../../src/plone/restapi/tests/http-examples/breadcrumbs.req

Example response:

.. literalinclude:: _json/breadcrumbs.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/breadcrumbs.resp
:language: http
20 changes: 10 additions & 10 deletions docs/source/comments.rst
Expand Up @@ -13,11 +13,11 @@ Listing Comments
You can list the existing comment on a content object by sending a GET request to the URL of the content object and appending '/@comments':

.. http:example:: curl httpie python-requests
:request: _json/comments_get.req
:request: ../../src/plone/restapi/tests/http-examples/comments_get.req

The server will respond with a `Status 200` and a batched list of all comments:

.. literalinclude:: _json/comments_get.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/comments_get.resp
:language: http

These following fields are returned:
Expand Down Expand Up @@ -47,11 +47,11 @@ Adding a Comment
To add a new comment to a content object, send a POST request to the URL of the content object and append '/@comments' to the URL. The body of the request needs to contain a JSON structure with a 'text' attribute that contains the comment text:

.. http:example:: curl httpie python-requests
:request: _json/comments_add_root.req
:request: ../../src/plone/restapi/tests/http-examples/comments_add_root.req

If the creation of the comment has been successful, the server will respond with a :term:`204 No Content` status and the URL of the newly created comment in the location header:

.. literalinclude:: _json/comments_add_root.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/comments_add_root.resp
:language: http


Expand All @@ -61,11 +61,11 @@ Replying to a Comment
To add a direct reply to an existing comment, send a POST request to the URL of the comment you want to reply to. The body of the request needs to contain a JSON structure with a 'text' attribute that contains the comment text:

.. http:example:: curl httpie python-requests
:request: _json/comments_add_sub.req
:request: ../../src/plone/restapi/tests/http-examples/comments_add_sub.req

If the creation of the comment has been successful, the server will respond with a :term:`204 No Content` status and the URL of the newly created comment in the location header:

.. literalinclude:: _json/comments_add_sub.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/comments_add_sub.resp
:language: http


Expand All @@ -77,11 +77,11 @@ Updating a Comment
An existing comment can be updated by sending a PATCH request to the URL of the comment. The request body needs to contain a JSON structure with at least a 'text' attribute:

.. http:example:: curl httpie python-requests
:request: _json/comments_update.req
:request: ../../src/plone/restapi/tests/http-examples/comments_update.req

The server will respond with a :term:`204 No Content` response and a location header with the comment URL when the comment has been updated successfully:

.. literalinclude:: _json/comments_update.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/comments_update.resp
:language: http


Expand All @@ -93,9 +93,9 @@ An existing comment can be deleted by sending a DELETE request to the URL of the
..note: Deleting a comment will, by default, also delete all existing replies to that comment.

.. http:example:: curl httpie python-requests
:request: _json/comments_delete.req
:request: ../../src/plone/restapi/tests/http-examples/comments_delete.req

When the comment has been deleted successfully, the server will respond with a :term:`204 No Content` response:

.. literalinclude:: _json/comments_delete.resp
.. literalinclude:: ../../src/plone/restapi/tests/http-examples/comments_delete.resp
:language: http

0 comments on commit 39f7db7

Please sign in to comment.