Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API #25

Open
1 of 2 tasks
moan0s opened this issue Dec 9, 2021 · 3 comments
Open
1 of 2 tasks

API #25

moan0s opened this issue Dec 9, 2021 · 3 comments
Assignees
Labels
API All api related issues enhancement New feature or request

Comments

@moan0s
Copy link
Owner

moan0s commented Dec 9, 2021

This issue should collect all initial requirements of an API.

  • POC: Get all books for example
  • Document API access
@moan0s moan0s added the enhancement New feature or request label Dec 9, 2021
@moan0s moan0s added the API All api related issues label Dec 9, 2021
@Sebastian1515
Copy link
Collaborator

  • Compatibility to AccessControl (https://github.com/Sebastian1515/AccessControl/): HTTP Response for a request with the following ingredients: UID (RFID card number) and password. Sends an http response code or something else back whether the given card number is allowed or not.

@moan0s
Copy link
Owner Author

moan0s commented Dec 13, 2021

I would suggest one of the following

  • Staff members can create devices that have an API token (somewhat like a password)
  • New users are created for each device, there is a group that they are added to, to have a suitable permission. Then a API token is created

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

@moan0s
Copy link
Owner Author

moan0s commented Dec 13, 2021

efc7d46 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}

moan0s added a commit to moan0s/AccessControl that referenced this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API All api related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants