[Bug 28002] New: Add optional extended_attributes param to POST /patrons
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Bug ID: 28002 Summary: Add optional extended_attributes param to POST /patrons Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com Bug 27853 highlighted some patron's shouldn't be created through the API if they don't satisfy the mandatory extended attributes requirements. Solving it is not possible without adding a new parameter and proper handling to the current route. This bug proposes to add that parameter. It is based on the work done in bug 23666 and its tree. -- 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=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |23666, 27855 Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Text to go in the| |This development adds an release notes| |optional parameter to the | |POST /patrons route, so | |extended attributes can be | |passed for patron creation. | |It relies on the underlying | |code to handle extended | |attributes | |constraints/requirements | |(repeatable, mandatory, | |unique, etc). | | | |The added | |attribute (to be passed in | |the body of the POST | |request) is | |'extended_attributes' and | |consists of an array of | |extended attribute objects | |(properly described on the | |spec). Status|NEW |ASSIGNED Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23666 [Bug 23666] Add API route for additional patron attributes https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27855 [Bug 27855] Allow embedding extended_attributes on /patrons routes -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |joonas.kylmala@helsinki.fi, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 119047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119047&action=edit Bug 28002: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 119048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119048&action=edit Bug 28002: Add extended_attributes support to POST /patrons This patch adds support for the 'extended_attributes' parameter in the route for adding a patron. It relies on Koha::Patron->extended_attributes for the tests. Exceptions are catch and the whole operation is rolled back. I chose to handle each exception on its own if branch, with bug 28020 in mind. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCES: Tests pass! 3. Check they cover all the exception situations! => SUCCESS: They do! 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Kyle M Hall <kyle@bywatersolutions.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=28002 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119047|0 |1 is obsolete| | Attachment #119048|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119395&action=edit Bug 28002: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119395|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119396&action=edit Bug 28002: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119397&action=edit Bug 28002: Add extended_attributes support to POST /patrons This patch adds support for the 'extended_attributes' parameter in the route for adding a patron. It relies on Koha::Patron->extended_attributes for the tests. Exceptions are catch and the whole operation is rolled back. I chose to handle each exception on its own if branch, with bug 28020 in mind. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCES: Tests pass! 3. Check they cover all the exception situations! => SUCCESS: They do! 4. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119396|0 |1 is obsolete| | --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 119415 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119415&action=edit Bug 28002: Unit tests Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119397|0 |1 is obsolete| | --- Comment #7 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 119416 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119416&action=edit Bug 28002: Add extended_attributes support to POST /patrons This patch adds support for the 'extended_attributes' parameter in the route for adding a patron. It relies on Koha::Patron->extended_attributes for the tests. Exceptions are catch and the whole operation is rolled back. I chose to handle each exception on its own if branch, with bug 28020 in mind. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCES: Tests pass! 3. Check they cover all the exception situations! => SUCCESS: They do! 4. Sign off :-D Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119415|0 |1 is obsolete| | --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 119417 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119417&action=edit Bug 28002: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119416|0 |1 is obsolete| | --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 119418 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119418&action=edit Bug 28002: Add extended_attributes support to POST /patrons This patch adds support for the 'extended_attributes' parameter in the route for adding a patron. It relies on Koha::Patron->extended_attributes for the tests. Exceptions are catch and the whole operation is rolled back. I chose to handle each exception on its own if branch, with bug 28020 in mind. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCES: Tests pass! 3. Check they cover all the exception situations! => SUCCESS: They do! 4. Sign off :-D Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Kyle M Hall <kyle@bywatersolutions.com> 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=28002 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119417|0 |1 is obsolete| | Attachment #119418|0 |1 is obsolete| | --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 119425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119425&action=edit Bug 28002: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119418|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Kyle/Victor, it seems you overlapped on the QA step. Can any of you check you SO lines are ok? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We need to discuss how to deal with the "library limitations". Tomas will send an email to the list. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |28157 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28157 [Bug 28157] Add the ability to set a library from which an API request pretends to come from -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Tomás Cohen Arazi <tomascohen@gmail.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=28002 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This implementation relies on Koha::Patron->extended_attributes, which is aware of library limitations by means of userenv. This, paired with bug 28157, should give us a secure way [1] to specify the library the request comes from and have Koha::Patron->extended_attributes act correctly. [1] The bug 28157 will reject the request if the alleged library is not valid for the caller user. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.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=28002 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- So happy to see this having worked it way through.. a great team effort, especially thankful for all Tomas's work! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 23666 not in 20.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28002 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ephetteplace@cca.edu -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org