serializers#
MetaxUserModelSerializer#
Bases: CommonModelSerializer
User model serializer for use in datasets.
Source code in src/apps/users/serializers.py
UserInfoSerializer#
Bases: CommonModelSerializer
User serializer with user details.
Source code in src/apps/users/serializers.py
AuthenticatedUserInfoSerializer#
Bases: UserInfoSerializer
User serializer with user session data required by external services.
Source code in src/apps/users/serializers.py
get_metax_csrf_token(obj)
#
Return CSRF token.
Requests using cookie-based authentication (e.g. SSO session) need to include this in header HTTP_X_CSRFTOKEN for requests that modify data, like POST, PUT and DELETE.
The token is rotated on login, so it needs to be fetched again on each new login. Also, Django masks the value for security reasons so it looks different on each request.
Source code in src/apps/users/serializers.py
TokenSerializer#
Bases: CommonModelSerializer
Serializer for AuthTokens in API token list.