Bug 17006 - Add route to change patron's password (authenticated)
Summary: Add route to change patron's password (authenticated)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature (vote)
Assignee: Tomás Cohen Arazi
QA Contact:
URL: https://wiki.koha-community.org/wiki/...
Keywords:
Depends on: 21233 22047 22059
Blocks: 16652 22061
  Show dependency treegraph
 
Reported: 2016-07-31 11:17 UTC by Jiri Kozlovsky
Modified: 2020-01-06 20:17 UTC (History)
15 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This new feature allows a administrators to change a users password via the API Sponsored by Municipal Library Ceska Trebova
Version(s) released in:


Attachments
Bug 17006: Add API route for changing patron's password (9.52 KB, patch)
2016-08-18 15:43 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: Respect system preference "OpacPasswordChange" (3.82 KB, patch)
2016-08-18 16:01 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: Add API route for changing patron's password (9.52 KB, patch)
2016-08-19 13:00 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: Respect system preference "OpacPasswordChange" (3.82 KB, patch)
2016-08-19 13:00 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (9.59 KB, patch)
2016-08-22 23:00 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (9.59 KB, patch)
2016-08-22 23:01 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange" (3.89 KB, patch)
2016-08-22 23:01 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (21.86 KB, patch)
2016-10-11 09:47 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange" (4.00 KB, patch)
2016-10-11 09:47 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (10.28 KB, patch)
2016-10-11 09:50 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange" (4.00 KB, patch)
2016-10-11 09:51 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (10.16 KB, patch)
2016-10-12 13:53 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange" (4.00 KB, patch)
2016-10-12 13:53 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: (follow-up) Test for changing another user's password (2.26 KB, patch)
2016-10-13 13:28 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: (follow-up) Let librarians change patron's passwords (2.55 KB, patch)
2016-10-13 13:28 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.11 KB, patch)
2016-10-13 13:28 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.31 KB, patch)
2016-10-13 14:14 UTC, Lari Taskula
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password (10.23 KB, patch)
2016-11-08 22:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange" (4.07 KB, patch)
2016-11-08 22:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: (follow-up) Test for changing another user's password (2.33 KB, patch)
2016-11-08 22:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: (follow-up) Let librarians change patron's passwords (2.61 KB, patch)
2016-11-08 22:01 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.38 KB, patch)
2016-11-08 22:01 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Add API route for changing patron's password (10.17 KB, patch)
2017-05-10 10:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Respect system preference "OpacPasswordChange" (4.04 KB, patch)
2017-05-10 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Test for changing another user's password (2.32 KB, patch)
2017-05-10 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Let librarians change patron's passwords (2.60 KB, patch)
2017-05-10 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.42 KB, patch)
2017-05-10 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Add API route for changing patron's password (10.00 KB, patch)
2017-09-14 08:36 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Respect system preference "OpacPasswordChange" (4.04 KB, patch)
2017-09-14 08:36 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Test for changing another user's password (2.32 KB, patch)
2017-09-14 08:36 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Let librarians change patron's passwords (2.60 KB, patch)
2017-09-14 08:36 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.42 KB, patch)
2017-09-14 08:36 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Add API route for changing patron's password (10.11 KB, patch)
2018-01-04 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Respect system preference "OpacPasswordChange" (4.04 KB, patch)
2018-01-04 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Test for changing another user's password (2.32 KB, patch)
2018-01-04 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Let librarians change patron's passwords (2.60 KB, patch)
2018-01-04 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint (7.43 KB, patch)
2018-01-04 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Unit tests (8.43 KB, patch)
2018-08-16 10:06 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.35 KB, patch)
2018-08-16 10:07 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (5.25 KB, patch)
2018-08-16 10:07 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Unit tests (8.49 KB, patch)
2018-08-16 13:11 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.40 KB, patch)
2018-08-16 13:11 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (5.31 KB, patch)
2018-08-16 13:11 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: (follow-up) Whitespace chars follow-up (2.38 KB, patch)
2018-09-14 23:28 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Unit tests (8.49 KB, patch)
2018-11-24 12:42 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.42 KB, patch)
2018-11-24 12:42 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (5.31 KB, patch)
2018-11-24 12:42 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: (follow-up) Whitespace chars follow-up (2.38 KB, patch)
2018-11-24 12:42 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Unit tests (5.94 KB, patch)
2019-01-02 13:32 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.39 KB, patch)
2019-01-02 13:32 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (4.35 KB, patch)
2019-01-02 13:32 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17006: Unit tests (6.00 KB, patch)
2019-01-09 15:13 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.45 KB, patch)
2019-01-09 15:13 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (4.42 KB, patch)
2019-01-09 15:13 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17006: Unit tests (6.07 KB, patch)
2019-01-22 15:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17006: OpenAPI spec (3.51 KB, patch)
2019-01-22 15:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17006: Add /patrons/{patron_id}/password (4.48 KB, patch)
2019-01-22 15:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17006: (follow-up) set_password expects a hashref (827 bytes, patch)
2019-01-28 15:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kozlovsky 2016-07-31 11:17:22 UTC
Add API to change patron's password.

