Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to update route path through HTTP PUT #381

Closed
2 tasks
denismakogon opened this issue Dec 1, 2016 · 0 comments
Closed
2 tasks

Unable to update route path through HTTP PUT #381

denismakogon opened this issue Dec 1, 2016 · 0 comments

Comments

@denismakogon
Copy link
Contributor

Similar to #380 API is not restrictive, so i can create a route

curl -X POST -d '{"route":{"type": "sync", "path": "/hello-sync-private", "image": "iron/hello"}}' localhost:8080/v1/apps/testapp/routes

And then will try to update it

curl -X PUT -d '{"route":{"type": "async", "path": "/hello-sync", "image": "iron/hello"}}' localhost:8080/v1/apps/testapp/routes/hello-sync-private

So, type can be modified because response shows that type is changed:

{"message":"Route successfully updated","route":{"app_name":"testapp","path":"/hello-sync-private","image":"iron/hello","type":"async","config":null}}

It appears that there's immutable attribute - path, but API accepts request without saying that such modification forbidden due to immutability nature of an attribute.

In order to fix issue it would be nice to have:

  • doc that reflects immutability/mutability of an attributes
  • make API more restrictive by returning HTTP 403 in cases when user attempts to modify immutable attribute.
@denismakogon denismakogon changed the title Unable to update route path Unable to update route path through HTTP PUT Dec 1, 2016
@ucirello ucirello added this to the Alpha 2 milestone Dec 1, 2016
ucirello added a commit that referenced this issue Dec 5, 2016
Ensure that attempts to update route's path are properly handled
with a HTTP error. Moreover, updates swagger file to make it
explicit that routes are immutable.

Fixes #381
ucirello pushed a commit that referenced this issue Dec 7, 2016
Ensure that attempts to update route's path are properly handled
with a HTTP error. Moreover, updates swagger file to make it
explicit that routes are immutable.

Fixes #381
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants