harbour-service
Gateway service for all your ADS communication with legacy systems, such as Classic and BEER/2.0
ADS Classic Workflow
- User enters their 'email', 'password', and 'mirror' for their ADS credentials
user> curl -X POST 'http://api/v1/harbour/auth/classic' -H 'Authorization: Bearer <TOKEN>'
--data '{"classic_email": "email", "classic_password": "password", "classic_mirror": "mirror"}'
200, {"classic_email": "email", "classic_mirror": "mirror"}
- If the user does not know the mirror, they can access a list of available mirrors for the service
user> curl -X GET 'http://api/v1/harbour/mirrors' -H 'Authorization: Bearer <TOKEN>'
200, ['site1', 'site2', ...., 'siteN']
- User wants to check the credentials they have stored
user> curl -X GET 'http://api/v1/harbour/user' -H 'Authorization: Bearer <TOKEN>'
200, {"classic_email": "email", "classic_mirror": "mirror", "twopointoh_email": ""}
- User imports the libraries from ADS Classic
user> curl -X GET 'http://api/v1/biblib/import/classic' -H 'Authorization: Bearer <TOKEN>'
200, [{"action": "created", "library_id": "fdsfsfsdfdsfds", "name": "Name", "num_added": 4, "description": "Description"}, {"action": "created", "library_id": "dsadsadsadsa", "name": "Name2", "n
um_added": 4, "description": "Description2"}]
ADS 2.0 Workflow
- User enters their 'email' and 'password' for their ADS 2.0 credentials
user> curl -X POST 'http://api/v1/harbour/auth/twopointoh' -H 'Authorization: Bearer <TOKEN>'
--data '{"twopointoh_email": "email", "twopointoh_password": "password"}'
200, {"twopointoh_email": "email", "twopointoh_authed": true}
- User wants to check the credentials they have stored
user> curl -X GET 'http://api/v1/harbour/user' -H 'Authorization: Bearer <TOKEN>'
200, {"classic_email": "", "classic_mirror": "", "adstwopointoh_email": "email"}
- User imports the libraries from ADS 2.0
user> curl -X GET 'http://api/v1/biblib/import/twopointoh' -H 'Authorization: Bearer <TOKEN>'
200, [{"action": "created", "library_id": "fdsfsfsdfdsfds", "name": "Name", "num_added": 4, "description": "Description"}, {"action": "created", "library_id": "dsadsadsadsa", "name": "Name2", "n
um_added": 4, "description": "Description2"}]
- User exports their ADS 2.0 libraries for use in Zotero
user> curl -LO -X GET 'http://api/v1/harbour/export/twopointoh/zotero' -H 'Authorization: Bearer <TOKEN>'
Notes
The mirror they can use must be in the list defined in config.py
.
Development
You can run unit tests in the following way:
nosetests harbour/tests/
A Vagrantfile and puppet manifest are available for development within a virtual machine. To use the vagrant VM defined here you will need to install Vagrant and VirtualBox.
To load and enter the VM: vagrant up && vagrant ssh