Description
David Cook
2024-08-02 01:34:33 UTC
Created attachment 169968 [details] [review] Bug 37553: Use CSRF token for authenicated session for POSTing This change fixes the Koha::SVC to store the CSRF token for the authenticated session for further POSTing. Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Created attachment 169974 [details] [review] Bug 37553: Consistently send Csrf-Token in request header This change consistently sends the Csrf-Token in the request header. Previously, one POST sent it in the request body, while the other POST sent it in the request header. Since we're using an API, it's best for us to always send it in the request header Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Created attachment 169976 [details] [review] Bug 37553: Tidy to make QA tools happy Created attachment 169977 [details] [review] Bug 37553: Use CSRF token for authenicated session for POSTing This change fixes the Koha::SVC to store the CSRF token for the authenticated session for further POSTing. Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Signed-off-by: David Nind <david@davidnind.com> Created attachment 169978 [details] [review] Bug 37553: Consistently send Csrf-Token in request header This change consistently sends the Csrf-Token in the request header. Previously, one POST sent it in the request body, while the other POST sent it in the request header. Since we're using an API, it's best for us to always send it in the request header Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Signed-off-by: David Nind <david@davidnind.com> Created attachment 169979 [details] [review] Bug 37553: Tidy to make QA tools happy Signed-off-by: David Nind <david@davidnind.com> Created attachment 169980 [details] [review] Bug 37553: Use CSRF token for authenicated session for POSTing This change fixes the Koha::SVC to store the CSRF token for the authenticated session for further POSTing. Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 169981 [details] [review] Bug 37553: Consistently send Csrf-Token in request header This change consistently sends the Csrf-Token in the request header. Previously, one POST sent it in the request body, while the other POST sent it in the request header. Since we're using an API, it's best for us to always send it in the request header Test plan: 0. Apply the patch 1. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 > bib-29.xml 2. perl ./misc/migration_tools/koha-svc.pl \ http://localhost:8081/cgi-bin/koha/svc koha koha 29 bib-29.xml 3. Note that the following appears in STDOUT and there is no 403 error: "update 29 from bib-29.xml" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 169982 [details] [review] Bug 37553: Tidy to make QA tools happy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.04 Not for 23.11.x |