This is useful especially for 3rd party applications like VuFind.
Comment 1 Lari Taskula 2016-08-18 15:43:52 UTC Comment hidden (obsolete)
Comment 2 Lari Taskula 2016-08-18 16:01:18 UTC Comment hidden (obsolete)
Comment 3 Lari Taskula 2016-08-19 13:00:28 UTC Comment hidden (obsolete)
Comment 4 Lari Taskula 2016-08-19 13:00:42 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2016-08-22 23:00:07 UTC Comment hidden (obsolete)
Comment 6 Aleisha Amohia 2016-08-22 23:01:02 UTC
Created attachment 54717 [details] [review]
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 7 Aleisha Amohia 2016-08-22 23:01:11 UTC
Created attachment 54718 [details] [review]
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 8 Lari Taskula 2016-10-11 09:47:08 UTC
Created attachment 56155 [details] [review]
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch and minify swagger.json
perl misc/devel/minifySwagger.pl -s api/v1/swagger/swagger.json -d api/v1/swagger/swagger.min.json
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 9 Lari Taskula 2016-10-11 09:47:40 UTC
Created attachment 56156 [details] [review]
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 10 Lari Taskula 2016-10-11 09:50:42 UTC
Created attachment 56157 [details] [review]
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 11 Lari Taskula 2016-10-11 09:51:33 UTC
Created attachment 56158 [details] [review]
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange"

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 12 Lari Taskula 2016-10-11 09:51:48 UTC
Rebased on top of master.
Comment 13 Lari Taskula 2016-10-12 13:53:29 UTC
Created attachment 56283 [details] [review]
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 14 Lari Taskula 2016-10-12 13:53:53 UTC
Created attachment 56284 [details] [review]
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 15 Lari Taskula 2016-10-12 14:01:56 UTC
Removed minification step from test plan after Bug 17432 was pushed to master.
Comment 16 Lari Taskula 2016-10-13 13:28:16 UTC
Created attachment 56399 [details] [review]
Bug 17006: (follow-up) Test for changing another user's password

The previous patches work for changing your own password, but the tests are
lacking a case where librarian attempts to change patron's password. This
feature was unnoticed and not implemented.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Proceed to next patch to fix the failing test
Comment 17 Lari Taskula 2016-10-13 13:28:37 UTC
Created attachment 56400 [details] [review]
Bug 17006: (follow-up) Let librarians change patron's passwords

This should obviously be part of this feature but was left unnoticed in the
first patch. If user has "borrowers"-flag, they should be able to change patron's
password without providing old password.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Apply patch
4. Run t/db_dependent/api/v1/patrons.t
5. Observe passing test
6. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
   and where YYY is not the same borrowernumber as your logged-in
   user's borrowernumber
