2020-05-16 14:02:42 +00:00
|
|
|
# Generated by Django 2.2.6 on 2019-10-07 14:07
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
import django.db.models.deletion
|
2018-11-24 21:26:53 +00:00
|
|
|
import oauth2_provider.generators
|
2018-11-16 08:10:35 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
2018-11-25 11:31:11 +00:00
|
|
|
run_before = [
|
2019-12-31 11:51:16 +00:00
|
|
|
("oauth2_provider", "0001_initial"),
|
2018-11-25 11:31:11 +00:00
|
|
|
]
|
|
|
|
|
2018-11-16 08:10:35 +00:00
|
|
|
dependencies = [
|
2018-11-24 21:26:53 +00:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
2020-05-16 14:02:42 +00:00
|
|
|
("passbook_core", "0001_initial"),
|
2018-11-16 08:10:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2020-05-16 14:02:42 +00:00
|
|
|
name="OAuth2Provider",
|
2018-11-16 08:10:35 +00:00
|
|
|
fields=[
|
2019-12-31 11:51:16 +00:00
|
|
|
(
|
2020-05-16 14:02:42 +00:00
|
|
|
"provider_ptr",
|
2019-12-31 11:51:16 +00:00
|
|
|
models.OneToOneField(
|
|
|
|
auto_created=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
parent_link=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
2020-05-16 14:02:42 +00:00
|
|
|
to="passbook_core.Provider",
|
2019-12-31 11:51:16 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"client_id",
|
|
|
|
models.CharField(
|
|
|
|
db_index=True,
|
|
|
|
default=oauth2_provider.generators.generate_client_id,
|
|
|
|
max_length=100,
|
|
|
|
unique=True,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"redirect_uris",
|
|
|
|
models.TextField(
|
|
|
|
blank=True, help_text="Allowed URIs list, space separated"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"client_type",
|
|
|
|
models.CharField(
|
|
|
|
choices=[
|
|
|
|
("confidential", "Confidential"),
|
|
|
|
("public", "Public"),
|
|
|
|
],
|
|
|
|
max_length=32,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"authorization_grant_type",
|
|
|
|
models.CharField(
|
|
|
|
choices=[
|
|
|
|
("authorization-code", "Authorization code"),
|
|
|
|
("implicit", "Implicit"),
|
|
|
|
("password", "Resource owner password-based"),
|
|
|
|
("client-credentials", "Client credentials"),
|
|
|
|
],
|
|
|
|
max_length=32,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"client_secret",
|
|
|
|
models.CharField(
|
|
|
|
blank=True,
|
|
|
|
db_index=True,
|
|
|
|
default=oauth2_provider.generators.generate_client_secret,
|
|
|
|
max_length=255,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(blank=True, max_length=255)),
|
|
|
|
("skip_authorization", models.BooleanField(default=False)),
|
|
|
|
("created", models.DateTimeField(auto_now_add=True)),
|
|
|
|
("updated", models.DateTimeField(auto_now=True)),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
blank=True,
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2020-05-16 14:02:42 +00:00
|
|
|
related_name="passbook_providers_oauth_oauth2provider",
|
2019-12-31 11:51:16 +00:00
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
2018-11-16 08:10:35 +00:00
|
|
|
],
|
2018-11-24 21:26:53 +00:00
|
|
|
options={
|
2020-05-16 14:02:42 +00:00
|
|
|
"verbose_name": "OAuth2 Provider",
|
|
|
|
"verbose_name_plural": "OAuth2 Providers",
|
2018-11-24 21:26:53 +00:00
|
|
|
},
|
2020-05-16 14:02:42 +00:00
|
|
|
bases=("passbook_core.provider", models.Model),
|
2018-11-16 08:10:35 +00:00
|
|
|
),
|
|
|
|
]
|