1
0
mirror of https://github.com/etesync/server synced 2024-11-26 02:38:15 +00:00

We use base64url without padding.

This commit is contained in:
Tom Hacohen 2020-03-17 17:10:53 +02:00
parent 66e5062461
commit 86b6a44917
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 3.0.3 on 2020-03-17 15:09
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0030_auto_20200312_1859'),
]
operations = [
migrations.AlterField(
model_name='collectionitemchunk',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')]),
),
]

View File

@ -20,7 +20,7 @@ from django.core.validators import RegexValidator
from django.utils.functional import cached_property from django.utils.functional import cached_property
Base64Url256BitValidator = RegexValidator(regex=r'^[a-zA-Z0-9\-_]{43}=?$', message='Expected a 256bit base64url.') Base64Url256BitValidator = RegexValidator(regex=r'^[a-zA-Z0-9\-_]{43}$', message='Expected a 256bit base64url.')
UidValidator = RegexValidator(regex=r'[a-zA-Z0-9]', message='Not a valid UID') UidValidator = RegexValidator(regex=r'[a-zA-Z0-9]', message='Not a valid UID')