7. Make sure that password was changed for YYY.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password \
     --data '{"new_password":"1234"}' \
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'
Comment 18 Lari Taskula 2016-10-13 13:28:58 UTC
Created attachment 56401 [details] [review]
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'
Comment 19 Lari Taskula 2016-10-13 14:14:45 UTC
Created attachment 56409 [details] [review]
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint
Comment 20 Josef Moravec 2016-11-08 22:01:06 UTC
Created attachment 57356 [details] [review]
[SIGNED-OFF] Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 21 Josef Moravec 2016-11-08 22:01:26 UTC
Created attachment 57357 [details] [review]
[SIGNED-OFF] Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 22 Josef Moravec 2016-11-08 22:01:34 UTC
Created attachment 57358 [details] [review]
[SIGNED-OFF] Bug 17006: (follow-up) Test for changing another user's password

The previous patches work for changing your own password, but the tests are
lacking a case where librarian attempts to change patron's password. This
feature was unnoticed and not implemented.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Proceed to next patch to fix the failing test

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 23 Josef Moravec 2016-11-08 22:01:39 UTC
Created attachment 57359 [details] [review]
[SIGNED-OFF] Bug 17006: (follow-up) Let librarians change patron's passwords

This should obviously be part of this feature but was left unnoticed in the
first patch. If user has "borrowers"-flag, they should be able to change patron's
password without providing old password.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Apply patch
4. Run t/db_dependent/api/v1/patrons.t
5. Observe passing test
6. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
   and where YYY is not the same borrowernumber as your logged-in
   user's borrowernumber
7. Make sure that password was changed for YYY.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password \
     --data '{"new_password":"1234"}' \
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 24 Josef Moravec 2016-11-08 22:01:45 UTC
Created attachment 57360 [details] [review]
[SIGNED-OFF] Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 25 Mirko Tietgen 2017-05-10 09:34:20 UTC
I can't apply the last patch.

Wende an: Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint
fatal: sha1 information is lacking or useless (Koha/REST/V1/Patron.pm).
Dem Repository fehlen notwendige Blobs um auf einen 3-Wege-Merge zurückzufallen.
Kann nicht zu 3-Wege-Merge zurückfallen.
Anwendung des Patches fehlgeschlagen bei 0001 Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint
Comment 26 Josef Moravec 2017-05-10 10:31:49 UTC
Created attachment 63329 [details] [review]
Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 27 Josef Moravec 2017-05-10 10:32:02 UTC
Created attachment 63330 [details] [review]
Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 28 Josef Moravec 2017-05-10 10:32:08 UTC
Created attachment 63331 [details] [review]
Bug 17006: (follow-up) Test for changing another user's password

The previous patches work for changing your own password, but the tests are
lacking a case where librarian attempts to change patron's password. This
feature was unnoticed and not implemented.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Proceed to next patch to fix the failing test

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 29 Josef Moravec 2017-05-10 10:32:16 UTC
Created attachment 63332 [details] [review]
Bug 17006: (follow-up) Let librarians change patron's passwords

This should obviously be part of this feature but was left unnoticed in the
first patch. If user has "borrowers"-flag, they should be able to change patron's
password without providing old password.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Apply patch
4. Run t/db_dependent/api/v1/patrons.t
5. Observe passing test
6. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
   and where YYY is not the same borrowernumber as your logged-in
   user's borrowernumber
