deseasion.backend.resources.auth module
- class deseasion.backend.resources.auth.LoginAPI
Bases:
Resource
- create_user_token_response(user)
Create a new authentication and refresh token for the user.
- endpoint = 'loginapi'
- get(user: User)
Log the user in and return an authentication and a refresh token.
- Reqheader Authorization:
Basic authentication,
user:password
encoded in base64.- Resjson str access_token:
Access token.
- Resjson str refresh_token:
Token to use for creating a new authentication token.
- Resjson str token_type:
Type of the token
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- class deseasion.backend.resources.auth.RefreshAPI
Bases:
Resource
- create_new_jwt(user)
Create a new authentication token for the user.
- endpoint = 'refreshapi'
- get(user: User)
Create a new authentication token from the refresh token.
- Reqheader Authorization:
The refresh token received when login in.
- Resjson str access_token:
Access token.
- Resjson str token_type:
Type of the token
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- class deseasion.backend.resources.auth.UserAPI
Bases:
Resource
- endpoint = 'userapi'
- get()
Return the details of the current user.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.