mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-03-15 13:36:18 +00:00
gatekeeper and app_gateway first commit
This commit is contained in:
97
gatekeeper/migrations/0001_initial.py
Normal file
97
gatekeeper/migrations/0001_initial.py
Normal file
@@ -0,0 +1,97 @@
|
||||
# Generated by Django 5.2.12 on 2026-03-11 19:35
|
||||
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='AuthMethod',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.SlugField(max_length=64, unique=True)),
|
||||
('auth_type', models.CharField(choices=[('local_password', 'Local Password'), ('totp', 'TOTP'), ('oidc', 'OIDC')], max_length=32)),
|
||||
('totp_secret', models.CharField(blank=True, help_text='Shared/global TOTP secret key', max_length=255)),
|
||||
('oidc_provider', models.CharField(blank=True, max_length=64)),
|
||||
('oidc_client_id', models.CharField(blank=True, max_length=255)),
|
||||
('oidc_client_secret', models.CharField(blank=True, max_length=255)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='GatekeeperUser',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('username', models.SlugField(max_length=64, unique=True)),
|
||||
('email', models.EmailField(max_length=254, unique=True)),
|
||||
('password', models.CharField(blank=True, help_text='Password for local authentication (leave blank if not using)', max_length=128)),
|
||||
('totp_secret', models.CharField(blank=True, help_text='Per-user TOTP secret key', max_length=255)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Gatekeeper User',
|
||||
'verbose_name_plural': 'Gatekeeper Users',
|
||||
'ordering': ['username'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='GatekeeperGroup',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.SlugField(max_length=64, unique=True)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('users', models.ManyToManyField(blank=True, related_name='groups', to='gatekeeper.gatekeeperuser')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Gatekeeper Group',
|
||||
'verbose_name_plural': 'Gatekeeper Groups',
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AuthMethodAllowedDomain',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('domain', models.CharField(max_length=255)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('auth_method', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='allowed_domains', to='gatekeeper.authmethod')),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('auth_method', 'domain')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='AuthMethodAllowedEmail',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('email', models.EmailField(max_length=254)),
|
||||
('created', models.DateTimeField(auto_now_add=True)),
|
||||
('updated', models.DateTimeField(auto_now=True)),
|
||||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
|
||||
('auth_method', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='allowed_emails', to='gatekeeper.authmethod')),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('auth_method', 'email')},
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user