7. Make sure that password was changed for YYY.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password \
     --data '{"new_password":"1234"}' \
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 30 Josef Moravec 2017-05-10 10:32:23 UTC
Created attachment 63333 [details] [review]
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 31 Josef Moravec 2017-05-10 10:33:15 UTC
(In reply to Mirko Tietgen from comment #25)
> I can't apply the last patch.
> 
> Wende an: Bug 17006: (follow-up) Use Koha::Exceptions for change password
> endpoint
> fatal: sha1 information is lacking or useless (Koha/REST/V1/Patron.pm).
> Dem Repository fehlen notwendige Blobs um auf einen 3-Wege-Merge
> zurückzufallen.
> Kann nicht zu 3-Wege-Merge zurückfallen.
> Anwendung des Patches fehlgeschlagen bei 0001 Bug 17006: (follow-up) Use
> Koha::Exceptions for change password endpoint

Rebased on master
Comment 32 Josef Moravec 2017-09-14 08:36:04 UTC
Created attachment 67128 [details] [review]
Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 33 Josef Moravec 2017-09-14 08:36:08 UTC
Created attachment 67129 [details] [review]
Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 34 Josef Moravec 2017-09-14 08:36:12 UTC
Created attachment 67130 [details] [review]
Bug 17006: (follow-up) Test for changing another user's password

The previous patches work for changing your own password, but the tests are
lacking a case where librarian attempts to change patron's password. This
feature was unnoticed and not implemented.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Proceed to next patch to fix the failing test

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 35 Josef Moravec 2017-09-14 08:36:16 UTC
Created attachment 67131 [details] [review]
Bug 17006: (follow-up) Let librarians change patron's passwords

This should obviously be part of this feature but was left unnoticed in the
first patch. If user has "borrowers"-flag, they should be able to change patron's
password without providing old password.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Apply patch
4. Run t/db_dependent/api/v1/patrons.t
5. Observe passing test
6. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
   and where YYY is not the same borrowernumber as your logged-in
   user's borrowernumber
7. Make sure that password was changed for YYY.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password \
     --data '{"new_password":"1234"}' \
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 36 Josef Moravec 2017-09-14 08:36:20 UTC
Created attachment 67132 [details] [review]
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 37 Josef Moravec 2017-09-14 08:42:06 UTC
Rebased on master
Comment 38 Jonathan Druart 2017-10-13 18:00:01 UTC
Note for QA: I think Koha::Patron->change_password_to must call Koha::AuthUtils::is_password_valid (from bug 18298).
Comment 39 Katrin Fischer 2018-01-04 00:34:07 UTC
Patch doesn't apply, please also take a look at comment#38.

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 17006: Add API route for changing patron's password
Using index info to reconstruct a base tree...
M	Koha/Patron.pm
M	Koha/REST/V1/Patron.pm
M	api/v1/swagger/paths.json
M	api/v1/swagger/paths/patrons.json
M	t/db_dependent/api/v1/patrons.t
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/api/v1/patrons.t
Auto-merging api/v1/swagger/paths/patrons.json
Auto-merging api/v1/swagger/paths.json
CONFLICT (content): Merge conflict in api/v1/swagger/paths.json
Auto-merging Koha/REST/V1/Patron.pm
Auto-merging Koha/Patron.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 17006: Add API route for changing patron's password
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-17006-Add-API-route-for-changing-patrons-passw-7eNHth.patch
Comment 40 Josef Moravec 2018-01-04 07:31:24 UTC
Created attachment 70260 [details] [review]
Bug 17006: Add API route for changing patron's password

PATCH /patrons/{borrowernumber}/password (change password)

Required body params:
- current_password
- new_password

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password
     --data '{"current_password":"123456", "new_password":"1234"}'
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 41 Josef Moravec 2018-01-04 07:31:28 UTC
Created attachment 70261 [details] [review]
Bug 17006: Respect system preference "OpacPasswordChange"

Allow patron to change their own password without borrowers-flag only
if OpacPasswordChange system preference is enabled.

To test:
1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Set OpacPasswordChange system preference to "Don't allow".
4. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber for a borrower that does not
   have any permissions
5. Observe permission error.
6. Set OpacPasswordChange system preference to "Allow".
7. Repeat step 4 and make sure that password was changed.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 42 Josef Moravec 2018-01-04 07:31:32 UTC
Created attachment 70262 [details] [review]
Bug 17006: (follow-up) Test for changing another user's password

The previous patches work for changing your own password, but the tests are
lacking a case where librarian attempts to change patron's password. This
feature was unnoticed and not implemented.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Proceed to next patch to fix the failing test

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 43 Josef Moravec 2018-01-04 07:31:36 UTC
Created attachment 70263 [details] [review]
Bug 17006: (follow-up) Let librarians change patron's passwords

This should obviously be part of this feature but was left unnoticed in the
first patch. If user has "borrowers"-flag, they should be able to change patron's
password without providing old password.

To test:
1. Run t/db_dependent/api/v1/patrons.t
2. Observe failing test
3. Apply patch
4. Run t/db_dependent/api/v1/patrons.t
5. Observe passing test
6. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
   and where YYY is not the same borrowernumber as your logged-in
   user's borrowernumber
7. Make sure that password was changed for YYY.

You may find this useful for testing:

curl -X PATCH http://library/api/v1/patrons/123/password \
     --data '{"new_password":"1234"}' \
     --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 44 Josef Moravec 2018-01-04 07:31:40 UTC
Created attachment 70264 [details] [review]
Bug 17006: (follow-up) Use Koha::Exceptions for change password endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 45 Josef Moravec 2018-01-04 07:32:04 UTC
Rebased on master
Comment 46 Tomás Cohen Arazi 2018-02-15 15:45:54 UTC
This should be implemented on top of bug 19784. Also, I see no reason to require the 'old password'.

Conceptually, I would say we are updating the password "object". This means we need to PUT a new password. If we changed the password by hitting the patron/patron_id endpoint, then PATCH would be advised. But on this implementation we should def use PUT.
Comment 47 Tomás Cohen Arazi 2018-02-22 13:59:47 UTC
I'm taking over this one with Lari's agreement. I will add a RFC proposal to be voted.
Comment 48 Tomás Cohen Arazi 2018-08-16 10:06:56 UTC
Created attachment 77882 [details] [review]
Bug 17006: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 49 Tomás Cohen Arazi 2018-08-16 10:07:04 UTC
Created attachment 77883 [details] [review]
Bug 17006: OpenAPI spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 50 Tomás Cohen Arazi 2018-08-16 10:07:09 UTC
Created attachment 77884 [details] [review]
Bug 17006: Add /patrons/{patron_id}/password

This patch introduces an endpoint for changing a patron's password.
To test:

- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_password.t
=> SUCCESS: tests pass!
- Play with the different use cases highlighted by the tests, on your
favourite REST testing tool (Postman, RESTer on FF, etc).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 51 Josef Moravec 2018-08-16 13:11:13 UTC
Created attachment 77923 [details] [review]
Bug 17006: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 52 Josef Moravec 2018-08-16 13:11:18 UTC
Created attachment 77924 [details] [review]
Bug 17006: OpenAPI spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 53 Josef Moravec 2018-08-16 13:11:24 UTC
Created attachment 77925 [details] [review]
Bug 17006: Add /patrons/{patron_id}/password

This patch introduces an endpoint for changing a patron's password.
To test:

- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_password.t
=> SUCCESS: tests pass!
- Play with the different use cases highlighted by the tests, on your
favourite REST testing tool (Postman, RESTer on FF, etc).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 54 Marcel de Rooy 2018-08-24 09:11:27 UTC
tomas: yet another whitespaces occurrence ;)
Comment 55 Tomás Cohen Arazi 2018-09-14 23:28:35 UTC
Created attachment 78837 [details] [review]
Bug 17006: (follow-up) Whitespace chars follow-up

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 56 Tomás Cohen Arazi 2018-09-14 23:29:58 UTC
(In reply to Marcel de Rooy from comment #54)
> tomas: yet another whitespaces occurrence ;)

