From ad184f0ac3ae8d89bc70f00735ee86a5ff08443b Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 2 Jun 2020 18:56:23 +0300 Subject: [PATCH] Rename encryptedSeckey to encryptedContent. --- .../migrations/0014_auto_20200602_1558.py | 18 ++++++++++++++++++ django_etesync/models.py | 2 +- django_etesync/serializers.py | 6 +++--- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 django_etesync/migrations/0014_auto_20200602_1558.py diff --git a/django_etesync/migrations/0014_auto_20200602_1558.py b/django_etesync/migrations/0014_auto_20200602_1558.py new file mode 100644 index 0000000..e226360 --- /dev/null +++ b/django_etesync/migrations/0014_auto_20200602_1558.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.3 on 2020-06-02 15:58 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etesync', '0013_collectionmemberremoved'), + ] + + operations = [ + migrations.RenameField( + model_name='userinfo', + old_name='encryptedSeckey', + new_name='encryptedContent', + ), + ] diff --git a/django_etesync/models.py b/django_etesync/models.py index 7fbea61..18c14a9 100644 --- a/django_etesync/models.py +++ b/django_etesync/models.py @@ -214,7 +214,7 @@ class UserInfo(models.Model): version = models.PositiveSmallIntegerField(default=1) loginPubkey = models.BinaryField(editable=True, blank=False, null=False) pubkey = models.BinaryField(editable=True, blank=False, null=False) - encryptedSeckey = models.BinaryField(editable=True, blank=False, null=False) + encryptedContent = models.BinaryField(editable=True, blank=False, null=False) salt = models.BinaryField(editable=True, blank=False, null=False) def __str__(self): diff --git a/django_etesync/serializers.py b/django_etesync/serializers.py index b3b83a0..5925e46 100644 --- a/django_etesync/serializers.py +++ b/django_etesync/serializers.py @@ -333,11 +333,11 @@ class InvitationAcceptSerializer(serializers.Serializer): class UserSerializer(serializers.ModelSerializer): pubkey = BinaryBase64Field(source='userinfo.pubkey') - encryptedSeckey = BinaryBase64Field(source='userinfo.encryptedSeckey') + encryptedContent = BinaryBase64Field(source='userinfo.encryptedContent') class Meta: model = User - fields = (User.USERNAME_FIELD, User.EMAIL_FIELD, 'pubkey', 'encryptedSeckey') + fields = (User.USERNAME_FIELD, User.EMAIL_FIELD, 'pubkey', 'encryptedContent') class UserInfoPubkeySerializer(serializers.ModelSerializer): @@ -362,7 +362,7 @@ class AuthenticationSignupSerializer(serializers.Serializer): salt = BinaryBase64Field() loginPubkey = BinaryBase64Field() pubkey = BinaryBase64Field() - encryptedSeckey = BinaryBase64Field() + encryptedContent = BinaryBase64Field() def create(self, validated_data): """Function that's called when this serializer creates an item"""