ahriman.web.views.v1.user package
Submodules
ahriman.web.views.v1.user.login module
- class LoginView(request: None)
Bases:
BaseView
login endpoint view
- GET_PERMISSION
(class attribute) get permissions of self
- Type:
- POST_PERMISSION
(class attribute) post permissions of self
- Type:
- async get() None
OAuth2 response handler
In case if code provided it will do a request to get user email. In case if no code provided it will redirect to authorization url provided by OAuth client.
The authentication session will be passed in
Set-Cookie
header.- Raises:
HTTPFound – on success response
HTTPMethodNotAllowed – in case if method is used, but OAuth is disabled
HTTPUnauthorized – if case of authorization error
- async post() None
login user to service. The authentication session will be passed in
Set-Cookie
header.- Raises:
HTTPFound – on success response
HTTPUnauthorized – if case of authorization error
ahriman.web.views.v1.user.logout module
- class LogoutView(request: None)
Bases:
BaseView
logout endpoint view
- POST_PERMISSION
(class attribute) post permissions of self
- Type:
- async post() None
logout user from the service
The server will respond with
Set-Cookie
header, in which API session cookie will be nullified.- Raises:
HTTPFound – on success response
HTTPUnauthorized – no authorization cookie available