You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re. JWT, you should be careful as they cannot be revoked. I'd rather advocate for a model representing an APP and its associated random generated API key. Revocating a key would simply mean changing the key for the app, and checking for an API key would be a simple request to the SQL database.
It would be nice to provide an API.
One exists for member management and should not be missed and may be used as example : https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/members/views.py
Steps would be the following :
- Create an a view to create jwt api tokens
- Create an api auth backend for api that could check validity of JWT when receiving request
- Create Generic CRUD serializerers (if possible)
We may use this https://www.django-rest-framework.org/tutorial/1-serialization/#using-modelserializers (code should look like https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/forms.py)
- An then create the required views using the serializers (code should look like https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/views.py)
- Dont forget the urls
(https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/views.py)
if too complicated, still possible to create individual views
The text was updated successfully, but these errors were encountered: