Finish the verifyserializer

This commit is contained in:
Nico Schottelius 2018-11-18 13:35:06 +01:00
parent 0b73e1f5e0
commit d8ddf31fbb

View file

@ -78,7 +78,7 @@ class TokenSerializer(serializers.Serializer):
name_in = self.validated_data.get(self.name_name) name_in = self.validated_data.get(self.name_name)
realm_in = self.validated_data.get(self.realm_name) realm_in = self.validated_data.get(self.realm_name)
print("auth: {} {} {}".format(token_in, name_in, realm_in)) print("auth: {} {} {} ({} {} {} -- {})".format(token_in, name_in, realm_in, self.token_name, self.name_name, self.realm_name, self.validated_data))
# 1. Verify that the connection might authenticate # 1. Verify that the connection might authenticate
try: try:
@ -94,6 +94,10 @@ class TokenSerializer(serializers.Serializer):
return (db_instance, token_in) return (db_instance, token_in)
class VerifySerializer(TokenSerializer): class VerifySerializer(TokenSerializer):
verifyname = serializers.CharField(max_length=128)
verifytoken = serializers.CharField(max_length=128)
verifyrealm = serializers.CharField(max_length=128)
token_name = 'verifytoken' token_name = 'verifytoken'
name_name = 'verifyname' name_name = 'verifyname'
realm_name = 'verifyrealm' realm_name = 'verifyrealm'