[API] block-device 'add/remove_tag' operations use GET method, not POST
Bug #1611711 reported by
Brendan Donegan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Gavin Panella | ||
2.0 |
Fix Released
|
Critical
|
Gavin Panella |
Bug Description
As per current MAAS documentation: https:/
The add_tag and remove_tag operations on a block device are issued with a 'GET' request. This is really wrong - GET requests should never change the server state, only return information.
Related branches
lp:~allenap/maas/add-remove-tag-using-post--bug-1611711
- Blake Rouse (community): Approve
-
Diff: 111 lines (+12/-12)2 files modifiedsrc/maasserver/api/blockdevices.py (+4/-4)
src/maasserver/api/tests/test_blockdevice.py (+8/-8)
lp:~allenap/maas/add-remove-tag-using-post--bug-1611711--2.0
- Gavin Panella (community): Approve
-
Diff: 111 lines (+12/-12)2 files modifiedsrc/maasserver/api/blockdevices.py (+4/-4)
src/maasserver/api/tests/test_blockdevice.py (+8/-8)
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
importance: | High → Critical |
Changed in maas: | |
milestone: | none → 2.0.0 |
Changed in maas: | |
status: | Triaged → In Progress |
assignee: | nobody → Gavin Panella (allenap) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 2.0.0 → none |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This should be fixed before we release 2.0.
FWIW, I think this may have been caused by poor naming in the @operation decorator: it takes a boolean argument "idempotent" which then exposes the operation via HTTP GET when idempotent is True or POST when False. However, mutations should always be done via HTTP POST, whether idempotent or not.