[Bug 13799] New: Add base for building RESTful API
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Bug ID: 13799 Summary: Add base for building RESTful API Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13737 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36700 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36700&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 1/ Install Mojolicious Perl module 2/ Launch server with: $ morbo ./rest Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex.arnaud@biblibre.com, | |kyle@bywatersolutions.com, | |olli-antti.kivilahti@jns.fi -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36700|0 |1 is obsolete| | --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36705 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36705&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 Fixed patch with added dependency on Swagger2 module -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- This patch is actually testable on sandbox 16 where I installed the required dependencies. There is no special configuration, so it will run in CGI mode. Base URL: http://pro.test16.biblibre.com/cgi-bin/koha/rest -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |benjamin.rokseth@kul.oslo.k | |ommune.no --- Comment #4 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Tested this patch locally on a koha dev setup, and some remarks: * incredibly fast! ~50msec on 50 borrowers...promising! * few deps: apt-get install -y make cpanm cpanm Mojolicious cpanm Swagger2 * clean and little "glue-code" to Koha * self-documenting, in a way, with Swagger I propose that this POC is moved forward to a fully working example covering Borrowers, that can be part of Koha 3.20 if the New_REST_API_RFC (http://wiki.koha-community.org/wiki/New_REST_API_RFC) are fullfilled. What's missing now: - authentication - C4::Borrowers vs Koha::Borrowers? - versioning - content negotiation - full CRUD -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tom Misilo <misilot@fit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |misilot@fit.edu -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Benjamin Rokseth from comment #4)
Tested this patch locally on a koha dev setup, and some remarks:
* incredibly fast! ~50msec on 50 borrowers...promising! * few deps:
apt-get install -y make cpanm cpanm Mojolicious cpanm Swagger2
Yes, the dependancies will definitely need to be added to PerlDependancies.pm
* clean and little "glue-code" to Koha * self-documenting, in a way, with Swagger
I propose that this POC is moved forward to a fully working example covering Borrowers, that can be part of Koha 3.20 if the New_REST_API_RFC (http://wiki.koha-community.org/wiki/New_REST_API_RFC) are fullfilled.
I completely agree, this should definitely move forward!
What's missing now: - authentication
Yes, there are a number of ways for handle this: 1) The way /svc works now 2) Ability to pass in a auth_username and auth_password ( simpler, stateless, easy for command line use of /rest, only safe over https or from localhost ) 3) API tokens ( best idea, will require a whole separate feature ) I think one or both of the first two ways would be perfectly acceptable.
- C4::Borrowers vs Koha::Borrowers?
We should use this as an opportunity to take full advantage of the new Koha::Object system wherever possible.
- versioning
Versioning should be a simple matter ( as described in http://wiki.koha-community.org/wiki/New_REST_API_RFC )
- content negotiation
I personally think supporting JSON is adequate, but that's just my opinion. Supporting other formats would be great as long as we implement it at a low enough level that future developers will not have to deal with it ; ) I believe there is already a patch floating around that adds a to_json method to Koha::Object. We could add a method 'serialize' instead that takes a format and could output json, xml, yaml or whatever.
- full CRUD
Definitely! This is a great start! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36938 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36938&action=edit Bug 13799: Add versioning to API -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36941 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36941&action=edit Bug 13799: Use Koha::Objects This add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Not sure about the last patch, maybe there's a better way to transform Koha::Object(s) into JSON. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 37119 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37119&action=edit Bug 13799: Add Swagger UI documentation Move all API stuff into /api/v1 (except for Perl modules). So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification /api/v1/doc Swagger UI Add a virtual host in Apache configuration api.HOSTNAME So we have: http://api.HOSTNAME/v1/swagger.json Swagger specification http://api.HOSTNAME/v1/doc Swagger UI http://api.HOSTNAME/v1/{path} API endpoint To test, you need to: 1/ perl Makefile.PL 2/ make && make install 3/ Change etc/koha-httpd.conf and copy it to the right place if needed 4/ Reload Apache 5/ Go to http://api.HOSTNAME/v1/doc and check everything works 6/ Also check that http://api.HOSTNAME/v1/borrowers and http://api.HOSTNAME/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://api.HOSTNAME/vX/borrowers (where X is an integer greater than 1) returns a 404 error For the new vhost to work, you may need to modify your /etc/hosts file if you run Koha locally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 37132 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37132&action=edit Bug 13799: Move and fix unit test file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13895 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 37172 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37172&action=edit Bug 13799: Fix Koha::Objects::find when no results are found If we pass undef to Koha::Object::_new_from_dbic, it croaks with message "DBIC result type isn't of the type Borrower at Koha/Objects.pm" (in case we're using Koha::Borrowers->find) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13903 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13920 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13935 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Heather Braum <hbraum@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hbraum@nekls.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robin@catalyst.net.nz --- Comment #12 from Robin Sheat <robin@catalyst.net.nz> --- A couple of notes before I get into it too deeply: libmojolicious-perl in wheezy is 2.98, hopefully it'll work with that. Swagger2 isn't in Debian at all, but is probably buildable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #13 from Robin Sheat <robin@catalyst.net.nz> --- More comments: * version 6.0 is mandated in the dependencies. That's in no Debian release at all right now. We need to ensure it can work on wheezy. * the httpd conf stuff hasn't been updated in the packages. * the code is woefully underdocumented, some new files having exactly zero comments at all, let alone POD and copyright headers. Now to start looking into getting it actually running... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #14 from Robin Sheat <robin@catalyst.net.nz> --- So there's a bug in the version of tar that debian includes that means I can't currently build mojolicious. I'll have to find a workaround to that. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- It seems that Swagger2 can't work with Mojolicious versions packaged in Debian wheezy Tested with Mojolicious 2.98 (wheezy): $ perl -MSwagger2 -e '' Can't locate encode_json.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr /local/lib/site_perl .) at /usr/share/perl5/Mojo/Base.pm line 32. BEGIN failed--compilation aborted at /usr/local/share/perl/5.14.2/Swagger2.pm line 50. Compilation failed in require. BEGIN failed--compilation aborted. and with Mojolicious 3.97 (wheezy-backports) $ perl -MSwagger2 -e '' "encode_json" is not exported by the Mojo::JSON module "decode_json" is not exported by the Mojo::JSON module Can't continue after import errors at /usr/local/share/perl/5.14.2/Swagger2.pm line 50 BEGIN failed--compilation aborted at /usr/local/share/perl/5.14.2/Swagger2.pm line 50. Compilation failed in require. BEGIN failed--compilation aborted. With Mojolicious 5.54 (jessie) it works. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #16 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 38246 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38246&action=edit Bug 13799: Change Mojolicious minimum version required (5.54) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #17 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #16)
Created attachment 38246 [details] [review] Bug 13799: Change Mojolicious minimum version required (5.54)
That won't help because the version we need to support is 2.98. I would strongly suggest separating the documentation stuff into another bug, and making the API stuff work with mojolicious 2.98, and deal with the documentation separately and more leisurely. As it is, I can't see it getting in as no one will be able to run it without manually cpanning things, which isn't an option. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #18 from Julian Maurice <julian.maurice@biblibre.com> --- Swagger2 is not only for documentation. The API code needs Mojolicious::Plugin::Swagger2, which needs Swagger2, which needs Mojolicious >= 5.54 because Swagger2 fails to compile with a smaller version of Mojolicious. Anyway, Jessie will become the new stable in few days. Should we just wait before integrating this ? But what about swagger2, which is not packaged at all ? It is not the only Perl module that needs to be "cpanned" for Koha. So why should we block for this one ? Koha will continue to work without it. If really needed, it shouldn't be hard to make a Debian package of it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #19 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #18)
Anyway, Jessie will become the new stable in few days. Should we just wait before integrating this ?
We'd be waiting for a year or three, we're only dropping squeeze support as at 3.20.
But what about swagger2, which is not packaged at all ? It is not the only Perl module that needs to be "cpanned" for Koha. So why should we block for this one ? Koha will continue to work without it.
There are no modules that need to be cpanned for Koha, and if there are, that's a bug (with the exception of some test case things, I think.) I think having a significantly useful feature that can't be readily used isn't good, so I'm trying to get it to a point where it can work.
If really needed, it shouldn't be hard to make a Debian package of it.
At the moment, it's not particularly easy, as it needs a version of mojolicious that isn't packaged at all. I attempted to package that, but ran into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748244 which caused it to fail. I'll have another go when I get the chance, but depending on bleeding edge modules is always going to be problematic. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #20 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Robin Sheat from comment #19)
There are no modules that need to be cpanned for Koha, and if there are, that's a bug (with the exception of some test case things, I think.) I think having a significantly useful feature that can't be readily used isn't good, so I'm trying to get it to a point where it can work.
Ok, so just for pointing it out, required version of DBIx::Class::Schema::Loader (0.07039) is not in wheezy (0.07025-1), and not in debian.koha-community.org neither.
At the moment, it's not particularly easy, as it needs a version of mojolicious that isn't packaged at all. I attempted to package that, but ran into https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748244 which caused it to fail.
I'll have another go when I get the chance, but depending on bleeding edge modules is always going to be problematic.
How did you try to package it ? I just tried this morning and was successful packaging Mojolicious 6.08 and Swagger2 0.30 for wheezy (+ additionnal Mojo dependency IO::Socket::IP - packaged in wheezy but version too low) In the process, I had to make several other packages, but they are only build dependencies (Test::Warnings, Test::Deep, CPAN::Meta::Check) I only used dh-make-perl and debuild to build packages (and dpkg to install them). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #21 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- I tested this few weeks ago and I had no issues running them? Just installed from cpan. Maybe I missed something? I ran the manual test cases defined. We definetely should use the latest Mojolicious and Swagger2 implementations. No compromise here. Documentation and all in one bundle like it was meant to be. Very strange that the latest Mojolicious would be unavailable via packages. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #22 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #20)
Ok, so just for pointing it out, required version of DBIx::Class::Schema::Loader (0.07039) is not in wheezy (0.07025-1), and not in debian.koha-community.org neither.
That's not needed to run or build Koha. Only the release people need that. Also, IIRC it wasn't feasible to build it without upsetting half the rest of the system.
How did you try to package it ?
The proper way for upstreaming it. See here: https://lists.debian.org/debian-perl/2015/04/msg00009.html This is the proper way to build a package, as it bases it on the older existing version and hard work has generally been done for you.
I only used dh-make-perl and debuild to build packages (and dpkg to install them).
That won't result in a package acceptable to Debian. (In reply to Olli-Antti Kivilahti from comment #21)
I tested this few weeks ago and I had no issues running them? Just installed from cpan.
That's fine for testing, just not acceptable for distribution.
We definetely should use the latest Mojolicious and Swagger2 implementations. No compromise here.
No, that's wrong. We can't expect everyone to have it available, and we can't always build it for them. I'm still hopeful we can in this case, but unless that becomes possible, then we have problems.
Very strange that the latest Mojolicious would be unavailable via packages.
I am a little surprised by that too, to be honest. I would have at least expected it to be in git, unless it's because everyone else is being bitten by this tar bug too. When I get the chance, I'm going to try to downgrade tar to at least allow things to build. Of course, if someone wants to patch tar for me, that'd be great :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #23 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Robin Sheat from comment #22)
(In reply to Julian Maurice from comment #20)
I only used dh-make-perl and debuild to build packages (and dpkg to install them).
That won't result in a package acceptable to Debian.
But it will be acceptable to debian.koha-community.org, won't it ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.hedstrom.mace@sub.s | |u.se -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #24 from Chris Cormack <chris@bigballofwax.co.nz> --- (In reply to Julian Maurice from comment #23)
(In reply to Robin Sheat from comment #22)
(In reply to Julian Maurice from comment #20)
I only used dh-make-perl and debuild to build packages (and dpkg to install them).
That won't result in a package acceptable to Debian.
But it will be acceptable to debian.koha-community.org, won't it ?
No, we build proper packages for debian.koha-community.org and upstream them also. eg https://qa.debian.org/developer.php?login=robin@catalyst.net.nz this gets them into debian proper, and from there into ubuntu. Regardless of the packages, I think this should be split into a bunch of bugs, certainly shifting the documentation one off on to its on thing. I don't think we need to build any front end stuff for this. If we do that should be on it's on bug also. To get something like this in, its much better to do what was done with the acquisitions work, seperate bugs that don't mean the entire thing has to pass at once. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #25 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Chris Cormack from comment #24)
Regardless of the packages, I think this should be split into a bunch of bugs, certainly shifting the documentation one off on to its on thing. I don't think we need to build any front end stuff for this. If we do that should be on it's on bug also. To get something like this in, its much better to do what was done with the acquisitions work, seperate bugs that don't mean the entire thing has to pass at once.
I disagree. The "front end stuff" is the API documentation, and I don't think we can integrate the new API without a proper documentation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #26 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Robin Sheat from comment #19)
(In reply to Julian Maurice from comment #18)
Anyway, Jessie will become the new stable in few days. Should we just wait before integrating this ?
We'd be waiting for a year or three, we're only dropping squeeze support as at 3.20.
With 3.20 around the corner is this really an issue? It just means that it wouldn't be backportable to earlier versions of Koha, correct? Considering this is an enhancement I wouldn't expect it to be backported anyway. Are there other considerations I'm missing? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #27 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Julian Maurice from comment #25)
(In reply to Chris Cormack from comment #24)
Regardless of the packages, I think this should be split into a bunch of bugs, certainly shifting the documentation one off on to its on thing. I don't think we need to build any front end stuff for this. If we do that should be on it's on bug also. To get something like this in, its much better to do what was done with the acquisitions work, seperate bugs that don't mean the entire thing has to pass at once.
I disagree. The "front end stuff" is the API documentation, and I don't think we can integrate the new API without a proper documentation.
I would tend to agree with Julian on this. The documentation is part and parcel of the api. I don't see any advantage to splitting it into a separate bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #28 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Kyle M Hall from comment #26)
(In reply to Robin Sheat from comment #19)
(In reply to Julian Maurice from comment #18)
Anyway, Jessie will become the new stable in few days. Should we just wait before integrating this ?
We'd be waiting for a year or three, we're only dropping squeeze support as at 3.20.
With 3.20 around the corner is this really an issue? It just means that it wouldn't be backportable to earlier versions of Koha, correct? Considering this is an enhancement I wouldn't expect it to be backported anyway. Are there other considerations I'm missing?
Ignore this comment, I had my versions crossed. Any idea what the possibility of taking the package for Jesse and using it on Wheezy is? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #29 from Kyle M Hall <kyle@bywatersolutions.com> --- Another idea, can't we have a temporary package for Mojo even if it's not proper for upstreaming? Once the debian mojo package hit's the right version we could remove our own package. Would that work? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #30 from Chris Cormack <chris@bigballofwax.co.nz> --- This feels like making work for users and package maintainers, to make something arguably easier for developers. This is something that has made a mess for us a lot in the past. However, we probably should not be worrying about this, as it's missed the window for 3.20 already and be expending energy on testing and fixing bugs. We can argue about adding unnessecary dependencies again after the release. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #31 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Kyle M Hall from comment #28)
Ignore this comment, I had my versions crossed. Any idea what the possibility of taking the package for Jesse and using it on Wheezy is?
Dependency packages need to be actually built for the environment, we can't just grab a .deb file and throw it in. (In reply to Kyle M Hall from comment #29)
Another idea, can't we have a temporary package for Mojo even if it's not proper for upstreaming? Once the debian mojo package hit's the right version we could remove our own package. Would that work?
That's exactly what I'm trying to avoid. Now it's something I have to maintain for the next few years. Hence my policy being that if I can't make a package that can go into Debian, then I'm not really willing to put it into the Koha repo. This also forces me to check the package for overall worthiness (e.g. people depending on modules that have no copyright notice, therefore we can't legally redistribute - not the case here though, this is just simply unbuildable until I find a version of tar without the bug.) If you want to help out on this front, have a look here: http://wiki.koha-community.org/wiki/Building_Debian_Dependencies -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #32 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Robin Sheat from comment #31)
(In reply to Kyle M Hall from comment #28)
Ignore this comment, I had my versions crossed. Any idea what the possibility of taking the package for Jesse and using it on Wheezy is?
Dependency packages need to be actually built for the environment, we can't just grab a .deb file and throw it in.
I tried to build Mojolicious package for Wheezy from here: git://git.debian.org/git/pkg-perl/packages/libmojolicious-perl.git I had to install several *build* dependencies from Jessie, but the resulting binary package should work well on wheezy. In Jessie libmojolicious-perl depends on libjs-prettify which is not in Wheezy so I had to also build this package. Building source packages requires much more work, as there is a lot of build dependencies not packaged in wheezy, but do we need them ? (for libjs-prettify I retrieved files from packages.debian.org and built from there) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #33 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #32)
I tried to build Mojolicious package for Wheezy from here: git://git.debian.org/git/pkg-perl/packages/libmojolicious-perl.git
This is version 5.54 though. The problem is when you run uscan to create the DFSG-compliant source tarball of version 6.08, and swagger2 declares a dependency on Mojolicious 6.0+, so changing the minimum version that Koha requires doesn't change a whole lot.
I had to install several *build* dependencies from Jessie, but the resulting binary package should work well on wheezy. In Jessie libmojolicious-perl depends on libjs-prettify which is not in Wheezy so I had to also build this package. Building source packages requires much more work, as there is a lot of build dependencies not packaged in wheezy, but do we need them ?
We will need the source packages, because we need to build them. This is because we need to modify the changelogs to specify which pockets of the repo it's going to go into. I avoid doing it in hacky ways, or ways that are not Debian-compliant, because that ends up causing maintenance headaches and more unnecessary work in the long run, and will also interfere with my planned efforts to automate some parts of this process. All this said, I just downgraded tar in my package building VM to the version from squeeze, and uscan succeeds. So there is hope yet. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #34 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Robin Sheat from comment #33)
All this said, I just downgraded tar in my package building VM to the version from squeeze, and uscan succeeds. So there is hope yet.
Yay! \o/ About 5.54 vs 6.0, maybe we could ask the author of Swagger2 to change the required version of Mojolicious (if Swagger2 is proven to work with 5.54 of course). What do you think ? Will that make things easier ? On the other hand, having the latest version of Mojolicious into Debian would be great if this doesn't require extra work. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #35 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #34)
About 5.54 vs 6.0, maybe we could ask the author of Swagger2 to change the required version of Mojolicious (if Swagger2 is proven to work with 5.54 of course). What do you think ? Will that make things easier ?
It certainly would, but it might be the difference between 5 minutes and half and hour, or 5 minutes and 5 weeks :) it remains to be seen. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #36 from Julian Maurice <julian.maurice@biblibre.com> --- Just asked: https://github.com/jhthorsen/swagger2/issues/14 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #37 from Julian Maurice <julian.maurice@biblibre.com> --- New version of Swagger2 on CPAN (0.31) now requires Mojolicious 5.54 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |new feature -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36705|0 |1 is obsolete| | --- Comment #38 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39156 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39156&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 1/ Install Mojolicious Perl module 2/ Launch server with: $ morbo ./rest Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #39 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Darn, messed up order when fixing resolve issue on first patch. Will fix ASAP -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36705|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39156|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36705|0 |1 is obsolete| | Attachment #36938|0 |1 is obsolete| | Attachment #36941|0 |1 is obsolete| | Attachment #37119|0 |1 is obsolete| | Attachment #37132|0 |1 is obsolete| | Attachment #37172|0 |1 is obsolete| | Attachment #38246|0 |1 is obsolete| | --- Comment #40 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39158 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39158&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 1/ Install Mojolicious Perl module 2/ Launch server with: $ morbo ./rest Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #41 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39159 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39159&action=edit Bug 13799: Add versioning to API -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #42 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39160 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39160&action=edit Bug 13799: Use Koha::Objects This add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #43 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39161 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39161&action=edit Bug 13799: Add Swagger UI documentation Move all API stuff into /api/v1 (except for Perl modules). So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification /api/v1/doc Swagger UI Add a virtual host in Apache configuration api.HOSTNAME So we have: http://api.HOSTNAME/v1/swagger.json Swagger specification http://api.HOSTNAME/v1/doc Swagger UI http://api.HOSTNAME/v1/{path} API endpoint To test, you need to: 1/ perl Makefile.PL 2/ make && make install 3/ Change etc/koha-httpd.conf and copy it to the right place if needed 4/ Reload Apache 5/ Go to http://api.HOSTNAME/v1/doc and check everything works 6/ Also check that http://api.HOSTNAME/v1/borrowers and http://api.HOSTNAME/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://api.HOSTNAME/vX/borrowers (where X is an integer greater than 1) returns a 404 error For the new vhost to work, you may need to modify your /etc/hosts file if you run Koha locally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #44 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39162 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39162&action=edit Bug 13799: Move and fix unit test file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #45 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39163 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39163&action=edit Bug 13799: Fix Koha::Objects::find when no results are found If we pass undef to Koha::Object::_new_from_dbic, it croaks with message "DBIC result type isn't of the type Borrower at Koha/Objects.pm" (in case we're using Koha::Borrowers->find) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #46 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 39164 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39164&action=edit Bug 13799: Change Mojolicious minimum version required (5.54) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Ere Maijala <ere.maijala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ere.maijala@helsinki.fi -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #47 from Robin Sheat <robin@catalyst.net.nz> --- libmojolicious-perl_5.54+dfsg-1~koha1_all.deb (etc.) and libjs-prettify_2013.03.04+dfsg-4~koha1_all.deb (etc.) are now in the repo. I had to install Java on my build vm to get that last one to build. I hope you're happy! ;) Now to look into swagger2. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #48 from Robin Sheat <robin@catalyst.net.nz> --- And, libswagger2-perl is in the repo now too. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #49 from Julian Maurice <julian.maurice@biblibre.com> --- Great! Thanks Robin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #50 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Wow! Awesome work! Good karma! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- What are the next steps here? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #52 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Katrin Fischer from comment #51)
What are the next steps here?
Someone to do some testing and signoffing. It's on my list to look at. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39158|0 |1 is obsolete| | --- Comment #53 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40088 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40088&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 1/ Install Mojolicious Perl module 2/ Launch server with: $ morbo ./rest Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39163|0 |1 is obsolete| | --- Comment #54 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Comment on attachment 39163 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39163 Bug 13799: Fix Koha::Objects::find when no results are found Bug 13799: Fix Koha::Objects::find when no results are found is obsoleted now by Bug 13967 - System preferences need a package ?? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #55 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Olli-Antti Kivilahti from comment #54)
Comment on attachment 39163 [details] [review] Bug 13799: Fix Koha::Objects::find when no results are found
Bug 13799: Fix Koha::Objects::find when no results are found is obsoleted now by Bug 13967 - System preferences need a package ??
I think so. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #56 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40092 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40092&action=edit Bug 13799 - Adding the REST API as a Hypnotoad service, koha-api-daemon. After running make, the koha-api-daemon.sh -script should be in ../koha-dev/bin/koha-api-daemon.sh Link it to the init-directory and set up upstart triggers: ..$ ln -s /home/koha/koha-dev/bin/koha-api-daemon.sh /etc/init.d/koha-api-daemon ..$ update-rc.d koha-api-daemon defaults Start hypnotoad: ..$ service koha-api-daemon start Hypnotoad is now listening in 127.0.0.1:8080 and is preconfigured to be production ready. Hypnotoad config is in $KOHA_PATH/api/v1/hypnotoad.conf -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #57 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40093 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40093&action=edit Bug 13799 - Nginx reverse proxy config baseline for Koha REST API. Tweaking needed to work with makefile. Uses a self-signed SSL-certificate to service at port 444 by default. Reverse proxies to 127.0.0.1:8080 (expecting hypnotoad to be listening) ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤¤ Koha API Nginx configuration ¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Deploy the Nginx configuration ------------------------------ Run make to populate the koha-nginx-kohaapi.conf link to the /etc/nginx/sites-available/ -directory ..$ ln -s /home/koha/koha-dev/etc/koha-nginx-kohaapi.conf /etc/nginx/sites-available/kohaapi and enable with command ..$ ln -s /etc/nginx/sites-available/kohaapi /etc/nginx/sites-enabled/kohaapi Disable the default config ..$ rm /etc/nginx/sites-enabled/default Create a openssl self-signed certificate or use your own. --------------------------------------------------------- ..$ cd /etc/nginx ..$ mkdir ssl ..$ chmod 400 ssl ..$ cd ssl ..$ openssl req -x509 -sha256 -newkey rsa:2048 -keyout key.pem.secure -out cert.pem -days 720 ..$ openssl rsa -in key.pem.secure -out key.pem ..$ chmod 400 * Restart nginx ..$ service nginx restart -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #58 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40094 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40094&action=edit Bug 13799 - Set up logging for Mojolicious. Somebody smarter can set the logging path as dynamic. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #59 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40098 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40098&action=edit Bug 13799 - Set up logging and configuration file reading for Mojolicious. Use environmental values to control some aspects of Mojolicious: This way we can have different settings for different servers running Mojolicious. %%%% Configuration file %%%% $ENV{MOJO_CONFIG} should be set in the system service (init) starting Mojolicious, eg: export MOJO_CONFIG=/home/koha/kohaclone/api/v1/hypnotoad.conf This configuration file read by the Mojolicious::Plugin::Config http://mojolicio.us/perldoc/Mojolicious/Plugin/Config %%%%% Logging %%%%% Log to a filename configured in an environemnt variable $ENV{MOJO_LOGFILE} using loglevel $ENV{MOJO_LOGLEVEL}. Defaults to '/tmp/koha-api.log' and loglevel of 'error' Examples: export MOJO_LOGFILE=/home/koha/koha-dev/var/log/kohaapi.mojo.log export MOJO_LOGLEVEL=debug Logging is done by Mojo::Log http://www.mojolicio.us/perldoc/Mojo/Log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40094|0 |1 is obsolete| | --- Comment #60 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Comment on attachment 40094 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40094 Bug 13799 - Set up logging for Mojolicious.
From 17fe4147396127c87be5d0270ad78a7d44576cd5 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> Date: Thu, 11 Jun 2015 17:48:54 +0300 Subject: [PATCH] Bug 13799 - Set up logging for Mojolicious.
Somebody smarter can set the logging path as dynamic. --- Koha/REST/V1.pm | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 3becf12..197c17b 100644 --- a/Koha/REST/V1.pm +++ b/Koha/REST/V1.pm @@ -2,10 +2,14 @@ package Koha::REST::V1;
use Modern::Perl; use Mojo::Base 'Mojolicious'; +use Mojo::Log;
sub startup { my $self = shift;
+ $self->app->log( Mojo::Log->new( path => "/home/koha/koha-dev/var/log/kohaapi.mojo.log", level => 'debug' ) ); + + my $route = $self->routes->under->to( cb => sub { my $c = shift; -- 1.7.9.5
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40092|0 |1 is obsolete| | --- Comment #61 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40099 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40099&action=edit Bug 13799 - Adding the REST API as a Hypnotoad service, koha-api-daemon. After running make, the koha-api-daemon.sh -script should be in ../koha-dev/bin/koha-api-daemon.sh Link it to the init-directory and set up upstart triggers: ..$ ln -s /home/koha/koha-dev/bin/koha-api-daemon.sh /etc/init.d/koha-api-daemon ..$ update-rc.d koha-api-daemon defaults Start hypnotoad: ..$ service koha-api-daemon start Hypnotoad is now listening in 127.0.0.1:8080 and is preconfigured to be production ready. Hypnotoad config is in $KOHA_PATH/api/v1/hypnotoad.conf For more info, read the koha-api-daemon.sh -service -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40093|0 |1 is obsolete| | --- Comment #62 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40101 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40101&action=edit Bug 13799 - Nginx reverse proxy config baseline for Koha REST API. Tweaking needed to work with makefile. Uses a self-signed SSL-certificate to service at port 444 by default. Reverse proxies to 127.0.0.1:8080 (expecting hypnotoad to be listening) ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤¤ Koha API Nginx configuration ¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Deploy the Nginx configuration ------------------------------ Run make to populate the koha-nginx-kohaapi.conf link to the /etc/nginx/sites-available/ -directory ..$ ln -s /home/koha/koha-dev/etc/koha-nginx-kohaapi.conf /etc/nginx/sites-available/kohaapi and enable with command ..$ ln -s /etc/nginx/sites-available/kohaapi /etc/nginx/sites-enabled/kohaapi Disable the default config ..$ rm /etc/nginx/sites-enabled/default Create a openssl self-signed certificate or use your own. --------------------------------------------------------- ..$ cd /etc/nginx ..$ mkdir ssl ..$ chmod 400 ssl ..$ cd ssl ..$ openssl req -x509 -sha256 -newkey rsa:2048 -keyout key.pem.secure -out cert.pem -days 720 ..$ openssl rsa -in key.pem.secure -out key.pem ..$ chmod 400 * Restart nginx ..$ service nginx restart -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #63 from Robin Sheat <robin@catalyst.net.nz> --- How will that interact with Plack? Environment variables aren't the easiest thing to pass through to that at this stage. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #64 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- (In reply to Robin Sheat from comment #63)
How will that interact with Plack? Environment variables aren't the easiest thing to pass through to that at this stage.
I think this will be overwritten by plack. I just created this system because there was no other system published in bugzilla for me to start building stuff on top of the Koha REST API. I think the big question is how to pass variables to Mojolicious app, without using env-variables. I don't know and the solution is good enough for me. What I would be worried of, is the redirection of STDERR and STDOUT to /dev/null in Mojo::Server::damonize(). Thus logging those streams from the service-script doesn't work, but it works when running Mojolicious directly from the terminal. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #65 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Maybe we could add some of the open questions/topics to the wiki? The next dev meeting is supposed to be mostly about the RESTful API. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40098|0 |1 is obsolete| | --- Comment #66 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40140 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40140&action=edit Bug 13799 - Set up logging and configuration file reading for Mojolicious. Use environmental values to control some aspects of Mojolicious: This way we can have different settings for different servers running Mojolicious. %%%% Configuration file %%%% $ENV{MOJO_CONFIG} should be set in the system service (init) starting Mojolicious, eg: export MOJO_CONFIG=/home/koha/kohaclone/api/v1/hypnotoad.conf This configuration file read by the Mojolicious::Plugin::Config http://mojolicio.us/perldoc/Mojolicious/Plugin/Config %%%%% Logging %%%%%
NOTE!! There is a "feature" in Mojo::Server disabling STDOUT and STDERR, because such errors are not-suited-for-prod~ This modification in Mojo::Server disables this and preserves the STD* handles for forked server threads in Mojo::Server::daemonize(), comment out the following lines
# Close filehandles # open STDOUT, '>/dev/null'; # open STDERR, '>&STDOUT';
Log to a filename configured in an environemnt variable $ENV{MOJO_LOGFILE} using loglevel $ENV{MOJO_LOGLEVEL}. Defaults to '/tmp/koha-api.log' and loglevel of 'error' Examples: export MOJO_LOGFILE=/home/koha/koha-dev/var/log/kohaapi.mojo.log export MOJO_LOGLEVEL=debug Logging is done by Mojo::Log http://www.mojolicio.us/perldoc/Mojo/Log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40099|0 |1 is obsolete| | --- Comment #67 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40141 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40141&action=edit Bug 13799 - Adding the REST API as a Hypnotoad service, koha-api-daemon. After running make, the koha-api-daemon.sh -script should be in ../koha-dev/bin/koha-api-daemon.sh Link it to the init-directory and set up upstart triggers: ..$ ln -s /home/koha/koha-dev/bin/koha-api-daemon.sh /etc/init.d/koha-api-daemon ..$ update-rc.d koha-api-daemon defaults Start hypnotoad: ..$ service koha-api-daemon start Hypnotoad is now listening in 127.0.0.1:8080 and is preconfigured to be production ready. Hypnotoad config is in $KOHA_PATH/api/v1/hypnotoad.conf For more info, read the koha-api-daemon.sh -service -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40141|0 |1 is obsolete| | --- Comment #68 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40142 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40142&action=edit Bug 13799 - Adding the REST API as a Hypnotoad service, koha-api-daemon. After running make, the koha-api-daemon.sh -script should be in ../koha-dev/bin/koha-api-daemon.sh Link it to the init-directory and set up upstart triggers: ..$ ln -s /home/koha/koha-dev/bin/koha-api-daemon.sh /etc/init.d/koha-api-daemon ..$ update-rc.d koha-api-daemon defaults Start hypnotoad: ..$ service koha-api-daemon start Hypnotoad is now listening in 127.0.0.1:8080 and is preconfigured to be production ready. Hypnotoad config is in $KOHA_PATH/api/v1/hypnotoad.conf For more info, read the koha-api-daemon.sh -service -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40088|0 |1 is obsolete| | --- Comment #69 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40463 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40463&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39159|0 |1 is obsolete| | --- Comment #70 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40464 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40464&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39160|0 |1 is obsolete| | --- Comment #71 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40465 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40465&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39161|0 |1 is obsolete| | --- Comment #72 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40466 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40466&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39162|0 |1 is obsolete| | --- Comment #73 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40467 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40467&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39164|0 |1 is obsolete| | --- Comment #74 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40468 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40468&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40140|0 |1 is obsolete| | --- Comment #75 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40469&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40142|0 |1 is obsolete| | --- Comment #76 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40470&action=edit Rebased -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40101|0 |1 is obsolete| | --- Comment #77 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40471 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40471&action=edit Bug 13799 - Nginx reverse proxy config baseline for Koha REST API. Tweaking needed to work with makefile. Uses a self-signed SSL-certificate to service at port 444 by default. Reverse proxies to 127.0.0.1:8080 (expecting hypnotoad to be listening) ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ ¤¤ Koha API Nginx configuration ¤¤ ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ Deploy the Nginx configuration ------------------------------ Run make to populate the koha-nginx-kohaapi.conf link to the /etc/nginx/sites-available/ -directory ..$ ln -s /home/koha/koha-dev/etc/koha-nginx-kohaapi.conf /etc/nginx/sites-available/kohaapi and enable with command ..$ ln -s /etc/nginx/sites-available/kohaapi /etc/nginx/sites-enabled/kohaapi Disable the default config ..$ rm /etc/nginx/sites-enabled/default Create a openssl self-signed certificate or use your own. --------------------------------------------------------- ..$ cd /etc/nginx ..$ mkdir ssl ..$ chmod 400 ssl ..$ cd ssl ..$ openssl req -x509 -sha256 -newkey rsa:2048 -keyout key.pem.secure -out cert.pem -days 720 ..$ openssl rsa -in key.pem.secure -out key.pem ..$ chmod 400 * Restart nginx ..$ service nginx restart -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #78 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Olli, while I'm not against the idea to moving into nginx and/or hypnotoad, I think putting this patches here just make more confusion. If it is possible, could you please move your integration work into the wiki? So on this bug we discuss the REST patches only? If you have a serious proposal of moving away from Apache, you should definitely put that on a new bug report. AS I see it, your patch(es) aid testing the REST implementation, so they are really useful. Just move them outside this specific bug. Please :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #79 from Julian Maurice <julian.maurice@biblibre.com> --- Also Olli, you replaced all patch titles by 'Rebased', making it harder to see which patch does what. Could you please fix that ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #80 from Jonathan Druart <jonathan.druart@biblibre.com> --- Julian, 1) This needs a squash, to avoid add/del of the same file/dir in the same patch set and an up-to-date test plan. 2) /v1/doc returns "Page not found... yet!" 3) /v1/borrowers/7853 Check the encoding, I get "address2":"éééصةصةصة" With MariaDB [koha]> select address2 from borrowers where borrowernumber=7874\G *************************** 1. row *************************** address2: éééصةصةصة -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14448 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #81 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40551 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40551&action=edit Bug 13799: REST API proof of concept with Mojolicious/Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #82 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40552 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40552&action=edit Bug 13799: Add versioning to API -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40469|0 |1 is obsolete| | --- Comment #82 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40552 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40552&action=edit Bug 13799: Add versioning to API --- Comment #83 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 40469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40469 Rebased Patch moved to new bug 14448 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #84 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40553 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40553&action=edit Bug 13799: Use Koha::Objects -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #85 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40554 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40554&action=edit Bug 13799: Add Swagger UI documentation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40470|0 |1 is obsolete| | --- Comment #86 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 40470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40470 Rebased Patch moved to new bug 14448 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40471|0 |1 is obsolete| | --- Comment #87 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 40471 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40471 Bug 13799 - Nginx reverse proxy config baseline for Koha REST API. Tweaking needed to work with makefile. Patch moved to new bug 14448 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40463|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40464|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40465|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40466|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40467|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40468|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40551|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40552|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40553|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40554|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #88 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 40560 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40560&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification /api/v1/doc Swagger UI (documentation) Add a virtual host in Apache configuration api.HOSTNAME So we have: http://api.HOSTNAME/v1/swagger.json Swagger specification http://api.HOSTNAME/v1/doc Swagger UI (documentation) http://api.HOSTNAME/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Go to http://api.HOSTNAME/v1/doc and check everything works 7/ Also check that http://api.HOSTNAME/v1/borrowers and http://api.HOSTNAME/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://api.HOSTNAME/vX/borrowers (where X is an integer greater than 1) returns a 404 error For the new vhost to work, you may need to modify your /etc/hosts file if you run Koha locally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #89 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 40561 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40561&action=edit Bug 13799: Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #90 from Julian Maurice <julian.maurice@biblibre.com> --- Squashed all patches + minor encoding bug fix -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #91 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40584 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40584&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #92 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40585 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40585&action=edit Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #93 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40586 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40586&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #94 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40587 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40587&action=edit Bug 13799 - 4. Add base for building RESTful API - Fix missing character encoding in the index.html -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40560|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40561|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #95 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- The order of applying these following bugs is as follow: 13799 -> 13895 -> 13903 -> 13920 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14458 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40584|0 |1 is obsolete| | --- Comment #96 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 40616 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40616&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Add a virtual host in Apache configuration api.HOSTNAME So we have: http://api.HOSTNAME/v1/swagger.json Swagger specification http://api.HOSTNAME/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://api.HOSTNAME/v1/borrowers and http://api.HOSTNAME/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://api.HOSTNAME/vX/borrowers (where X is an integer greater than 1) returns a 404 error For the new vhost to work, you may need to modify your /etc/hosts file if you run Koha locally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40585|0 |1 is obsolete| | --- Comment #97 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 40617 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40617&action=edit Bug 13799: 2. Set up logging and configuration file reading for Mojolicious. Use environmental values to control some aspects of Mojolicious: This way we can have different settings for different servers running Mojolicious. %%%% Configuration file %%%% $ENV{MOJO_CONFIG} should be set in the system service (init) starting Mojolicious, eg: export MOJO_CONFIG=/home/koha/kohaclone/api/v1/hypnotoad.conf This configuration file read by the Mojolicious::Plugin::Config http://mojolicio.us/perldoc/Mojolicious/Plugin/Config %%%%% Logging %%%%% NOTE!! There is a "feature" in Mojo::Server disabling STDOUT and STDERR, because such errors are not-suited-for-prod~ This modification in Mojo::Server disables this and preserves the STD* handles for forked server threads in Mojo::Server::daemonize(), comment out the following lines # Close filehandles # open STDOUT, '>/dev/null'; # open STDERR, '>&STDOUT'; Log to a filename configured in an environemnt variable $ENV{MOJO_LOGFILE} using loglevel $ENV{MOJO_LOGLEVEL}. Defaults to '/tmp/koha-api.log' and loglevel of 'error' Examples: export MOJO_LOGFILE=/home/koha/koha-dev/var/log/kohaapi.mojo.log export MOJO_LOGLEVEL=debug Logging is done by Mojo::Log http://www.mojolicio.us/perldoc/Mojo/Log -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40586|0 |1 is obsolete| | --- Comment #98 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 40618 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40618&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40587|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #99 from Julian Maurice <julian.maurice@biblibre.com> --- Swagger UI removed from the first patch and moved in its own bug 14458 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #100 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40619 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40619&action=edit Bug 13799 - 4. Add base for building RESTful API - Fix missing character encoding in the index.html -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40619|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14455 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Bug 13799 depends on bug 14455, which changed state. Bug 14455 Summary: Instructions to set up Koha REST API inspectors like Swagger UI or postman http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14455 What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40616|0 |1 is obsolete| | --- Comment #101 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41160 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41160&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40617|0 |1 is obsolete| | --- Comment #102 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41161 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41161&action=edit Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40618|0 |1 is obsolete| | --- Comment #103 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41162 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41162&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41160|0 |1 is obsolete| | --- Comment #104 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41268 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41268&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41161|0 |1 is obsolete| | --- Comment #105 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41269 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41269&action=edit Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41162|0 |1 is obsolete| | --- Comment #106 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41270 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41270&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #107 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41271 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41271&action=edit Bug 13799: 4. API Authentication, part 1: API keys management in interface Depends on Buugg 14539 and Buugg 7174. This introduces the concept of API keys for use in the new REST API. A key is a string of 32 alphanumerical characters (32 is purely arbitrary, it can be changed easily). A user can have multiple keys (unlimited at the moment) Keys can be generated automatically, and then we have the possibility to delete or revoke each one individually. ApiKeys can be easily accessed using the Koha::ApiKeys-package. Includes unit tests and selenium integration tests for Intra and OPAC. Test plan: 1/ Go to staff interface 2/ Go to a borrower page 3/ In toolbar, click on More -> Manage API keys 4/ Click on "Generate new key" multiple times, check that they are correctly displayed under the button, and they are active by default 5/ Revoke some keys, check that they are not active anymore 6/ Delete some keys, check that they disappear from table 7/ Go to opac interface, log in 8/ In your user account pages, you now have a new tab to the left "your API keys". Click on it. 9/ Repeat steps 4-6 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #108 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41272 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41272&action=edit Bug 13799: 5. API authentication system - Swagtenticator authentication Reads the Swagger2 definitions and defines the API routes and controllers for Mojolicious. Authentiates the API consumer using Koha::Auth::Challenge::RESTV1 with all the necessary details inferred from Swagger2, like permissions. Validates all input to match the Swagger2 definition. Authentication is based on the permissions defined in the Swagger2 definition. Add x-koha-permission to the Operation Object to define needed Koha permissions to access the resource. Eg. "/borrowers/{borrowernumber}": { "get": { "x-mojo-controller": "Koha::REST::V1::Borrowers", "x-koha-permission": { "borrowers": "*" }, "operationId": "getBorrower", "tags": ["borrowers"], -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #109 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41273 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41273&action=edit Bug 13799 - 6. REST API Testing framework Introduces the Swagger2TestRunner which takes care of authentication and API consumer creation behind the scenes, and makes sure all API endpoints get test coverage. This way the test automator can focus on testing the business logic instead of duplicating authentication and API consumer creation in various test scripts. Run t/db_dependent/Api/V1/testREST.pl and it will tell you what you need to do. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #110 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41274 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41274&action=edit Schematic of the API components -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #111 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- *** Bug 13920 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|14455 |7174 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7174 [Bug 7174] Authentication rewriting http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14455 [Bug 14455] Instructions to set up Koha REST API inspectors like Swagger UI or postman -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #112 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41320 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41320&action=edit Bug 13799 - 1.1 RESTful API with reverse proxy configuration without api.host.domain OPTIONAL replacement to the Buugg 13799: 1. RESTful API with Mojolicious and Swagger2 httpd-configuration. Instead of having to go to your dns-provider, you can run the api from your current virtualhost. Use these configurations to reverse proxy www.host.domain/v1/ to the REST API. --------------------------- :INSTALLATION INSTRUCTIONS: --------------------------- You need Buugg 14448 - Adding the REST API as a Hypnotoad service, koha-api-daemon. to deploy the backend Mojolicous application as a FastCGI-daemon. Then add the modifications from etc/koha-httpd.conf to your /etc/apache2/sites-enabled/koha.conf and adjust paths to fit. ..$ a2enmod proxy ..$ a2enmod proxy_http ..$ service apache2 restart Much recommended is Buugg 14458: 5. Add SwaggerUI documentation for RESTful API to browse your API capabilities. Then just go to /v1/doc to see the API autodocumentation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41271|0 |1 is obsolete| | --- Comment #113 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41321 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41321&action=edit Bug 13799: 4. API Authentication, part 1: API keys management in interface -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41268|0 |1 is obsolete| | --- Comment #114 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41326 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41326&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41320|0 |1 is obsolete| | --- Comment #115 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41327 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41327&action=edit Bug 13799 - 1.1 RESTful API with reverse proxy configuration without api.host.domain -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41269|0 |1 is obsolete| | --- Comment #116 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41328 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41328&action=edit Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41270|0 |1 is obsolete| | --- Comment #117 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41329 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41329&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41321|0 |1 is obsolete| | --- Comment #118 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41330 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41330&action=edit Bug 13799: 4. API Authentication, part 1: API keys management in interface -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41272|0 |1 is obsolete| | --- Comment #119 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41331 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41331&action=edit Bug 13799: 5. API authentication system - Swagtenticator authentication -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14656 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14656 [Bug 14656] Delete Bibliographic Records REST API route & permission -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41326|0 |1 is obsolete| | --- Comment #120 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41538 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41538&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41327|0 |1 is obsolete| | --- Comment #121 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41539 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41539&action=edit Bug 13799 - 1.1 RESTful API with reverse proxy configuration without api.host.domain -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41328|0 |1 is obsolete| | --- Comment #122 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41540&action=edit Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41329|0 |1 is obsolete| | --- Comment #123 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41541 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41541&action=edit Bug 13799: 3. Force UTF-8 charset in responses -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41330|0 |1 is obsolete| | --- Comment #124 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41542 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41542&action=edit Bug 13799: 4. API Authentication, part 1: API keys management in interface -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41331|0 |1 is obsolete| | --- Comment #125 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41543 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41543&action=edit Bug 13799: 5. API authentication system - Swagtenticator authentication -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41273|0 |1 is obsolete| | --- Comment #126 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41547 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41547&action=edit Bug 13799 - 6. REST API Testing framework -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41538|0 |1 is obsolete| | --- Comment #127 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 41554 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41554&action=edit Bug 13799: 1. RESTful API with Mojolicious and Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14746 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14746 [Bug 14746] Set up logging and configuration file reading for Mojolicious -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41540|0 |1 is obsolete| | --- Comment #128 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 41540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41540 Bug 13799 - 2. Set up logging and configuration file reading for Mojolicious. Patch moved to bug 14746 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14747 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14747 [Bug 14747] RESTful API with reverse proxy configuration -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41539|0 |1 is obsolete| | --- Comment #129 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 41539 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41539 Bug 13799 - 1.1 RESTful API with reverse proxy configuration without api.host.domain Patch moved to bug 14747 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41542|0 |1 is obsolete| | --- Comment #130 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 41542 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41542 Bug 13799: 4. API Authentication, part 1: API keys management in interface Patch moved to bug 13920 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41543|0 |1 is obsolete| | --- Comment #131 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 41543 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41543 Bug 13799: 5. API authentication system - Swagtenticator authentication Patch moved to bug 13920 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14748 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14748 [Bug 14748] REST API Testing framework -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41547|0 |1 is obsolete| | --- Comment #132 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 41547 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41547 Bug 13799 - 6. REST API Testing framework Patch moved to bug 14748 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41541|0 |1 is obsolete| | Attachment #41554|0 |1 is obsolete| | --- Comment #133 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 42044 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42044&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/v1/borrowers and http://(OPAC|INTRANET)/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41274|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|7174 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7174 [Bug 7174] Authentication rewriting -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #134 from Julian Maurice <julian.maurice@biblibre.com> --- All patches moved to their own bugs so we have a simple patch that just works (I hope...) and without a huge dependency tree. It should make testing a lot easier. A feature is still missing however: the cookie-based authentication. I'll try to work on that soon. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #135 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Julian Maurice from comment #134)
A feature is still missing however: the cookie-based authentication. I'll try to work on that soon. ... but feel free to test the patch right now! :)
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14749 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14749 [Bug 14749] Add API route to get top issues -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14723 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14723 [Bug 14723] Additional delivery notes to messages -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42044|0 |1 is obsolete| | --- Comment #136 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 42085 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42085&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/v1/borrowers and http://(OPAC|INTRANET)/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42085|0 |1 is obsolete| | --- Comment #137 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 42086 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42086&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/api/v1/borrowers and http://(OPAC|INTRANET)/api/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #138 from Alex Arnaud <alex.arnaud@biblibre.com> --- reattached the patch because i've changed the webservices url in the commit message (http://(OPAC|INTRANET)/api/v1/borrowers instead of http://(OPAC|INTRANET)/v1/borrowers) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #139 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 42123 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42123&action=edit Bug 13799: Add cookie-based authentication to REST API -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #140 from Julian Maurice <julian.maurice@biblibre.com> --- The 'borrowers' permission is required for both /borrowers and /borrowers/XXXX except if XXXX is the borrowernumber of the loggedinuser Test plan for authentication: 1/ Log in to staff interface with a borrower that have 'borrowers' permission 2/ Go to http://INTRANET/api/v1/borrowers and http://INTRANET/api/v1/borrowers/XXXX (where XXXX is a valid borrowernumber). You should see borrowers data 3/ Remove the 'borrowers' permission 4/ Go to http://INTRANET/api/v1/borrowers. You should see an error (and HTTP code 403) 5/ Go to http://INTRANET/api/v1/borrowers/XXXX (where XXXX is a valid borrowernumber different from the logged-in user's borrowernumber). You should see an error (and HTTP code 403) 6/ Go to http://INTRANET/api/v1/borrowers/XXXX (where XXXX is the logged-in user's borrowernumber). You should see borrower's data. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Large patch CC| |z.tajoli@cineca.it --- Comment #141 from Zeno Tajoli <z.tajoli@cineca.it> --- Patch complexity is 'Large' because this change has many architectural connections -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|14723 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14723 [Bug 14723] Additional delivery notes to messages -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|z.tajoli@cineca.it | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #142 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Hi there! We cannot push this bug to master without also pushing Bugs 13920 and Bug 14748. Bug 14748 doesn't need to be implemented like I implemented it, but we must have a established and formal way of doing the complete authentication, permission checking and formal enforced testing, before unleashing this monster to master. If we push just this Bug, people will start creating features on top of this one, and then we will lose the opportunity to integrate automatic documentation driven permission checking and a formal testing framework (which simplifies test writing a lot). It will be much harder to include them later on. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #143 from Julian Maurice <julian.maurice@biblibre.com> --- Yes, we can, and we should, as we agreed on that during the previous dev meeting. It's better to have a tiny patch in master than a big, full-featured patch that will never be pushed because of its complexity. And the API key authentication system needs some discussion, as some people disagree with it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #144 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 42518 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42518&action=edit Bug 13799 - Swagger2-driven Permission checking A hasty downgrade from 13920, utilizing new features implemented by the Mojolicious::Plugin::Swagger2-author, to make it possible to implement more complex authentication/authorization scenarios with the Plugin. Define 'x-koha-permission' for the Swagger2 Operation Object, to automatically authorize against the required permissions. This way we immediately tell the API consumer in the Swagger2-definition, which permissions are needed to access defined resources. Also we don't need to maintain permissions in multiple locations and we can build a smart testing framework to help a lot in creating tests for the new REST API. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #145 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Hi! Had a discussion in IRC with jajm and ashimema about REST API permission checking. And since the author of Mojolicious:Plugin::Swagger2 has kindly improved the plugin per the discussions I have had with him. I decided to utilize the new around-action -hook of the Swagger2-plugin to implement Swagger2-driven permission checking for the REST API authentication mechanism. I really need to start migrating another legacy ILS to Koha, but it would be a real shame to let this great improvement pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |j.kylmala@gmail.com --- Comment #146 from Joonas Kylmälä <j.kylmala@gmail.com> --- Commit "RESTful API with Mojolicious and Swagger2" is missing license notices from the start of some files. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #147 from Julian Maurice <julian.maurice@biblibre.com> --- I have a few concerns using x-mojo-around feature of Swagger2: 1/ It is marked as experimental (from the POD: "This feature is EXPERIMENTAL and can change without notice.") 2/ It is introduced only in Swagger2 0.45 and thus we'll need to repackage it for Debian (packaged version in debian.koha-community.org is only 0.31) I think these two points will block integration, so I'm wondering if it's not better to include the patch in a new bug. What do you think ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Lari Taskula <larit@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14843 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14843 [Bug 14843] Notifications and messages via REST API -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #148 from Julian Maurice <julian.maurice@biblibre.com> --- No movement for a week, I'll move the last patch into its own bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14868 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14868 [Bug 14868] REST API: Swagger2-driven permission checking -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42518|0 |1 is obsolete| | --- Comment #149 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 42518 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42518 Bug 13799 - Swagger2-driven Permission checking Patch moved to its own bug (bug 14868) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #150 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 42766 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42766&action=edit Bug 13799: Add missing license notices -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42766|0 |1 is obsolete| | --- Comment #151 from Joonas Kylmälä <j.kylmala@gmail.com> --- Created attachment 42768 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42768&action=edit Bug 13799: Add missing license notices Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #152 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I tested the patches successfully on a dev install. I didn't manage to have it working on a packages+Plack environment. Once I have the needed followups I'll sign this successfull implementation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #153 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 42801 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42801&action=edit Bug 13799: Fix API unit tests They were failing because of the now required 'borrowers' permission -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #154 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Just a reminder before I scurry off again. We also need to solve how to use Etags to prevent mid-air collissions when modifying DB-objects. This is currently a BIG issue in Koha and causes very hard to track and understand issues. Getting it solved using the new REST API would be super awesome and 100% inline (actually a REQUIREMENT) with the REST architecture. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42086|0 |1 is obsolete| | --- Comment #155 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42874 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42874&action=edit [SIGNED OFF] Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/api/v1/borrowers and http://(OPAC|INTRANET)/api/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42123|0 |1 is obsolete| | --- Comment #156 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42875 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42875&action=edit [SIGNED OFF] Bug 13799: Add cookie-based authentication to REST API Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42768|0 |1 is obsolete| | --- Comment #157 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42876 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42876&action=edit [SIGNED OFF] Bug 13799: Add missing license notices Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42801|0 |1 is obsolete| | --- Comment #158 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42877 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42877&action=edit [SIGNED OFF] Bug 13799: Fix API unit tests They were failing because of the now required 'borrowers' permission Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #159 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 42878 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42878&action=edit [SIGNED OFF] Bug 13799: (QA followup) make tests use random data With the introduction of TestBuilder there's no need to rely on existing data on the DB (the original patch relies on categories and branches already existing). This patch creates a random branch, category and two borrowers with the fixed data that is needed for the tests. It adjusts the tests to use the randomized data instead of the previously fixed one. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> The feature works as expected and all tests passes. koha-qa.pl too. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle.m.hall@gmail.com |y.org | CC| |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #160 from Kyle M Hall <kyle.m.hall@gmail.com> --- Testing so far looks good! A couple things I'd like to address before passing qa: 1) Accessing invalid paths gives us a Mojo generated page that gives data that while useful for development should probably just give us 404's in production. How do you think we should address this? 2) One of the bits of data from that invalid page leads me to this: http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-does-Your-secret-pas... Is this something we should be setting? Perhaps a hard coded default secret for Koha and the option to specify a different one in koha-conf.xml? 3) A wiki page for RESTful api developer guidelines would be most helpful. Nothing too fancy, just a "here are the bits you need to change and add to extend the REST api". The code itself is a good document but an actual guide would certainly be helpful. Setting to failed qa until 1 and 2 are addressed. 3 is more of a wish list item. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #161 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I have also started QAing this one yesterday. Back today with few comments: 1/ 404 is not documented in the swagger.json file 2/ The properties for "borrowers" are not exhaustive 3/ Wording: borrowers vs patrons? "Patron" should be used now, especially for new code. 4/ this patch set introduces swagger.json but nothing to use it, how is it useful? 5/ We need a way to split this json file, it will be a mess to edit! And something to validate it. We need guidelines. 6/ Koha::Borrowers->find is called in Koha::REST::V1::Borrowers::get_borrower and Koha::REST::V1->startup (?) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #162 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #161)
6/ Koha::Borrowers->find is called in Koha::REST::V1::Borrowers::get_borrower and Koha::REST::V1->startup (?)
Forget that! (I am hidden already). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #163 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #161)
1/ 404 is not documented in the swagger.json file
Forget that again, it is! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #164 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43186 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43186&action=edit Bug 13799: Change Mojolicious default mode to 'production' This avoid getting a debug page when URL is wrong. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #165 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43187 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43187&action=edit Bug 13799: Allow to set Mojolicious secret in $KOHA_CONF -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #166 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Jonathan Druart from comment #161)
2/ The properties for "borrowers" are not exhaustive 3/ Wording: borrowers vs patrons? "Patron" should be used now, especially for new code.
Ok, these points need to be fixed
4/ this patch set introduces swagger.json but nothing to use it, how is it useful?
swagger.json, apart from being the api documentation, is also used by Mojolicious' plugin Swagger2 to create the routes (map URL to controller/action) and do some basic type check on input and output. So it is useful (or at least, used) even without documentation generators like SwaggerUI
5/ We need a way to split this json file, it will be a mess to edit!
There is an issue on Github for splitting the JSON spec https://github.com/jhthorsen/swagger2/issues/33 which was moved to https://github.com/jhthorsen/json-validator/issues/4 which ends with a commit in master https://github.com/jhthorsen/json-validator/commit/5d7d9db22b891758ac979cc87... It seems there is something to test here.
And something to validate it. We need guidelines.
What kind of validation ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #167 from Kyle M Hall <kyle.m.hall@gmail.com> --- (In reply to Julian Maurice from comment #166)
(In reply to Jonathan Druart from comment #161)
2/ The properties for "borrowers" are not exhaustive 3/ Wording: borrowers vs patrons? "Patron" should be used now, especially for new code.
Ok, these points need to be fixed
Agreed. The external api terminology must be patron / patrons at the least. At some point we need to change Koha::Borrower(s) to Koha::Patron(s) but that is entirely separate and distinct from this work.
5/ We need a way to split this json file, it will be a mess to edit!
There is an issue on Github for splitting the JSON spec https://github.com/jhthorsen/swagger2/issues/33 which was moved to https://github.com/jhthorsen/json-validator/issues/4 which ends with a commit in master https://github.com/jhthorsen/json-validator/commit/ 5d7d9db22b891758ac979cc87f1ab018030df2c2
It seems there is something to test here.
Agreed. It would be *much* better if we can split this file up. If the Swagger2 version we are using doesn't support it, we may have to table this issue until a newer version is available for us to use with Koha.
And something to validate it. We need guidelines.
What kind of validation ?
I think a unit test using Test::JSON::is_valid_json should be sufficient. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #168 from Kyle M Hall <kyle.m.hall@gmail.com> --- Also, thanks for the followups Julian! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #169 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43189 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43189&action=edit Bug 13799: Change 'required' value type from string to boolean String is not accepted as a valid value in more recent versions of Swagger2 module -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #170 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I've been working allot lately with the developer of the Swagger2 perl tools. We have got $ref support working well now, with relative paths, full paths and url's all passing tests. I asusme it's this piece you were refering to when talking about splitting up the spec file khall? Regarding 'patrons' vs 'borrowers' can we not use the 'americanised' term pretty please.. to me it would be much better to generalise it.. they're not limited to borrowers/patrons at all.. they're 'users' ;) Back on topic, I'll be looking at all this stuff today.. great work Julian in my brief look so far. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #171 from Kyle M Hall <kyle.m.hall@gmail.com> --- (In reply to Martin Renvoize from comment #170)
I've been working allot lately with the developer of the Swagger2 perl tools. We have got $ref support working well now, with relative paths, full paths and url's all passing tests. I asusme it's this piece you were refering to when talking about splitting up the spec file khall?
Yes, I believe so.
Regarding 'patrons' vs 'borrowers' can we not use the 'americanised' term pretty please.. to me it would be much better to generalise it.. they're not limited to borrowers/patrons at all.. they're 'users' ;)
The general consensus has been for internal terminology to match outward terminology. Right now we use patrons, members and borrowers internally. Since we use patrons externally we should use it internally. I we want to change the nomenclature further we should put it to a dev meeting vote!
Back on topic, I'll be looking at all this stuff today.. great work Julian in my brief look so far.
Excellent! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #172 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Firs comment: Unless we're actually going to use Mojolicious Sessions, and thus mojo cookies then we need not confuse users by making the secret configurable. As far as I can tell, secrets are only used to sign mojo cookies (Whether we should eventually switch to mojo hmac signed cookies over csgisessid is another question all together) As such, I would suggest we hard code a suitably silly secret just to quell warnings that will be output otherwise safe in the knowledge that we are not actually using said secret anyway. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #173 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- x-mojo-controller has recently been deprecated, though not entirely removed from the Swagger2 Mojo Plugin, withe the prefernce now being that the core swagger key 'operationId' is used in preference to it. I'm happy to submit a patch that updates both our spec and the resultant method names in the Borrowers controller. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #174 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Error responses.. I see you've added a nice simple schema for validating error responses. However, there seems to be a general move toward standardising on the error format at described by the Swagger2 plugins error handler.. Perhaps we should follow suite and adopt that same format, which is pretty darn close to what we have already (with the exception that it allows for an array of errors with messages as a posed to just a single error message string). I'm also happy to supply a patch if this is how we wish to proceed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #175 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43190 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43190&action=edit Bug 13799 - Followup: x-mojo-controller deprecation Remove the use of soon to be deprecated x-mojo-controller from our specification and replace with the recommended operationId format. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #176 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43191 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43191&action=edit Bug 13799: Reword 'borrower' to 'patron' Also, complete the Swagger definition of a patron -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #177 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43192 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43192&action=edit Bug 13799 - Followup: Refactor spec file Spreading the specification over multiple files should lead to a more manageable specification long term -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14974 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14974 [Bug 14974] Use the REST API for cities -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #178 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43204 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43204&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/api/v1/borrowers and http://(OPAC|INTRANET)/api/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #179 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43205 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43205&action=edit Bug 13799: Add cookie-based authentication to REST API Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #180 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43206 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43206&action=edit Bug 13799: Add missing license notices Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #181 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43207 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43207&action=edit Bug 13799: Fix API unit tests They were failing because of the now required 'borrowers' permission Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #182 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43208 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43208&action=edit Bug 13799: (QA followup) make tests use random data With the introduction of TestBuilder there's no need to rely on existing data on the DB (the original patch relies on categories and branches already existing). This patch creates a random branch, category and two borrowers with the fixed data that is needed for the tests. It adjusts the tests to use the randomized data instead of the previously fixed one. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> The feature works as expected and all tests passes. koha-qa.pl too. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43186|0 |1 is obsolete| | --- Comment #183 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43209 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43209&action=edit Bug 13799: Change Mojolicious default mode to 'production' This avoid getting a debug page when URL is wrong. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43187|0 |1 is obsolete| | --- Comment #184 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43210 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43210&action=edit Bug 13799: Allow to set Mojolicious secret in $KOHA_CONF Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43189|0 |1 is obsolete| | --- Comment #185 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43211 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43211&action=edit Bug 13799: Change 'required' value type from string to boolean String is not accepted as a valid value in more recent versions of Swagger2 module Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43191|0 |1 is obsolete| | --- Comment #186 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43212 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43212&action=edit Bug 13799: Reword 'borrower' to 'patron' Also, complete the Swagger definition of a patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43190|0 |1 is obsolete| | --- Comment #187 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43213 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43213&action=edit Bug 13799 - Followup: x-mojo-controller deprecation Remove the use of soon to be deprecated x-mojo-controller from our specification and replace with the recommended operationId format. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43192|0 |1 is obsolete| | --- Comment #188 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 43214 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43214&action=edit Bug 13799 - Followup: Refactor spec file Spreading the specification over multiple files should lead to a more manageable specification long term -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42874|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42875|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42876|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42877|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42878|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #189 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Rebased my two patches (marked with 'Followup' keyword) and signed off on prior patches. QA Note, let's get he patrons example right and not only define all fields with descriptions but actually define types so validation may become useful. I'm happy to do this as another followup. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #190 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- My patches require the latest versions of Swagger2 and JSON::Validator modules. I highly recommend especially whilst in development that we stick to the latest versions of these modules... The code is moving fast and becoming more and more refined almost daily. The latest changes include.. * Validating the swagger.json specification file against the swagger schema during application startup (This should prevent 'bad schema' making it into release). * Correct handling of $ref json-references in schemata * Stricter coercion functions and validation (JSON::Boolean and Integer coercion handling improvements) and various other bugfixes. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #191 from Kyle M Hall <kyle.m.hall@gmail.com> --- (In reply to Martin Renvoize from comment #189)
Rebased my two patches (marked with 'Followup' keyword) and signed off on prior patches.
QA Note, let's get he patrons example right and not only define all fields with descriptions but actually define types so validation may become useful.
I'm happy to do this as another followup.
Please do! Once you've got that dealt with I'll continue with QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #192 from Julian Maurice <julian.maurice@biblibre.com> --- I'm having problems with the latest patches When I go to http://pro.koha-dev/api/v1/patrons/7680, error: Can't use string ("error.json") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.14.2/JSON/Validator.pm line 515. If I remove patch "Followup: Refactor spec file", another error: {"errors":[{"path":"\/","message":"Controller could not be loaded."}]} Then, if I remove patch "Followup: x-mojo-controller deprecation", everyting is ok. $ pmvers JSON::Validator 0.59 $ pmvers Swagger2 0.60 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #193 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43980 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43980&action=edit Bug 13799: Followup of "Followup: Refactor spec file" Fix Swagger2 definitions file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #194 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43981 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43981&action=edit Bug 13799: Followup of "Followup: x-mojo-controller deprecation" Rename controller Koha::REST::V1::Patrons to Koha::REST::V1::Patron so Swagger2 can find it Also remove most of the "type" specifications in patron schema object, since most of the fields can be null, and Swagger2 does not support anyOf nor oneOf -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #195 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Removing 'type' from the definitions removes validation of the requests and responses.. that loses 2/3rds of the reason for using swagger with the final 3rd being the documentation of the api which by removing 'types' your also massively limiting the usefulness of. If we're not using 'null' as a meaningful value then we should not be using it at all. Also, the definitions still do not contain a 'requires' block which should really be present to show what fields are always required. For a fully restful api, this would be all of them for POST, PUT and GET as rest is all about dealing with full documents. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43981|0 |1 is obsolete| | --- Comment #196 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 43987 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43987&action=edit Bug 13799: Followup of "Followup: x-mojo-controller deprecation" Rename controller Koha::REST::V1::Patrons to Koha::REST::V1::Patron so Swagger2 can find it Also change most of the "type" specifications in patron schema object, since most of the fields can be null. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_22_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #197 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Started writing some guidelines: http://wiki.koha-community.org/wiki/Coding_Guidelines_-_API Still very much a work in progress -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #198 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- My current feeling now is that this is a great base and should be pushed sooner rather than later. I expect as we refine the guidelines and documentation I will continue to update the Patrons route to conform to the evolving guidelines. As such, I don't see any of the outstanding comments being blockers for the push. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #199 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to Martin Renvoize from comment #198)
My current feeling now is that this is a great base and should be pushed sooner rather than later. +1
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43204|0 |1 is obsolete| | Attachment #43205|0 |1 is obsolete| | Attachment #43206|0 |1 is obsolete| | Attachment #43207|0 |1 is obsolete| | Attachment #43208|0 |1 is obsolete| | Attachment #43209|0 |1 is obsolete| | Attachment #43210|0 |1 is obsolete| | Attachment #43211|0 |1 is obsolete| | Attachment #43212|0 |1 is obsolete| | Attachment #43213|0 |1 is obsolete| | Attachment #43214|0 |1 is obsolete| | Attachment #43980|0 |1 is obsolete| | Attachment #43987|0 |1 is obsolete| | --- Comment #200 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43989 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43989&action=edit [PASSED QA] Bug 13799: RESTful API with Mojolicious and Swagger2 Actual routes are: /borrowers Return a list of all borrowers in Koha /borrowers/{borrowernumber} Return the borrower identified by {borrowernumber} (eg. /borrowers/1) There is a test file you can run with: $ prove t/db_dependent/rest/borrowers.t All API stuff is in /api/v1 (except Perl modules) So we have: /api/v1/script.cgi CGI script /api/v1/swagger.json Swagger specification Change both OPAC and Intranet VirtualHosts to access the API, so we have: http://OPAC/api/v1/swagger.json Swagger specification http://OPAC/api/v1/{path} API endpoint http://INTRANET/api/v1/swagger.json Swagger specification http://INTRANET/api/v1/{path} API endpoint Add a (disabled) virtual host in Apache configuration api.HOSTNAME, so we have: http://api.HOSTNAME/api/v1/swagger.json Swagger specification http://api.HOSTNAME/api/v1/{path} API endpoint Add 'unblessed' subroutines to both Koha::Objects and Koha::Object to be able to pass it to Mojolicious Test plan: 1/ Install Perl modules Mojolicious and Swagger2 2/ perl Makefile.PL 3/ make && make install 4/ Change etc/koha-httpd.conf and copy it to the right place if needed 5/ Reload Apache 6/ Check that http://(OPAC|INTRANET)/api/v1/borrowers and http://(OPAC|INTRANET)/api/v1/borrowers/{borrowernumber} works Optionally, you could verify that http://(OPAC|INTRANET)/vX/borrowers (where X is an integer greater than 1) returns a 404 error Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #201 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43990 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43990&action=edit [PASSED QA] Bug 13799: Add cookie-based authentication to REST API Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #202 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43991 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43991&action=edit [PASSED QA] Bug 13799: Add missing license notices Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #203 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43992 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43992&action=edit [PASSED QA] Bug 13799: Fix API unit tests They were failing because of the now required 'borrowers' permission Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #204 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43993 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43993&action=edit [PASSED QA] Bug 13799: (QA followup) make tests use random data With the introduction of TestBuilder there's no need to rely on existing data on the DB (the original patch relies on categories and branches already existing). This patch creates a random branch, category and two borrowers with the fixed data that is needed for the tests. It adjusts the tests to use the randomized data instead of the previously fixed one. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> The feature works as expected and all tests passes. koha-qa.pl too. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #205 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43994 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43994&action=edit [PASSED QA] Bug 13799: Change Mojolicious default mode to 'production' This avoid getting a debug page when URL is wrong. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #206 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43995 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43995&action=edit [PASSED QA] Bug 13799: Allow to set Mojolicious secret in $KOHA_CONF Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #207 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43996 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43996&action=edit [PASSED QA] Bug 13799: Change 'required' value type from string to boolean String is not accepted as a valid value in more recent versions of Swagger2 module Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #208 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43997 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43997&action=edit [PASSED QA] Bug 13799: Reword 'borrower' to 'patron' Also, complete the Swagger definition of a patron Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #209 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43998 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43998&action=edit [PASSED QA] Bug 13799 - Followup: x-mojo-controller deprecation Remove the use of soon to be deprecated x-mojo-controller from our specification and replace with the recommended operationId format. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #210 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 43999 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43999&action=edit [PASSED QA] Bug 13799 - Followup: Refactor spec file Spreading the specification over multiple files should lead to a more manageable specification long term Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #211 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 44000 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44000&action=edit [PASSED QA] Bug 13799: Followup of "Followup: Refactor spec file" Fix Swagger2 definitions file Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #212 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 44001 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44001&action=edit [PASSED QA] Bug 13799: Followup of "Followup: x-mojo-controller deprecation" Rename controller Koha::REST::V1::Patrons to Koha::REST::V1::Patron so Swagger2 can find it Also change most of the "type" specifications in patron schema object, since most of the fields can be null. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #213 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44185 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44185&action=edit Bug 13799: Rename t/.../v1/borrowers.t to t/.../v1/patrons.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #214 from Julian Maurice <julian.maurice@biblibre.com> --- Required versions of dependencies are now in Debian Sid https://packages.debian.org/sid/libswagger2-perl https://packages.debian.org/sid/libjson-validator-perl Now we need to re-package them for debian.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #215 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44285 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44285&action=edit Bug 13799: Update dependencies -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #216 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Julian Maurice from comment #214)
Required versions of dependencies are now in Debian Sid
https://packages.debian.org/sid/libswagger2-perl https://packages.debian.org/sid/libjson-validator-perl
Now we need to re-package them for debian.koha-community.org
(In reply to Julian Maurice from comment #215)
Created attachment 44285 [details] [review] Bug 13799: Update dependencies
Is it necessary to update those versions? Because the older versions are in the repo as it is. I haven't tried yet, but I suspect that JSON::Validator will be hard to port to wheezy, as it requires packaging a newer mojolicious, and I fear we'll end up in a bit of dependency hell. I'll give it a go though, maybe it'll be surprisingly easy. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #217 from Robin Sheat <robin@catalyst.net.nz> --- Created attachment 44313 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44313&action=edit Dependency tree for Swagger2 0.60 (In reply to Julian Maurice from comment #214)
Required versions of dependencies are now in Debian Sid
https://packages.debian.org/sid/libswagger2-perl https://packages.debian.org/sid/libjson-validator-perl
Now we need to re-package them for debian.koha-community.org
I had a look, and I don't think it's going to happen. Attached is the dependency tree that I worked out I'd need to build. The red edge is where the process becomes difficult, and I'm not going to backport a new Perl version. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #218 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to Robin Sheat from comment #217)
I had a look, and I don't think it's going to happen. Attached is the dependency tree that I worked out I'd need to build. The red edge is where the process becomes difficult, and I'm not going to backport a new Perl version.
Actually, it's possible I spoke too soon. But it's still going to be a bit of work, so in the interests of laziness, how important are these new versions? There's still no guarantee that it'll work overall, but I may have found a way around the perl version issue. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #219 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Robin Sheat from comment #218)
Actually, it's possible I spoke too soon. But it's still going to be a bit of work, so in the interests of laziness, how important are these new versions?
The newer version of Swagger2 module is useful to be able to split the swagger.json specification file into multiple pieces (so we don't have a single huge unreadable file) I don't know if there are others benefits. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #220 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We jumped on the Swagger2 Plugin way too early basically. I've been developing an app based around it for a few months now... and have been working closely with the plugin author to write tests, fix issues and make it stable.. it's only just hitting the point where it's a stable and reliable platform for us to work atop so I wouldn't suggest using earlier versions. (Unless we wan't to fork it and maintain that fork.. which I think is a terrible idea). For further info, I wouldn't even consider using Mojolicious in a package environment if we could avoid it.. I've voiced this before though ;). Mojolicious is a state of the art library that's pretty fast moving. I use it in our companies apps, but we're running in a Carton + Plenv environment and I wouldn't really advocate running a Mojo stack under much else. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #221 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Being able to split the swagger.json to many files is really important. The single file will become too big too soon. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #222 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Olli-Antti Kivilahti from comment #221)
Being able to split the swagger.json to many files is really important. The single file will become too big too soon.
Yeah, but we can leave that for the next release; at that point we won't have the compromise to suport Wheezy or Trusty at all. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #223 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #222)
(In reply to Olli-Antti Kivilahti from comment #221)
Being able to split the swagger.json to many files is really important. The single file will become too big too soon.
Yeah, but we can leave that for the next release; at that point we won't have the compromise to suport Wheezy or Trusty at all.
So, what should we do ? Moving the patches that need more recent versions of Perl modules into their own bug and push remaining patches into master now (so they go in 3.22) ? Or wait for 3.22 to be released and then push the whole bug's patches for 3.24 ? Backporting Perl to oldstable doesn't seem to be the way to go -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15126 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15126 [Bug 15126] REST API: Use newer version of Swagger2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43989|0 |1 is obsolete| | --- Comment #224 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44375 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44375&action=edit Bug 13799: RESTful API with Mojolicious and Swagger2 Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43990|0 |1 is obsolete| | --- Comment #225 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44376 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44376&action=edit Bug 13799: Add cookie-based authentication to REST API Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43991|0 |1 is obsolete| | --- Comment #226 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44377 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44377&action=edit Bug 13799: Add missing license notices Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43992|0 |1 is obsolete| | --- Comment #227 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44378 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44378&action=edit Bug 13799: Fix API unit tests Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43993|0 |1 is obsolete| | --- Comment #228 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44379 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44379&action=edit Bug 13799: (QA followup) make tests use random data Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43994|0 |1 is obsolete| | --- Comment #229 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44380 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44380&action=edit Bug 13799: Change Mojolicious default mode to 'production' Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43995|0 |1 is obsolete| | --- Comment #230 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44381 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44381&action=edit Bug 13799: Allow to set Mojolicious secret in $KOHA_CONF Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43996|0 |1 is obsolete| | --- Comment #231 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44382 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44382&action=edit Bug 13799: Change 'required' value type from string to boolean Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43997|0 |1 is obsolete| | --- Comment #232 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44383 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44383&action=edit Bug 13799: Reword 'borrower' to 'patron' Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44185|0 |1 is obsolete| | --- Comment #233 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44384 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44384&action=edit Bug 13799: Rename t/.../v1/borrowers.t to t/.../v1/patrons.t Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #234 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 44385 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44385&action=edit Bug 13799: Add types for patron's fields in Swagger spec -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43998|0 |1 is obsolete| | --- Comment #235 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 43998 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43998 [PASSED QA] Bug 13799 - Followup: x-mojo-controller deprecation Patch moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43999|0 |1 is obsolete| | --- Comment #236 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 43999 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43999 [PASSED QA] Bug 13799 - Followup: Refactor spec file Patch moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44000|0 |1 is obsolete| | --- Comment #237 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 44000 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44000 [PASSED QA] Bug 13799: Followup of "Followup: Refactor spec file" Patch moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44001|0 |1 is obsolete| | --- Comment #238 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 44001 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44001 [PASSED QA] Bug 13799: Followup of "Followup: x-mojo-controller deprecation" Patch moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44285|0 |1 is obsolete| | --- Comment #239 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 44285 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44285 Bug 13799: Update dependencies Patch moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #44313|0 |1 is obsolete| | --- Comment #240 from Julian Maurice <julian.maurice@biblibre.com> --- Comment on attachment 44313 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44313 Dependency tree for Swagger2 0.60 Moved to bug 15126 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #241 from Julian Maurice <julian.maurice@biblibre.com> --- Re-tested with Swagger2 0.31, Mojolicious 0.54. Tests pass, all is working well. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #242 from Julian Maurice <julian.maurice@biblibre.com> --- I meant: Mojolicious 5.54 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #243 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks everyone, specially Julian and Martin! Things will get interesting for sure :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 --- Comment #244 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #243)
Patches pushed to master.
Thanks everyone, specially Julian and Martin! Things will get interesting for sure :-D
Whoa! You can say that again! Is there going to be some documentation for using and developing the REST APIs? Super intrigued by this!!! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13799 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|13895 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13895 [Bug 13895] Add API routes for checkouts retrieval and renewal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org