mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-03-17 14:26:18 +00:00
remove unused TOTP field and update user model constraints
This commit is contained in:
@@ -5,8 +5,7 @@
|
|||||||
},
|
},
|
||||||
"totp_default": {
|
"totp_default": {
|
||||||
"type": "totp",
|
"type": "totp",
|
||||||
"totp_secret": "",
|
"totp_secret": ""
|
||||||
"totp_before_auth": false
|
|
||||||
},
|
},
|
||||||
"google_workspace_admins": {
|
"google_workspace_admins": {
|
||||||
"type": "oidc",
|
"type": "oidc",
|
||||||
|
|||||||
@@ -92,14 +92,13 @@ class AuthMethodForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = AuthMethod
|
model = AuthMethod
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'auth_type', 'totp_secret', 'totp_before_auth',
|
'name', 'auth_type', 'totp_secret',
|
||||||
'oidc_provider', 'oidc_client_id', 'oidc_client_secret'
|
'oidc_provider', 'oidc_client_id', 'oidc_client_secret'
|
||||||
]
|
]
|
||||||
labels = {
|
labels = {
|
||||||
'name': _('Name'),
|
'name': _('Name'),
|
||||||
'auth_type': _('Authentication Type'),
|
'auth_type': _('Authentication Type'),
|
||||||
'totp_secret': _('Global TOTP Secret'),
|
'totp_secret': _('Global TOTP Secret'),
|
||||||
'totp_before_auth': _('Global TOTP Before Authentication'),
|
|
||||||
'oidc_provider': _('OIDC Provider URL'),
|
'oidc_provider': _('OIDC Provider URL'),
|
||||||
'oidc_client_id': _('OIDC Client ID'),
|
'oidc_client_id': _('OIDC Client ID'),
|
||||||
'oidc_client_secret': _('OIDC Client Secret'),
|
'oidc_client_secret': _('OIDC Client Secret'),
|
||||||
@@ -122,7 +121,6 @@ class AuthMethodForm(forms.ModelForm):
|
|||||||
Div(
|
Div(
|
||||||
Div('totp_secret', css_class='col-xl-6'),
|
Div('totp_secret', css_class='col-xl-6'),
|
||||||
Div('totp_pin', css_class='col-xl-6'),
|
Div('totp_pin', css_class='col-xl-6'),
|
||||||
Div('totp_before_auth', css_class='col-xl-12'),
|
|
||||||
css_class='row totp-group'
|
css_class='row totp-group'
|
||||||
),
|
),
|
||||||
Div(
|
Div(
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Generated by Django 5.2.12 on 2026-03-15 19:28
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('gatekeeper', '0006_gatekeeperuser_password_hash'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='authmethod',
|
||||||
|
name='totp_before_auth',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='gatekeeperuser',
|
||||||
|
name='password_hash',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='gatekeeperuser',
|
||||||
|
name='email',
|
||||||
|
field=models.EmailField(blank=True, max_length=254, unique=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='gatekeeperuser',
|
||||||
|
name='password',
|
||||||
|
field=models.CharField(blank=True, help_text='Password for local authentication (leave blank if not using)', max_length=250),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -15,7 +15,6 @@ class AuthMethod(models.Model):
|
|||||||
|
|
||||||
# TOTP-specific fields
|
# TOTP-specific fields
|
||||||
totp_secret = models.CharField(max_length=255, blank=True, help_text=_("Shared/global TOTP secret key"))
|
totp_secret = models.CharField(max_length=255, blank=True, help_text=_("Shared/global TOTP secret key"))
|
||||||
totp_before_auth = models.BooleanField(default=False)
|
|
||||||
|
|
||||||
# OIDC-specific fields
|
# OIDC-specific fields
|
||||||
oidc_provider = models.CharField(max_length=64, blank=True)
|
oidc_provider = models.CharField(max_length=64, blank=True)
|
||||||
@@ -65,9 +64,8 @@ class AuthMethodAllowedEmail(models.Model):
|
|||||||
|
|
||||||
class GatekeeperUser(models.Model):
|
class GatekeeperUser(models.Model):
|
||||||
username = models.SlugField(max_length=64, unique=True)
|
username = models.SlugField(max_length=64, unique=True)
|
||||||
email = models.EmailField(unique=True)
|
email = models.EmailField(unique=True, blank=True)
|
||||||
password = models.CharField(blank=True, max_length=128, help_text=_("Password for local authentication (leave blank if not using)"))
|
password = models.CharField(blank=True, max_length=250, help_text=_("Password for local authentication (leave blank if not using)"))
|
||||||
password_hash = models.CharField(blank=True, null=True, max_length=128)
|
|
||||||
totp_secret = models.CharField(max_length=255, blank=True, help_text=_("Per-user TOTP secret key"))
|
totp_secret = models.CharField(max_length=255, blank=True, help_text=_("Per-user TOTP secret key"))
|
||||||
|
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user