Revision: add salt.

master
Tom Hacohen 4 years ago
parent 119479d22b
commit e062fcd429

@ -0,0 +1,18 @@
# Generated by Django 3.0.3 on 2020-06-04 12:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0014_auto_20200602_1558'),
]
operations = [
migrations.AddField(
model_name='collectionitemrevision',
name='salt',
field=models.BinaryField(default=b'', editable=True),
),
]

@ -115,6 +115,7 @@ class CollectionItemRevision(models.Model):
stoken = models.OneToOneField(Stoken, on_delete=models.PROTECT)
uid = models.CharField(db_index=True, unique=True, blank=False, null=False,
max_length=43, validators=[Base64Url256BitlValidator])
salt = models.BinaryField(editable=True, blank=False, null=False, default=b'')
item = models.ForeignKey(CollectionItem, related_name='revisions', on_delete=models.CASCADE)
meta = models.BinaryField(editable=True, blank=False, null=False)
current = models.BooleanField(db_index=True, default=True, null=True)

@ -106,11 +106,12 @@ class CollectionItemRevisionSerializer(serializers.ModelSerializer):
queryset=models.RevisionChunkRelation.objects.all(),
many=True
)
salt = BinaryBase64Field()
meta = BinaryBase64Field()
class Meta:
model = models.CollectionItemRevision
fields = ('chunks', 'meta', 'uid', 'deleted')
fields = ('chunks', 'meta', 'uid', 'salt', 'deleted')
class CollectionItemSerializer(serializers.ModelSerializer):

Loading…
Cancel
Save