moan0s / ILMO2

Intelligent Library Management Online - A simple Web-App for the organization of a library, the users, books, opening hours and lendings.
https://ilmo2.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 2 forks source link

API #25

Open moan0s opened 2 years ago

moan0s commented 2 years ago

This issue should collect all initial requirements of an API.

Sebastian1515 commented 2 years ago
moan0s commented 2 years ago

I would suggest one of the following

With this API token a device can authenticate itself (can be hard-coded to AccesControl and has a list of allowed API requests

moan0s commented 2 years ago

efc7d468d36b7924d4879f6fdee18d1826cec405 adds rooms which represent physical rooms, where users can be assigned to have access. A user with (currently) any API key can make a request if access for a specific UID is allowed.

An example request looks like

[moanos@firefly src]$ curl -X GET http://localhost:8000/library/api/uid/1234/room/dbc71599-a0ce-482f-a896-6f4a7dfc17ec -H 'Authorization: Token 49b39856635dc6e5cc04365498d4ad30ea3aed78'
{"access":true}