(Marcel follow-up) submitted :-D
Comment 57 Michal Denar 2018-09-16 08:59:58 UTC
Please rebase on master

I get error:
Using index info to reconstruct a base tree...
M	api/v1/swagger/paths.json
Falling back to patching base and 3-way merge...
Auto-merging api/v1/swagger/paths.json
CONFLICT (content): Merge conflict in api/v1/swagger/paths.json
Failed to merge in the changes.
Patch failed at 0001 Bug 17006: OpenAPI spec


Thank You


Mike
Comment 58 Mark Tompsett 2018-10-17 18:16:11 UTC
Bug 20944 caused a conflict. easily fixed.
Comment 59 Tomás Cohen Arazi 2018-11-24 12:42:15 UTC Comment hidden (obsolete)
Comment 60 Tomás Cohen Arazi 2018-11-24 12:42:28 UTC Comment hidden (obsolete)
Comment 61 Tomás Cohen Arazi 2018-11-24 12:42:43 UTC Comment hidden (obsolete)
Comment 62 Tomás Cohen Arazi 2018-11-24 12:42:55 UTC Comment hidden (obsolete)
Comment 63 Tomás Cohen Arazi 2018-11-24 12:43:53 UTC Comment hidden (obsolete)
Comment 64 Jonathan Druart 2018-12-13 19:48:42 UTC
Sorry Tomas but I think we should use set_password (from bug 21178) now.
Comment 65 Tomás Cohen Arazi 2019-01-02 13:32:24 UTC
Created attachment 83579 [details] [review]
Bug 17006: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 66 Tomás Cohen Arazi 2019-01-02 13:32:32 UTC
Created attachment 83580 [details] [review]
Bug 17006: OpenAPI spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 67 Tomás Cohen Arazi 2019-01-02 13:32:41 UTC
Created attachment 83581 [details] [review]
Bug 17006: Add /patrons/{patron_id}/password

