From 0a189ceeb5d768bc99fe93fe707b2b8fa5a155fd Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 4 Sep 2023 18:09:20 +0200 Subject: [PATCH] fix inheritance Signed-off-by: Jens Langhammer --- .../stages/authenticator_mobile/models.py | 2 +- ...alidatestage_webauthn_user_verification.py | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index f6e52cffd..159665258 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -8,7 +8,6 @@ from django.http import HttpRequest from django.utils.translation import gettext as __ from django.utils.translation import gettext_lazy as _ from django.views import View -from django_otp.models import Device from firebase_admin import credentials, initialize_app from firebase_admin.exceptions import FirebaseError from firebase_admin.messaging import ( @@ -29,6 +28,7 @@ from authentik.core.types import UserSettingSerializer from authentik.flows.models import ConfigurableStage, FriendlyNamedStage, Stage from authentik.lib.generators import generate_id from authentik.lib.models import SerializerModel +from authentik.stages.authenticator.models import Device from authentik.tenants.utils import DEFAULT_TENANT cred = credentials.Certificate("firebase.json") diff --git a/authentik/stages/authenticator_validate/migrations/0012_authenticatorvalidatestage_webauthn_user_verification.py b/authentik/stages/authenticator_validate/migrations/0012_authenticatorvalidatestage_webauthn_user_verification.py index 81d07d47d..55bec64bb 100644 --- a/authentik/stages/authenticator_validate/migrations/0012_authenticatorvalidatestage_webauthn_user_verification.py +++ b/authentik/stages/authenticator_validate/migrations/0012_authenticatorvalidatestage_webauthn_user_verification.py @@ -1,7 +1,10 @@ # Generated by Django 4.1.3 on 2022-11-21 16:45 +import django.contrib.postgres.fields from django.db import migrations, models +import authentik.stages.authenticator_validate.models + class Migration(migrations.Migration): dependencies = [ @@ -25,4 +28,23 @@ class Migration(migrations.Migration): help_text="Enforce user verification for WebAuthn devices.", ), ), + migrations.AlterField( + model_name="authenticatorvalidatestage", + name="device_classes", + field=django.contrib.postgres.fields.ArrayField( + base_field=models.TextField( + choices=[ + ("static", "Static"), + ("totp", "TOTP"), + ("webauthn", "WebAuthn"), + ("duo", "Duo"), + ("sms", "SMS"), + ("mobile", "authentik Mobile"), + ] + ), + default=authentik.stages.authenticator_validate.models.default_device_classes, + help_text="Device classes which can be used to authenticate", + size=None, + ), + ), ]