[Bug 20134] New: Remove /api/v1/app.pl from the generated URLs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Bug ID: 20134 Summary: Remove /api/v1/app.pl from the generated URLs Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com The REST api is exposed using /api/v1, but that is rewritten to hit /api/v1/app.pl/api/v1 (app.pl being a Mojolicious::Command wrapper for running in Mojolicious under Plack). The problem is that Mojolicious then creates URLs containing that unneeded /api/v1/app.pl prefix. We should strip that out. To reproduce: - Point your browser to http://your_host_name/api/v1/ (don't forget about the trailing slash) => FAIL: Notice basePath: "/api/v1/app.pl/api/v1" -- 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=20134 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 71239 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71239&action=edit Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D -- 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=20134 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|NEW |Needs Signoff -- 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=20134 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.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=20134 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- I just discovered that I can go to http://kohadev.mydnsname.org:8080/api/v1.html to have the API spec in a readable format, which is nice :) And also that it doesn't work in CGI mode (http://kohadev.mydnsname.org/api/v1/.json works curiously, but not the html version ; etc/koha-httpd.conf probably needs some changes) Anyway, the patch works, so, sign-off coming soon ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71239|0 |1 is obsolete| | --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 71244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71244&action=edit Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Julian Maurice <julian.maurice@biblibre.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=20134 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I get a not found trying to access: http://localhost:8080/api/v1 Am I missing something? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #5 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to Katrin Fischer from comment #4)
I get a not found trying to access: http://localhost:8080/api/v1
Am I missing something?
Working for me: http://localhost:8080/api/v1/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Josef, feel free to pass QA then - I think my devbox might just be a bit outdated. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #4)
I get a not found trying to access: http://localhost:8080/api/v1
Am I missing something?
Yes, the trailing slash. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hah! Will try again in the evening. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- ... and it sure was the trailing slash! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch 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=20134 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #71244|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 71325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=71325&action=edit Bug 20134: Remove /api/v1/app.pl from the generated URLs This patch removes the /api/v1/app.pl prefix from generated baseUrl. It has the consequence of hardcoding / as the base path for the API. This is ok because we don't currently support mounting Koha pieces in different than hardcoded paths (/cgi-bin/koha?), but certainly worth mentioning because this will need to depend on a syspref or config entry when someone chages this behviour. To test: - On master, point your browser to: http://kohadev.mydnsname.org:8080/api/v1/ => FAIL: basePath looks like /api/v1/app.pl/api/v1 - Apply this patch - Restart memcached and plack: $ restart_all or $ sudo systemctl restart memcached && sudo systemctl restart koha-common - Reload http://kohadev.mydnsname.org:8080/api/v1/ => SUCCESS: basePath is /api/v1 - Sign off :-D Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20134 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.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=20134 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Pushed to Master |Pushed to Stable --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all, pushed to stable for 17.11.03 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org