This patch introduces an endpoint for changing a patron's password. It
targets privileged user with the right permissions, changing some
patron's password.

To test:

- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_password.t
=> SUCCESS: tests pass!
- Play with the different use cases highlighted by the tests, on your
favourite REST testing tool (Postman, RESTer on FF, etc).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 68 Tomás Cohen Arazi 2019-01-02 13:37:02 UTC
As we voted for having a /public endpoint for unprivileged routes, I simplified the implementation and removed that use case. I will file a new bug for implementing the on/off switch for the /public namespace, and the endpoint for changing passwords for un-privileged users.
Comment 69 Josef Moravec 2019-01-09 15:13:35 UTC
Created attachment 83749 [details] [review]
Bug 17006: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 70 Josef Moravec 2019-01-09 15:13:40 UTC
Created attachment 83750 [details] [review]
Bug 17006: OpenAPI spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 71 Josef Moravec 2019-01-09 15:13:45 UTC
Created attachment 83751 [details] [review]
Bug 17006: Add /patrons/{patron_id}/password

This patch introduces an endpoint for changing a patron's password. It
targets privileged user with the right permissions, changing some
patron's password.

To test:

- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_password.t
=> SUCCESS: tests pass!
- Play with the different use cases highlighted by the tests, on your
favourite REST testing tool (Postman, RESTer on FF, etc).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 72 Kyle M Hall 2019-01-22 15:23:12 UTC
Created attachment 84285 [details] [review]
Bug 17006: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 73 Kyle M Hall 2019-01-22 15:23:24 UTC
Created attachment 84286 [details] [review]
Bug 17006: OpenAPI spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 74 Kyle M Hall 2019-01-22 15:23:28 UTC
Created attachment 84287 [details] [review]
Bug 17006: Add /patrons/{patron_id}/password

This patch introduces an endpoint for changing a patron's password. It
targets privileged user with the right permissions, changing some
patron's password.

To test:

- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons_password.t
=> SUCCESS: tests pass!
- Play with the different use cases highlighted by the tests, on your
favourite REST testing tool (Postman, RESTer on FF, etc).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 75 Tomás Cohen Arazi 2019-01-28 15:38:12 UTC
Created attachment 84488 [details] [review]
Bug 17006: (follow-up) set_password expects a hashref

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 76 Nick Clemens 2019-01-28 16:08:25 UTC
Awesome work all!

Pushed to master for 19.05
Comment 77 Martin Renvoize 2019-02-01 15:20:29 UTC
As is my policy on non-breaking api additions I have backported this to 18.11.x series for 18.11.03 release.

I have also added the missing `Sponsored-by: Municipal Libray Ceska Trebova` lines so due appreciation is shown in the release notes.
Comment 78 Lucas Gass 2019-02-06 22:23:10 UTC
missing dependencies, wont backport to 18.05.x