fl_server_api.views.base ¶
Classes:
| Name | Description |
|---|---|
BasicAuthAllowingTokenAuthInUrl | A class that extends the BasicAuthentication to allow token authentication in the URL. |
ViewSet | A base ViewSet that includes default authentication and permission classes. |
Classes¶
BasicAuthAllowingTokenAuthInUrl ¶
Bases: BasicAuthentication
flowchart TD
fl_server_api.views.base.BasicAuthAllowingTokenAuthInUrl[BasicAuthAllowingTokenAuthInUrl]
click fl_server_api.views.base.BasicAuthAllowingTokenAuthInUrl href "" "fl_server_api.views.base.BasicAuthAllowingTokenAuthInUrl"
A class that extends the BasicAuthentication to allow token authentication in the URL.
- API Reference
fl_server_apiviewsbase ClassesViewSet Attributesauthentication_classes
Methods:
| Name | Description |
|---|---|
authenticate_credentials | Authenticate credentials against username/password or token. |
Source code in fl_server_api/views/base.py
Functions¶
authenticate_credentials ¶
Authenticate credentials against username/password or token.
Basic Authentication: Authenticate the userid and password against username and password with optional request for context.
Token Authentication over URL: Authenticate the given token against the token in the database.
Source code in fl_server_api/views/base.py
ViewSet ¶
Bases: ViewSet
flowchart TD
fl_server_api.views.base.ViewSet[ViewSet]
click fl_server_api.views.base.ViewSet href "" "fl_server_api.views.base.ViewSet"
A base ViewSet that includes default authentication and permission classes.
This class allows the authentication and permission classes to be overwritten by the child class or the request method. To overwrite the authentication and permission classes for a specific request method, use the @decorators.authentication_classes and @decorators.permission_classes decorators from rest_framework.decorators.
Methods:
| Name | Description |
|---|---|
get_authenticators | Get the authenticators for the ViewSet. |
get_permissions | Get the permissions for the ViewSet. |
Attributes:
| Name | Type | Description |
|---|---|---|
authentication_classes | The authentication classes for the ViewSet. | |
permission_classes | The permission classes for the ViewSet. |
Source code in fl_server_api/views/base.py
Attributes¶
authentication_classes class-attribute instance-attribute ¶
authentication_classes = [TokenAuthentication, BasicAuthAllowingTokenAuthInUrl, BasicAuthentication, SessionAuthentication]
The authentication classes for the ViewSet.
permission_classes class-attribute instance-attribute ¶
The permission classes for the ViewSet.
Functions¶
get_authenticators ¶
Get the authenticators for the ViewSet.
This method gets the view method and, if it has authentication classes defined via the decorator, returns them. Otherwise, it falls back to the default authenticators.
Returns:
| Name | Type | Description |
|---|---|---|
list | The authenticators for the ViewSet. |
Source code in fl_server_api/views/base.py
get_permissions ¶
Get the permissions for the ViewSet.
This method gets the view method and, if it has permission classes defined via the decorator, returns them. Otherwise, it falls back to the default permissions.
Returns:
| Name | Type | Description |
|---|---|---|
list | The permissions for the ViewSet. |