PKP 2017 Sprint Report: REST API
One of the new and exciting feature being released with OJS 3.1 is the REST API. This innovation has the potential to unlock several new opportunities for OJS users. The API will offer great flexibility and ease OJS integration with other platforms.
The members of the group identified the following goals:
- Improve the existing token based authentication by implementing JSON Web Tokens (JWT)
- Identify a reliable architecture / pattern to allow plugins to extend API functionality
- Put together a document outline requirements for OMP API
JSON Web Tokens (JWT) are industry standards for security token used for securely transmitting information between client and server as JSON objects. The group chose JWT because it’s widely used in the industry. For implementation, the group chose to rely on php-jwt (https://github.com/firebase/php-jwt), a popular library to encode and decode JWT in PHP.
OJS relies on plugins to expand its functionality. For that reason, it was important to come up with a good pattern to follow in order to allow new and existing plugins to extend REST API functionalities. After some Brainstorming and discussions we were able to identify a solid architecture and pattern to follow so that we could put together sustaining classes in the code that client code could build upon. Now that this initial work is done, existing endpoints will be refactored to consume these classes.
A document outlining metadata requirement list for OMP was put together based on JATS specification. This document will be used as a guideline while building API endpoints for OMP.
Special thanks to this group participants:
- Dulip Withanage
- Tim Sample
- Kassim Machioudi
- Nate Wright