[Bug 31793] New: REST API: DELETE endpoint for Authorities
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Bug ID: 31793 Summary: REST API: DELETE endpoint for Authorities Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: new feature Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31790 Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31790 [Bug 31790] REST API: CRUD endpoints for Authorities [omnibus] -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Depends on| |31794 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31794 [Bug 31794] REST API: GET endpoint for Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #1 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144472&action=edit Bug 31793: Add REST endpoint to delete authorities To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Get the id of an authority 4. Make a DELETE request to /api/v1/authorities/{authid} 5. Check that the authority was deleted 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31795 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31795 [Bug 31795] REST API: POST endpoint for Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144472|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 144705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144705&action=edit Bug 31793: Add REST endpoint to delete authorities To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Get the id of an authority 4. Make a DELETE request to /api/v1/authorities/{authid} 5. Check that the authority was deleted 6. Sign off Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This adds a DELETE endpoint release notes| |for authorities to the REST | |API. CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. I used this command to delete an existing authority: curl -u koha:koha --request DELETE http://127.0.0.1:8080/api/v1/authorities/419 2. This authority (419) had associated records - the authority deleted was removed from the record. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit | |y.org | CC| |tomascohen@gmail.com Component|MARC Authority data support |REST API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliothek@th-wildau.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + return try { + my $error = DelAuthority( { authid => $authority->authid } ); + + if ($error) { + return $c->render( + status => 409, I would probably go for 500 as long as we dont know what has been going on in DelAuthority. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + "404": + description: Biblio not found + schema: + $ref: "../swagger.yaml#/definitions/error" Copy and paste. Correct ! + "409": + description: Unable to perform action on biblio -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + x-koha-authorization: + permissions: + editcatalogue: edit_catalogue I would probably expect: flagsrequired => {editauthorities => 1}, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA QA Contact| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144705|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 147808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147808&action=edit Bug 31793: Add REST endpoint to delete authorities To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Get the id of an authority 4. Make a DELETE request to /api/v1/authorities/{authid} 5. Check that the authority was deleted 6. Sign off Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 147809 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147809&action=edit Bug 31793: (QA follow-up) DelAuthority doesn't return errors DelAuthority doesn't return an error, so the only possible error conditions are exceptions, that are unknown for now. Removing the error checking control structure and the 409 error returning, which is inherited from DelBiblio's call on the biblios endpoint. It will now just return a 500 in the event of an unhandled internal error. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 147810 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147810&action=edit Bug 31793: (QA follow-up) Require editauthorities flag This patch makes the route require the right permissions. Tests are adjusted to reflect this new situation. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147808|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147831 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147831&action=edit Bug 31793: Add REST endpoint to delete authorities To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Get the id of an authority 4. Make a DELETE request to /api/v1/authorities/{authid} 5. Check that the authority was deleted 6. Sign off Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147809|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147832 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147832&action=edit Bug 31793: (QA follow-up) DelAuthority doesn't return errors DelAuthority doesn't return an error, so the only possible error conditions are exceptions, that are unknown for now. Removing the error checking control structure and the 409 error returning, which is inherited from DelBiblio's call on the biblios endpoint. It will now just return a 500 in the event of an unhandled internal error. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147810|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147833 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147833&action=edit Bug 31793: (QA follow-up) Require editauthorities flag This patch makes the route require the right permissions. Tests are adjusted to reflect this new situation. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Bug 31793 depends on bug 31794, which changed state. Bug 31794 Summary: REST API: GET endpoint for Authorities https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31794 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@ptfs-europe | |.com Resolution|--- |FIXED Status|Pushed to master |RESOLVED --- Comment #14 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Good work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Summary|REST API: DELETE endpoint |Add DELETE endpoint for |for Authorities |Authorities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31793 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This adds a DELETE endpoint | release notes|for authorities to the REST | |API. | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org