Add a separate pubkey/privatekey for sharing.
It's separated from the login one so that encryption key and identity can be rotated separately.
This commit is contained in:
@@ -326,9 +326,12 @@ class InvitationAcceptSerializer(serializers.Serializer):
|
||||
|
||||
|
||||
class UserSerializer(serializers.ModelSerializer):
|
||||
pubkey = BinaryBase64Field(source='userinfo.pubkey')
|
||||
encryptedSeckey = BinaryBase64Field(source='userinfo.encryptedSeckey')
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = (User.USERNAME_FIELD, User.EMAIL_FIELD)
|
||||
fields = (User.USERNAME_FIELD, User.EMAIL_FIELD, 'pubkey', 'encryptedSeckey')
|
||||
|
||||
|
||||
class UserQuerySerializer(serializers.ModelSerializer):
|
||||
@@ -349,6 +352,8 @@ class AuthenticationSignupSerializer(serializers.Serializer):
|
||||
user = UserQuerySerializer(many=False)
|
||||
salt = BinaryBase64Field()
|
||||
loginPubkey = BinaryBase64Field()
|
||||
pubkey = BinaryBase64Field()
|
||||
encryptedSeckey = BinaryBase64Field()
|
||||
|
||||
def create(self, validated_data):
|
||||
"""Function that's called when this serializer creates an item"""
|
||||
|
||||
Reference in New Issue
Block a user