IdHub/oidc4vp/migrations/0001_initial.py

138 lines
4.6 KiB
Python
Raw Normal View History

2024-01-17 13:11:47 +00:00
# Generated by Django 4.2.5 on 2024-01-17 13:11
2023-11-24 16:53:43 +00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import oidc4vp.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Authorization',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
'code',
models.CharField(default=oidc4vp.models.set_code, max_length=24),
),
2024-01-16 13:00:28 +00:00
('code_used', models.BooleanField(default=False)),
2023-11-24 16:53:43 +00:00
('created', models.DateTimeField(auto_now=True)),
('presentation_definition', models.CharField(max_length=250)),
],
),
migrations.CreateModel(
name='Organization',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('name', models.CharField(max_length=250)),
(
'client_id',
models.CharField(
2023-11-24 17:10:43 +00:00
default=oidc4vp.models.set_client_id, max_length=24, unique=True
2023-11-24 16:53:43 +00:00
),
),
(
'client_secret',
models.CharField(
default=oidc4vp.models.set_client_secret, max_length=48
),
),
2023-11-29 10:19:17 +00:00
('my_client_id', models.CharField(max_length=24)),
('my_client_secret', models.CharField(max_length=48)),
2023-11-24 16:53:43 +00:00
(
'response_uri',
models.URLField(
help_text='Url where to send the verificable presentation',
max_length=250,
),
),
],
),
migrations.CreateModel(
name='OAuth2VPToken',
fields=[
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('created', models.DateTimeField(auto_now=True)),
2023-12-11 11:11:18 +00:00
('result_verify', models.CharField(max_length=255)),
('vp_token', models.TextField()),
2023-11-24 16:53:43 +00:00
(
'authorization',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
2024-01-16 13:00:28 +00:00
related_name='vp_tokens',
2023-11-24 16:53:43 +00:00
to='oidc4vp.authorization',
),
),
(
'organization',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='vp_tokens',
to='oidc4vp.organization',
),
),
(
'user',
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='vp_tokens',
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.AddField(
model_name='authorization',
name='organization',
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='authorizations',
to='oidc4vp.organization',
),
),
migrations.AddField(
model_name='authorization',
name='user',
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
]