# Generated by Django 5.2.12 on 2026-03-24 13:00

import datetime
import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    replaces = [
        (
            "authentik_stages_authenticator_webauthn",
            "0012_webauthndevice_created_webauthndevice_last_updated_and_more",
        ),
        ("authentik_stages_authenticator_webauthn", "0013_authenticatorwebauthnstage_max_attempts"),
        (
            "authentik_stages_authenticator_webauthn",
            "0014_alter_authenticatorwebauthnstage_friendly_name",
        ),
        ("authentik_stages_authenticator_webauthn", "0015_authenticatorwebauthnstage_hints"),
        (
            "authentik_stages_authenticator_webauthn",
            "0016_authenticatorwebauthnstage_prevent_duplicate_devices_and_more",
        ),
    ]

    dependencies = [
        ("authentik_stages_authenticator_webauthn", "0001_squashed_0011_webauthndevice_aaguid"),
    ]

    operations = [
        migrations.AddField(
            model_name="webauthndevice",
            name="created",
            field=models.DateTimeField(
                auto_now_add=True,
                default=datetime.datetime(1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc),
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="webauthndevice",
            name="last_updated",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name="webauthndevice",
            name="last_used",
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name="authenticatorwebauthnstage",
            name="max_attempts",
            field=models.PositiveIntegerField(default=0),
        ),
        migrations.AlterField(
            model_name="authenticatorwebauthnstage",
            name="friendly_name",
            field=models.TextField(blank=True, default=""),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="authenticatorwebauthnstage",
            name="hints",
            field=django.contrib.postgres.fields.ArrayField(
                base_field=models.TextField(
                    choices=[
                        ("security-key", "Security Key"),
                        ("client-device", "Client Device"),
                        ("hybrid", "Hybrid"),
                    ]
                ),
                blank=True,
                default=list,
                size=None,
            ),
        ),
        migrations.AddField(
            model_name="authenticatorwebauthnstage",
            name="prevent_duplicate_devices",
            field=models.BooleanField(
                default=True, help_text="When enabled, a given device can only be registered once."
            ),
        ),
        migrations.AddField(
            model_name="webauthndevice",
            name="attestation_certificate_fingerprint",
            field=models.TextField(default=None, null=True),
        ),
        migrations.AddField(
            model_name="webauthndevice",
            name="attestation_certificate_pem",
            field=models.TextField(default=None, null=True),
        ),
    ]
