|
@@ -0,0 +1,34 @@
|
|
|
+# Generated by Django 4.0.3 on 2022-04-11 10:40
|
|
|
+
|
|
|
+from django.db import migrations, models
|
|
|
+
|
|
|
+
|
|
|
+class Migration(migrations.Migration):
|
|
|
+
|
|
|
+ initial = True
|
|
|
+
|
|
|
+ dependencies = [
|
|
|
+ ('auth', '0012_alter_user_first_name_max_length'),
|
|
|
+ ]
|
|
|
+
|
|
|
+ operations = [
|
|
|
+ migrations.CreateModel(
|
|
|
+ name='APIKey',
|
|
|
+ fields=[
|
|
|
+ ('id', models.CharField(editable=False, max_length=150, primary_key=True, serialize=False, unique=True)),
|
|
|
+ ('prefix', models.CharField(editable=False, max_length=8, unique=True)),
|
|
|
+ ('hashed_key', models.CharField(editable=False, max_length=150)),
|
|
|
+ ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
|
|
|
+ ('name', models.CharField(default=None, help_text='A free-form name for the API key. Need not be unique. 50 characters max.', max_length=50)),
|
|
|
+ ('revoked', models.BooleanField(blank=True, default=False, help_text='If the API key is revoked, clients cannot use it anymore. (This cannot be undone.)')),
|
|
|
+ ('expiry_date', models.DateTimeField(blank=True, help_text='Once API key expires, clients cannot use it anymore.', null=True, verbose_name='Expires')),
|
|
|
+ ('permission', models.ManyToManyField(related_name='api_keys', to='auth.permission')),
|
|
|
+ ],
|
|
|
+ options={
|
|
|
+ 'verbose_name': 'API key',
|
|
|
+ 'verbose_name_plural': 'API keys',
|
|
|
+ 'ordering': ('-created',),
|
|
|
+ 'abstract': False,
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ]
|