|
| 1 | +# Generated by Django 5.1.4 on 2025-01-06 15:49 |
| 2 | + |
| 3 | +import oauth2_provider.generators |
| 4 | +from django.db import migrations, models |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + dependencies = [ |
| 10 | + ('oauth2_provider', '0012_add_token_checksum'), |
| 11 | + ] |
| 12 | + |
| 13 | + operations = [ |
| 14 | + migrations.AlterField( |
| 15 | + model_name='application', |
| 16 | + name='authorization_grant_type', |
| 17 | + field=models.CharField(choices=[('authorization-code', 'Authorization code'), ('urn:ietf:params:oauth:grant-type:device_code', 'Device Code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=64), |
| 18 | + ), |
| 19 | + migrations.CreateModel( |
| 20 | + name='Device', |
| 21 | + fields=[ |
| 22 | + ('id', models.BigAutoField(primary_key=True, serialize=False)), |
| 23 | + ('device_code', models.CharField(max_length=100, unique=True)), |
| 24 | + ('user_code', models.CharField(max_length=100)), |
| 25 | + ('scope', models.CharField(default='openid', max_length=64)), |
| 26 | + ('interval', models.IntegerField(default=5)), |
| 27 | + ('expires', models.DateTimeField()), |
| 28 | + ('status', models.CharField(blank=True, choices=[('authorized', 'Authorized'), ('authorization-pending', 'Authorization pending'), ('expired', 'Expired'), ('denied', 'Denied')], default='authorization-pending', max_length=64)), |
| 29 | + ('client_id', models.CharField(db_index=True, default=oauth2_provider.generators.generate_client_id, max_length=100)), |
| 30 | + ('last_checked', models.DateTimeField(auto_now=True)), |
| 31 | + ], |
| 32 | + options={ |
| 33 | + 'abstract': False, |
| 34 | + 'swappable': 'OAUTH2_PROVIDER_DEVICE_MODEL', |
| 35 | + 'constraints': [models.UniqueConstraint(fields=('device_code',), name='unique_device_code')], |
| 36 | + }, |
| 37 | + ), |
| 38 | + ] |
0 commit comments