Skip to content

Commit

Permalink
fix for --> django1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
HemendraSharma04 committed Mar 8, 2024
1 parent 0bcaed5 commit dcdfb16
Showing 1 changed file with 156 additions and 38 deletions.
194 changes: 156 additions & 38 deletions oauth2_provider/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,65 +20,183 @@ class Migration(migrations.Migration):

operations = [
migrations.CreateModel(
name='Application',
name="Application",
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('client_id', models.CharField(default=oauth2_provider.generators.generate_client_id, unique=True, max_length=100, db_index=True)),
('redirect_uris', models.TextField(help_text='Allowed URIs list, space separated', blank=True, validators=[oauth2_provider.validators.validate_uris])),
('client_type', models.CharField(max_length=32, choices=[('confidential', 'Confidential'), ('public', 'Public')])),
('authorization_grant_type', models.CharField(max_length=32, choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials')])),
('client_secret', models.CharField(default=oauth2_provider.generators.generate_client_secret, max_length=255, db_index=True, blank=True)),
('name', models.CharField(max_length=255, blank=True)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
),
),
(
"client_id",
models.CharField(
default=oauth2_provider.generators.generate_client_id,
unique=True,
max_length=100,
db_index=True,
),
),
(
"redirect_uris",
models.TextField(
help_text="Allowed URIs list, space separated",
blank=True,
validators=[oauth2_provider.validators.validate_uris],
),
),
(
"client_type",
models.CharField(
max_length=32,
choices=[
("confidential", "Confidential"),
("public", "Public"),
],
),
),
(
"authorization_grant_type",
models.CharField(
max_length=32,
choices=[
("authorization-code", "Authorization code"),
("implicit", "Implicit"),
("password", "Resource owner password-based"),
("client-credentials", "Client credentials"),
],
),
),
(
"client_secret",
models.CharField(
default=oauth2_provider.generators.generate_client_secret,
max_length=255,
db_index=True,
blank=True,
),
),
("name", models.CharField(max_length=255, blank=True)),
("skip_authorization", models.BooleanField(default=False)),
(
"user",
models.ForeignKey(
to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE
),
),
],
options={
'abstract': False,
'swappable': 'OAUTH2_PROVIDER_APPLICATION_MODEL',
"abstract": False,
"swappable": "OAUTH2_PROVIDER_APPLICATION_MODEL",
},
),
migrations.CreateModel(
name='AccessToken',
name="AccessToken",
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('token', models.CharField(max_length=255, db_index=True)),
('expires', models.DateTimeField()),
('scope', models.TextField(blank=True)),
('application', models.ForeignKey(to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
),
),
("token", models.CharField(max_length=255, db_index=True)),
("expires", models.DateTimeField()),
("scope", models.TextField(blank=True)),
(
"application",
models.ForeignKey(
to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE
),
),
(
"user",
models.ForeignKey(
to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE
),
),
],
options={
'abstract': False,
'swappable': 'OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL',
"abstract": False,
"swappable": "OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL",
},
),
migrations.CreateModel(
name='Grant',
name="Grant",
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('code', models.CharField(max_length=255, db_index=True)),
('expires', models.DateTimeField()),
('redirect_uri', models.CharField(max_length=255)),
('scope', models.TextField(blank=True)),
('application', models.ForeignKey(to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
),
),
("code", models.CharField(max_length=255, db_index=True)),
("expires", models.DateTimeField()),
("redirect_uri", models.CharField(max_length=255)),
("scope", models.TextField(blank=True)),
(
"application",
models.ForeignKey(
to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE
),
),
(
"user",
models.ForeignKey(
to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE
),
),
],
options={
'abstract': False,
'swappable': 'OAUTH2_PROVIDER_GRANT_MODEL',
"abstract": False,
"swappable": "OAUTH2_PROVIDER_GRANT_MODEL",
},
),
migrations.CreateModel(
name='RefreshToken',
name="RefreshToken",
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('token', models.CharField(max_length=255, db_index=True)),
('access_token', models.OneToOneField(related_name='refresh_token', to=oauth2_settings.ACCESS_TOKEN_MODEL, on_delete=models.CASCADE)),
('application', models.ForeignKey(to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
),
),
("token", models.CharField(max_length=255, db_index=True)),
(
"access_token",
models.OneToOneField(
related_name="refresh_token",
to=oauth2_settings.ACCESS_TOKEN_MODEL,
on_delete=models.CASCADE,
),
),
(
"application",
models.ForeignKey(
to=oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE
),
),
(
"user",
models.ForeignKey(
to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE
),
),
],
options={
'abstract': False,
'swappable': 'OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL',
"abstract": False,
"swappable": "OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL",
},
),
]

0 comments on commit dcdfb16

Please sign in to comment.