2022-04-13 12:24:56 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
2022-05-07 08:20:12 +00:00
|
|
|
from common.drf.fields import EncryptedField
|
|
|
|
|
2022-04-13 12:24:56 +00:00
|
|
|
__all__ = [
|
2022-07-04 03:29:39 +00:00
|
|
|
'MFAChallengeSerializer', 'MFASelectTypeSerializer',
|
2022-04-13 12:24:56 +00:00
|
|
|
'PasswordVerifySerializer',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordVerifySerializer(serializers.Serializer):
|
2022-05-07 08:20:12 +00:00
|
|
|
password = EncryptedField()
|
2022-04-13 12:24:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MFASelectTypeSerializer(serializers.Serializer):
|
|
|
|
type = serializers.CharField()
|
|
|
|
username = serializers.CharField(required=False, allow_blank=True, allow_null=True)
|
|
|
|
|
|
|
|
|
|
|
|
class MFAChallengeSerializer(serializers.Serializer):
|
|
|
|
type = serializers.CharField(write_only=True, required=False, allow_blank=True)
|
|
|
|
code = serializers.CharField(write_only=True)
|
|
|
|
|
|
|
|
def create(self, validated_data):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def update(self, instance, validated_data):
|
|
|
|
pass
|