diff --git a/authentik/core/migrations/0002_auto_20200523_1133.py b/authentik/core/migrations/0002_auto_20200523_1133.py deleted file mode 100644 index ecc0717fc..000000000 --- a/authentik/core/migrations/0002_auto_20200523_1133.py +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 11:33 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0003_auto_20200523_1133"), - ("authentik_core", "0001_initial"), - ] - - operations = [ - migrations.RemoveField( - model_name="application", - name="skip_authorization", - ), - migrations.AddField( - model_name="source", - name="authentication_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Flow to use when authenticating existing users.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="source_authentication", - to="authentik_flows.Flow", - ), - ), - migrations.AddField( - model_name="source", - name="enrollment_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Flow to use when enrolling new users.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="source_enrollment", - to="authentik_flows.Flow", - ), - ), - migrations.AddField( - model_name="provider", - name="authorization_flow", - field=models.ForeignKey( - help_text="Flow used when authorizing this provider.", - on_delete=django.db.models.deletion.CASCADE, - related_name="provider_authorization", - to="authentik_flows.Flow", - ), - ), - ] diff --git a/authentik/core/migrations/0003_default_user.py b/authentik/core/migrations/0003_default_user.py deleted file mode 100644 index 6549a1ded..000000000 --- a/authentik/core/migrations/0003_default_user.py +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 16:40 -from os import environ - -from django.apps.registry import Apps -from django.conf import settings -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def create_default_user(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - from django.contrib.auth.hashers import make_password - - User = apps.get_model("authentik_core", "User") - db_alias = schema_editor.connection.alias - - akadmin, _ = User.objects.using(db_alias).get_or_create( - username="akadmin", email="root@localhost", name="authentik Default Admin" - ) - password = None - if "TF_BUILD" in environ or settings.TEST: - password = "akadmin" # noqa # nosec - if "AK_ADMIN_PASS" in environ: - password = environ["AK_ADMIN_PASS"] - if "AUTHENTIK_BOOTSTRAP_PASSWORD" in environ: - password = environ["AUTHENTIK_BOOTSTRAP_PASSWORD"] - if password: - akadmin.password = make_password(password) - else: - akadmin.password = make_password(None) - akadmin.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0002_auto_20200523_1133"), - ] - - operations = [ - migrations.RemoveField( - model_name="user", - name="is_superuser", - ), - migrations.RemoveField( - model_name="user", - name="is_staff", - ), - migrations.RunPython(create_default_user), - migrations.AddField( - model_name="user", - name="is_superuser", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="user", name="is_staff", field=models.BooleanField(default=False) - ), - ] diff --git a/authentik/core/migrations/0004_auto_20200703_2213.py b/authentik/core/migrations/0004_auto_20200703_2213.py deleted file mode 100644 index e3e98bea6..000000000 --- a/authentik/core/migrations/0004_auto_20200703_2213.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.0.7 on 2020-07-03 22:13 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0003_default_user"), - ] - - operations = [ - migrations.AlterModelOptions( - name="application", - options={ - "verbose_name": "Application", - "verbose_name_plural": "Applications", - }, - ), - migrations.AlterModelOptions( - name="user", - options={ - "permissions": (("reset_user_password", "Reset Password"),), - "verbose_name": "User", - "verbose_name_plural": "Users", - }, - ), - ] diff --git a/authentik/core/migrations/0005_token_intent.py b/authentik/core/migrations/0005_token_intent.py deleted file mode 100644 index b7790106d..000000000 --- a/authentik/core/migrations/0005_token_intent.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.0.7 on 2020-07-05 21:11 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0004_auto_20200703_2213"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="intent", - field=models.TextField( - choices=[ - ("verification", "Intent Verification"), - ("api", "Intent Api"), - ], - default="verification", - ), - ), - ] diff --git a/authentik/core/migrations/0006_auto_20200709_1608.py b/authentik/core/migrations/0006_auto_20200709_1608.py deleted file mode 100644 index 7b5de5fcf..000000000 --- a/authentik/core/migrations/0006_auto_20200709_1608.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-09 16:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0005_token_intent"), - ] - - operations = [ - migrations.AlterField( - model_name="source", - name="slug", - field=models.SlugField(help_text="Internal source name, used in URLs.", unique=True), - ), - ] diff --git a/authentik/core/migrations/0007_auto_20200815_1841.py b/authentik/core/migrations/0007_auto_20200815_1841.py deleted file mode 100644 index a7f0de6e5..000000000 --- a/authentik/core/migrations/0007_auto_20200815_1841.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1 on 2020-08-15 18:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0006_auto_20200709_1608"), - ] - - operations = [ - migrations.AlterField( - model_name="user", - name="first_name", - field=models.CharField(blank=True, max_length=150, verbose_name="first name"), - ), - ] diff --git a/authentik/core/migrations/0008_auto_20200824_1532.py b/authentik/core/migrations/0008_auto_20200824_1532.py deleted file mode 100644 index 13ba0d3d1..000000000 --- a/authentik/core/migrations/0008_auto_20200824_1532.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.1 on 2020-08-24 15:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("auth", "0012_alter_user_first_name_max_length"), - ("authentik_core", "0007_auto_20200815_1841"), - ] - - operations = [ - migrations.RemoveField( - model_name="user", - name="groups", - field=models.ManyToManyField(to="authentik_core.Group"), - ), - migrations.AddField( - model_name="user", - name="groups", - field=models.ManyToManyField( - blank=True, - help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.", - related_name="user_set", - related_query_name="user", - to="auth.Group", - verbose_name="groups", - ), - ), - migrations.AddField( - model_name="user", - name="pb_groups", - field=models.ManyToManyField(to="authentik_core.Group"), - ), - ] diff --git a/authentik/core/migrations/0009_group_is_superuser.py b/authentik/core/migrations/0009_group_is_superuser.py deleted file mode 100644 index 9b4d43fdd..000000000 --- a/authentik/core/migrations/0009_group_is_superuser.py +++ /dev/null @@ -1,59 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-15 19:53 -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.core.models - - -def create_default_admin_group(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - Group = apps.get_model("authentik_core", "Group") - User = apps.get_model("authentik_core", "User") - - # Creates a default admin group - group, _ = Group.objects.using(db_alias).get_or_create( - is_superuser=True, - defaults={ - "name": "authentik Admins", - }, - ) - group.users.set(User.objects.filter(username="akadmin")) - group.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0008_auto_20200824_1532"), - ] - - operations = [ - migrations.RemoveField( - model_name="user", - name="is_superuser", - ), - migrations.RemoveField( - model_name="user", - name="is_staff", - ), - migrations.AlterField( - model_name="user", - name="pb_groups", - field=models.ManyToManyField(related_name="users", to="authentik_core.Group"), - ), - migrations.AddField( - model_name="group", - name="is_superuser", - field=models.BooleanField( - default=False, help_text="Users added to this group will be superusers." - ), - ), - migrations.RunPython(create_default_admin_group), - migrations.AlterModelManagers( - name="user", - managers=[ - ("objects", authentik.core.models.UserManager()), - ], - ), - ] diff --git a/authentik/core/migrations/0010_auto_20200917_1021.py b/authentik/core/migrations/0010_auto_20200917_1021.py deleted file mode 100644 index d9e670dac..000000000 --- a/authentik/core/migrations/0010_auto_20200917_1021.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-17 10:21 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0009_group_is_superuser"), - ] - - operations = [ - migrations.AlterModelOptions( - name="user", - options={ - "permissions": ( - ("reset_user_password", "Reset Password"), - ("impersonate", "Can impersonate other users"), - ), - "verbose_name": "User", - "verbose_name_plural": "Users", - }, - ), - ] diff --git a/authentik/core/migrations/0011_provider_name_temp.py b/authentik/core/migrations/0011_provider_name_temp.py deleted file mode 100644 index 9b38c50d2..000000000 --- a/authentik/core/migrations/0011_provider_name_temp.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-03 17:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0010_auto_20200917_1021"), - ] - - operations = [ - migrations.AddField( - model_name="provider", - name="name_temp", - field=models.TextField(default=""), - preserve_default=False, - ), - ] diff --git a/authentik/core/migrations/0012_auto_20201003_1737.py b/authentik/core/migrations/0012_auto_20201003_1737.py deleted file mode 100644 index 8ec00aa24..000000000 --- a/authentik/core/migrations/0012_auto_20201003_1737.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-03 17:37 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0011_provider_name_temp"), - ("authentik_providers_oauth2", "0006_remove_oauth2provider_name"), - ("authentik_providers_saml", "0006_remove_samlprovider_name"), - ] - - operations = [ - migrations.RenameField( - model_name="provider", - old_name="name_temp", - new_name="name", - ), - ] diff --git a/authentik/core/migrations/0013_auto_20201003_2132.py b/authentik/core/migrations/0013_auto_20201003_2132.py deleted file mode 100644 index 9ed9b3624..000000000 --- a/authentik/core/migrations/0013_auto_20201003_2132.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-03 21:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0012_auto_20201003_1737"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="identifier", - field=models.TextField(default=""), - preserve_default=False, - ), - migrations.AlterField( - model_name="token", - name="intent", - field=models.TextField( - choices=[ - ("verification", "Intent Verification"), - ("api", "Intent Api"), - ("recovery", "Intent Recovery"), - ], - default="verification", - ), - ), - migrations.AlterUniqueTogether( - name="token", - unique_together={("identifier", "user")}, - ), - ] diff --git a/authentik/core/migrations/0014_auto_20201018_1158.py b/authentik/core/migrations/0014_auto_20201018_1158.py deleted file mode 100644 index 750532913..000000000 --- a/authentik/core/migrations/0014_auto_20201018_1158.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-18 11:58 -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.core.models - - -def set_default_token_key(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - Token = apps.get_model("authentik_core", "Token") - - for token in Token.objects.using(db_alias).all(): - token.key = token.pk.hex - token.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0013_auto_20201003_2132"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="key", - field=models.TextField(default=authentik.core.models.default_token_key), - ), - migrations.AlterUniqueTogether( - name="token", - unique_together=set(), - ), - migrations.AlterField( - model_name="token", - name="identifier", - field=models.SlugField(max_length=255), - ), - migrations.AddIndex( - model_name="token", - index=models.Index(fields=["key"], name="authentik_co_key_e45007_idx"), - ), - migrations.AddIndex( - model_name="token", - index=models.Index(fields=["identifier"], name="authentik_co_identif_1a34a8_idx"), - ), - migrations.RunPython(set_default_token_key), - ] diff --git a/authentik/core/migrations/0015_application_icon.py b/authentik/core/migrations/0015_application_icon.py deleted file mode 100644 index 75c8c42bd..000000000 --- a/authentik/core/migrations/0015_application_icon.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-23 17:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0014_auto_20201018_1158"), - ] - - operations = [ - migrations.RemoveField( - model_name="application", - name="meta_icon_url", - ), - migrations.AddField( - model_name="application", - name="meta_icon", - field=models.FileField(blank=True, default="", upload_to="application-icons/"), - ), - ] diff --git a/authentik/core/migrations/0016_auto_20201202_2234.py b/authentik/core/migrations/0016_auto_20201202_2234.py deleted file mode 100644 index a2b5cc0db..000000000 --- a/authentik/core/migrations/0016_auto_20201202_2234.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.1.3 on 2020-12-02 22:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0015_application_icon"), - ] - - operations = [ - migrations.RemoveIndex( - model_name="token", - name="authentik_co_key_e45007_idx", - ), - migrations.RemoveIndex( - model_name="token", - name="authentik_co_identif_1a34a8_idx", - ), - migrations.RenameField( - model_name="user", - old_name="pb_groups", - new_name="ak_groups", - ), - migrations.AddIndex( - model_name="token", - index=models.Index(fields=["identifier"], name="authentik_c_identif_d9d032_idx"), - ), - migrations.AddIndex( - model_name="token", - index=models.Index(fields=["key"], name="authentik_c_key_f71355_idx"), - ), - ] diff --git a/authentik/core/migrations/0018_auto_20210330_1345.py b/authentik/core/migrations/0018_auto_20210330_1345.py deleted file mode 100644 index 6d2756f24..000000000 --- a/authentik/core/migrations/0018_auto_20210330_1345.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-30 13:45 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0017_managed"), - ] - - operations = [ - migrations.AlterModelOptions( - name="token", - options={ - "permissions": (("view_token_key", "View token's key"),), - "verbose_name": "Token", - "verbose_name_plural": "Tokens", - }, - ), - ] diff --git a/authentik/core/migrations/0019_source_managed.py b/authentik/core/migrations/0019_source_managed.py deleted file mode 100644 index 756164186..000000000 --- a/authentik/core/migrations/0019_source_managed.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2 on 2021-04-09 14:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0018_auto_20210330_1345"), - ] - - operations = [ - migrations.AddField( - model_name="source", - name="managed", - field=models.TextField( - default=None, - help_text="Objects which are managed by authentik. These objects are created and updated automatically. This is flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.", - null=True, - unique=True, - verbose_name="Managed by authentik", - ), - ), - ] diff --git a/authentik/core/migrations/0020_source_user_matching_mode.py b/authentik/core/migrations/0020_source_user_matching_mode.py deleted file mode 100644 index aca0ad617..000000000 --- a/authentik/core/migrations/0020_source_user_matching_mode.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.2 on 2021-05-03 17:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0019_source_managed"), - ] - - operations = [ - migrations.AddField( - model_name="source", - name="user_matching_mode", - field=models.TextField( - choices=[ - ("identifier", "Use the source-specific identifier"), - ( - "email_link", - "Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses.", - ), - ( - "email_deny", - "Use the user's email address, but deny enrollment when the email address already exists.", - ), - ( - "username_link", - "Link to a user with identical username. Can have security implications when a username is used with another source.", - ), - ( - "username_deny", - "Use the user's username, but deny enrollment when the username already exists.", - ), - ], - default="identifier", - help_text="How the source determines if an existing user should be authenticated or a new user enrolled.", - ), - ), - ] diff --git a/authentik/core/migrations/0021_alter_application_slug.py b/authentik/core/migrations/0021_alter_application_slug.py deleted file mode 100644 index 7ef52e7d2..000000000 --- a/authentik/core/migrations/0021_alter_application_slug.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-14 08:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0020_source_user_matching_mode"), - ] - - operations = [ - migrations.AlterField( - model_name="application", - name="slug", - field=models.SlugField( - help_text="Internal application name, used in URLs.", unique=True - ), - ), - ] diff --git a/authentik/core/migrations/0022_authenticatedsession.py b/authentik/core/migrations/0022_authenticatedsession.py deleted file mode 100644 index 63e3aa817..000000000 --- a/authentik/core/migrations/0022_authenticatedsession.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-29 22:14 - -import uuid - -import django.db.models.deletion -from django.apps.registry import Apps -from django.conf import settings -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.core.models - - -def migrate_sessions(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - from django.contrib.sessions.backends.cache import KEY_PREFIX - from django.core.cache import cache - - session_keys = cache.keys(KEY_PREFIX + "*") - cache.delete_many(session_keys) - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0021_alter_application_slug"), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatedSession", - fields=[ - ( - "expires", - models.DateTimeField(default=authentik.core.models.default_token_duration), - ), - ("expiring", models.BooleanField(default=True)), - ( - "uuid", - models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False), - ), - ("session_key", models.CharField(max_length=40)), - ("last_ip", models.TextField()), - ("last_user_agent", models.TextField(blank=True)), - ("last_used", models.DateTimeField(auto_now=True)), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.RunPython(migrate_sessions), - ] diff --git a/authentik/core/migrations/0023_alter_application_meta_launch_url.py b/authentik/core/migrations/0023_alter_application_meta_launch_url.py deleted file mode 100644 index f94dfa57b..000000000 --- a/authentik/core/migrations/0023_alter_application_meta_launch_url.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-02 21:51 - -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0022_authenticatedsession"), - ] - - operations = [ - migrations.AlterField( - model_name="application", - name="meta_launch_url", - field=models.TextField( - blank=True, - default="", - validators=[authentik.lib.models.DomainlessURLValidator()], - ), - ), - ] diff --git a/authentik/core/migrations/0023_source_authentik_c_slug_ccb2e5_idx_and_more.py b/authentik/core/migrations/0023_source_authentik_c_slug_ccb2e5_idx_and_more.py new file mode 100644 index 000000000..4711a9680 --- /dev/null +++ b/authentik/core/migrations/0023_source_authentik_c_slug_ccb2e5_idx_and_more.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.2 on 2022-10-19 18:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_core", "0022_alter_group_parent"), + ] + + operations = [ + migrations.AddIndex( + model_name="source", + index=models.Index(fields=["slug"], name="authentik_c_slug_ccb2e5_idx"), + ), + migrations.AddIndex( + model_name="source", + index=models.Index(fields=["name"], name="authentik_c_name_affae6_idx"), + ), + ] diff --git a/authentik/core/migrations/0024_alter_token_identifier.py b/authentik/core/migrations/0024_alter_token_identifier.py deleted file mode 100644 index e3e2200ae..000000000 --- a/authentik/core/migrations/0024_alter_token_identifier.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-03 09:33 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor -from django.db.models import Count - - -def fix_duplicates(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - Token = apps.get_model("authentik_core", "token") - identifiers = ( - Token.objects.using(db_alias) - .values("identifier") - .annotate(identifier_count=Count("identifier")) - .filter(identifier_count__gt=1) - ) - for ident in identifiers: - Token.objects.using(db_alias).filter(identifier=ident["identifier"]).delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0023_alter_application_meta_launch_url"), - ] - - operations = [ - migrations.RunPython(fix_duplicates), - migrations.AlterField( - model_name="token", - name="identifier", - field=models.SlugField(max_length=255, unique=True), - ), - ] diff --git a/authentik/core/migrations/0025_alter_application_meta_icon.py b/authentik/core/migrations/0025_alter_application_meta_icon.py deleted file mode 100644 index e612cf8ac..000000000 --- a/authentik/core/migrations/0025_alter_application_meta_icon.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-05 19:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0024_alter_token_identifier"), - ] - - operations = [ - migrations.AlterField( - model_name="application", - name="meta_icon", - field=models.FileField(default=None, null=True, upload_to="application-icons/"), - ), - ] diff --git a/authentik/core/migrations/0026_alter_application_meta_icon.py b/authentik/core/migrations/0026_alter_application_meta_icon.py deleted file mode 100644 index 2510b7457..000000000 --- a/authentik/core/migrations/0026_alter_application_meta_icon.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-09 17:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0025_alter_application_meta_icon"), - ] - - operations = [ - migrations.AlterField( - model_name="application", - name="meta_icon", - field=models.FileField( - default=None, max_length=500, null=True, upload_to="application-icons/" - ), - ), - migrations.AlterModelOptions( - name="authenticatedsession", - options={ - "verbose_name": "Authenticated Session", - "verbose_name_plural": "Authenticated Sessions", - }, - ), - ] diff --git a/authentik/core/migrations/0027_bootstrap_token.py b/authentik/core/migrations/0027_bootstrap_token.py deleted file mode 100644 index 3b7054993..000000000 --- a/authentik/core/migrations/0027_bootstrap_token.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.5 on 2021-08-11 19:40 -from os import environ - -from django.apps.registry import Apps -from django.db import migrations -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def create_default_user_token(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - from authentik.core.models import TokenIntents - - User = apps.get_model("authentik_core", "User") - Token = apps.get_model("authentik_core", "Token") - - db_alias = schema_editor.connection.alias - - akadmin = User.objects.using(db_alias).filter(username="akadmin") - if not akadmin.exists(): - return - key = None - if "AK_ADMIN_TOKEN" in environ: - key = environ["AK_ADMIN_TOKEN"] - if "AUTHENTIK_BOOTSTRAP_TOKEN" in environ: - key = environ["AUTHENTIK_BOOTSTRAP_TOKEN"] - if not key: - return - Token.objects.using(db_alias).create( - identifier="authentik-bootstrap-token", - user=akadmin.first(), - intent=TokenIntents.INTENT_API, - expiring=False, - key=key, - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0026_alter_application_meta_icon"), - ] - - operations = [ - migrations.RunPython(create_default_user_token), - ] diff --git a/authentik/core/migrations/0028_alter_token_intent.py b/authentik/core/migrations/0028_alter_token_intent.py deleted file mode 100644 index 77fe3e0a1..000000000 --- a/authentik/core/migrations/0028_alter_token_intent.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.6 on 2021-08-23 14:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0027_bootstrap_token"), - ] - - operations = [ - migrations.AlterField( - model_name="token", - name="intent", - field=models.TextField( - choices=[ - ("verification", "Intent Verification"), - ("api", "Intent Api"), - ("recovery", "Intent Recovery"), - ("app_password", "Intent App Password"), - ], - default="verification", - ), - ), - ] diff --git a/authentik/core/models.py b/authentik/core/models.py index fef304082..4e747abc6 100644 --- a/authentik/core/models.py +++ b/authentik/core/models.py @@ -472,6 +472,21 @@ class Source(ManagedModel, SerializerModel, PolicyBindingModel): def __str__(self): return self.name + class Meta: + + indexes = [ + models.Index( + fields=[ + "slug", + ] + ), + models.Index( + fields=[ + "name", + ] + ), + ] + class UserSourceConnection(SerializerModel, CreatedUpdatedModel): """Connection between User and Source.""" diff --git a/authentik/events/migrations/0001_initial.py b/authentik/events/migrations/0001_initial.py deleted file mode 100644 index 93f8d652a..000000000 --- a/authentik/events/migrations/0001_initial.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:08 - -import uuid - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name="Event", - fields=[ - ( - "event_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "action", - models.TextField( - choices=[ - ("LOGIN", "login"), - ("LOGIN_FAILED", "login_failed"), - ("LOGOUT", "logout"), - ("AUTHORIZE_APPLICATION", "authorize_application"), - ("SUSPICIOUS_REQUEST", "suspicious_request"), - ("SIGN_UP", "sign_up"), - ("PASSWORD_RESET", "password_reset"), - ("INVITE_CREATED", "invitation_created"), - ("INVITE_USED", "invitation_used"), - ("CUSTOM", "custom"), - ] - ), - ), - ("date", models.DateTimeField(auto_now_add=True)), - ("app", models.TextField()), - ( - "context", - models.JSONField(blank=True, default=dict), - ), - ("client_ip", models.GenericIPAddressField(null=True)), - ("created", models.DateTimeField(auto_now_add=True)), - ( - "user", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "verbose_name": "Event", - "verbose_name_plural": "Events", - }, - ), - ] diff --git a/authentik/events/migrations/0002_auto_20200918_2116.py b/authentik/events/migrations/0002_auto_20200918_2116.py deleted file mode 100644 index 869376a90..000000000 --- a/authentik/events/migrations/0002_auto_20200918_2116.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-18 21:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("LOGIN", "login"), - ("LOGIN_FAILED", "login_failed"), - ("LOGOUT", "logout"), - ("AUTHORIZE_APPLICATION", "authorize_application"), - ("SUSPICIOUS_REQUEST", "suspicious_request"), - ("SIGN_UP", "sign_up"), - ("PASSWORD_RESET", "password_reset"), - ("INVITE_CREATED", "invitation_created"), - ("INVITE_USED", "invitation_used"), - ("IMPERSONATION_STARTED", "impersonation_started"), - ("IMPERSONATION_ENDED", "impersonation_ended"), - ("CUSTOM", "custom"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0003_auto_20200917_1155.py b/authentik/events/migrations/0003_auto_20200917_1155.py deleted file mode 100644 index 83d68ce8c..000000000 --- a/authentik/events/migrations/0003_auto_20200917_1155.py +++ /dev/null @@ -1,60 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-17 11:55 -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.events.models - - -def convert_user_to_json(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - Event = apps.get_model("authentik_events", "Event") - - db_alias = schema_editor.connection.alias - for event in Event.objects.using(db_alias).all(): - event.delete() - # Because event objects cannot be updated, we have to re-create them - event.pk = None - event.user_json = authentik.events.models.get_user(event.user) if event.user else {} - event._state.adding = True - event.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0002_auto_20200918_2116"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("LOGIN", "login"), - ("LOGIN_FAILED", "login_failed"), - ("LOGOUT", "logout"), - ("AUTHORIZE_APPLICATION", "authorize_application"), - ("SUSPICIOUS_REQUEST", "suspicious_request"), - ("SIGN_UP", "sign_up"), - ("PASSWORD_RESET", "password_reset"), - ("INVITE_CREATED", "invitation_created"), - ("INVITE_USED", "invitation_used"), - ("IMPERSONATION_STARTED", "impersonation_started"), - ("IMPERSONATION_ENDED", "impersonation_ended"), - ("CUSTOM", "custom"), - ] - ), - ), - migrations.AddField( - model_name="event", - name="user_json", - field=models.JSONField(default=dict), - ), - migrations.RunPython(convert_user_to_json), - migrations.RemoveField( - model_name="event", - name="user", - ), - migrations.RenameField(model_name="event", old_name="user_json", new_name="user"), - ] diff --git a/authentik/events/migrations/0004_auto_20200921_1829.py b/authentik/events/migrations/0004_auto_20200921_1829.py deleted file mode 100644 index a1733604e..000000000 --- a/authentik/events/migrations/0004_auto_20200921_1829.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-21 18:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0003_auto_20200917_1155"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("sign_up", "Sign Up"), - ("authorize_application", "Authorize Application"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0005_auto_20201005_2139.py b/authentik/events/migrations/0005_auto_20201005_2139.py deleted file mode 100644 index fd3ea8fb9..000000000 --- a/authentik/events/migrations/0005_auto_20201005_2139.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-05 21:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0004_auto_20200921_1829"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0006_auto_20201017_2024.py b/authentik/events/migrations/0006_auto_20201017_2024.py deleted file mode 100644 index 172e9f242..000000000 --- a/authentik/events/migrations/0006_auto_20201017_2024.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-17 20:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0005_auto_20201005_2139"), - ] - - operations = [ - migrations.RemoveField( - model_name="event", - name="date", - ), - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0007_auto_20201215_0939.py b/authentik/events/migrations/0007_auto_20201215_0939.py deleted file mode 100644 index db2f030d6..000000000 --- a/authentik/events/migrations/0007_auto_20201215_0939.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-15 09:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0006_auto_20201017_2024"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0008_auto_20201220_1651.py b/authentik/events/migrations/0008_auto_20201220_1651.py deleted file mode 100644 index e8e0faf92..000000000 --- a/authentik/events/migrations/0008_auto_20201220_1651.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-20 16:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0007_auto_20201215_0939"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0009_auto_20201227_1210.py b/authentik/events/migrations/0009_auto_20201227_1210.py deleted file mode 100644 index c3dc06612..000000000 --- a/authentik/events/migrations/0009_auto_20201227_1210.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-27 12:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0008_auto_20201220_1651"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0010_notification_notificationtransport_notificationrule.py b/authentik/events/migrations/0010_notification_notificationtransport_notificationrule.py deleted file mode 100644 index d46d04063..000000000 --- a/authentik/events/migrations/0010_notification_notificationtransport_notificationrule.py +++ /dev/null @@ -1,148 +0,0 @@ -# Generated by Django 3.1.4 on 2021-01-11 16:36 - -import uuid - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("authentik_policies", "0004_policy_execution_logging"), - ("authentik_core", "0016_auto_20201202_2234"), - ("authentik_events", "0009_auto_20201227_1210"), - ] - - operations = [ - migrations.CreateModel( - name="NotificationTransport", - fields=[ - ( - "uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField(unique=True)), - ( - "mode", - models.TextField( - choices=[ - ("webhook", "Generic Webhook"), - ("webhook_slack", "Slack Webhook (Slack/Discord)"), - ("email", "Email"), - ] - ), - ), - ("webhook_url", models.TextField(blank=True)), - ], - options={ - "verbose_name": "Notification Transport", - "verbose_name_plural": "Notification Transports", - }, - ), - migrations.CreateModel( - name="NotificationRule", - fields=[ - ( - "policybindingmodel_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_policies.policybindingmodel", - ), - ), - ("name", models.TextField(unique=True)), - ( - "severity", - models.TextField( - choices=[ - ("notice", "Notice"), - ("warning", "Warning"), - ("alert", "Alert"), - ], - default="notice", - help_text="Controls which severity level the created notifications will have.", - ), - ), - ( - "group", - models.ForeignKey( - blank=True, - help_text="Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_core.group", - ), - ), - ( - "transports", - models.ManyToManyField( - help_text="Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI.", - to="authentik_events.NotificationTransport", - ), - ), - ], - options={ - "verbose_name": "Notification Rule", - "verbose_name_plural": "Notification Rules", - }, - bases=("authentik_policies.policybindingmodel",), - ), - migrations.CreateModel( - name="Notification", - fields=[ - ( - "uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "severity", - models.TextField( - choices=[ - ("notice", "Notice"), - ("warning", "Warning"), - ("alert", "Alert"), - ] - ), - ), - ("body", models.TextField()), - ("created", models.DateTimeField(auto_now_add=True)), - ("seen", models.BooleanField(default=False)), - ( - "event", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_events.event", - ), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "verbose_name": "Notification", - "verbose_name_plural": "Notifications", - }, - ), - ] diff --git a/authentik/events/migrations/0011_notification_rules_default_v1.py b/authentik/events/migrations/0011_notification_rules_default_v1.py deleted file mode 100644 index a011d9380..000000000 --- a/authentik/events/migrations/0011_notification_rules_default_v1.py +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by Django 3.1.4 on 2021-01-10 18:57 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "authentik_events", - "0010_notification_notificationtransport_notificationrule", - ), - ] - - operations = [] diff --git a/authentik/events/migrations/0012_auto_20210202_1821.py b/authentik/events/migrations/0012_auto_20210202_1821.py deleted file mode 100644 index 36aa9d14e..000000000 --- a/authentik/events/migrations/0012_auto_20210202_1821.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-02 18:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0011_notification_rules_default_v1"), - ] - - operations = [ - migrations.AddField( - model_name="notificationtransport", - name="send_once", - field=models.BooleanField( - default=False, - help_text="Only send notification once, for example when sending a webhook into a chat channel.", - ), - ), - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0013_auto_20210209_1657.py b/authentik/events/migrations/0013_auto_20210209_1657.py deleted file mode 100644 index 57a9af700..000000000 --- a/authentik/events/migrations/0013_auto_20210209_1657.py +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-09 16:57 -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def token_view_to_secret_view(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - from authentik.events.models import EventAction - - db_alias = schema_editor.connection.alias - Event = apps.get_model("authentik_events", "Event") - - events = Event.objects.using(db_alias).filter(action="token_view") - - for event in events: - event.context["secret"] = event.context.pop("token") - event.action = EventAction.SECRET_VIEW - - Event.objects.using(db_alias).bulk_update(events, ["context", "action"]) - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0012_auto_20210202_1821"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - migrations.RunPython(token_view_to_secret_view), - ] diff --git a/authentik/events/migrations/0014_expiry.py b/authentik/events/migrations/0014_expiry.py deleted file mode 100644 index b59fc1f70..000000000 --- a/authentik/events/migrations/0014_expiry.py +++ /dev/null @@ -1,87 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-18 16:01 - -from datetime import timedelta -from typing import Iterable - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.events.models - - -# Taken from https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console -def progress_bar( - iterable: Iterable, - prefix="Writing: ", - suffix=" finished", - decimals=1, - length=100, - fill="█", - print_end="\r", -): - """ - Call in a loop to create terminal progress bar - @params: - iteration - Required : current iteration (Int) - total - Required : total iterations (Int) - prefix - Optional : prefix string (Str) - suffix - Optional : suffix string (Str) - decimals - Optional : positive number of decimals in percent complete (Int) - length - Optional : character length of bar (Int) - fill - Optional : bar fill character (Str) - print_end - Optional : end character (e.g. "\r", "\r\n") (Str) - """ - total = len(iterable) - if total < 1: - return - - def print_progress_bar(iteration): - """Progress Bar Printing Function""" - percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total))) - filledLength = int(length * iteration // total) - bar = fill * filledLength + "-" * (length - filledLength) - print(f"\r{prefix} |{bar}| {percent}% {suffix}", end=print_end) - - # Initial Call - print_progress_bar(0) - # Update Progress Bar - for i, item in enumerate(iterable): - yield item - print_progress_bar(i + 1) - # Print New Line on Complete - print() - - -def update_expires(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - Event = apps.get_model("authentik_events", "event") - all_events = Event.objects.using(db_alias).all() - if all_events.count() < 1: - return - - print("\nAdding expiry to events, this might take a couple of minutes...") - for event in progress_bar(all_events): - event.expires = event.created + timedelta(days=365) - event.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0013_auto_20210209_1657"), - ] - - operations = [ - migrations.AddField( - model_name="event", - name="expires", - field=models.DateTimeField(default=authentik.events.models.default_event_duration), - ), - migrations.AddField( - model_name="event", - name="expiring", - field=models.BooleanField(default=True), - ), - migrations.RunPython(update_expires), - ] diff --git a/authentik/events/migrations/0015_alter_event_action.py b/authentik/events/migrations/0015_alter_event_action.py deleted file mode 100644 index 6d080cf4c..000000000 --- a/authentik/events/migrations/0015_alter_event_action.py +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-09 07:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0014_expiry"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0016_add_tenant.py b/authentik/events/migrations/0016_add_tenant.py deleted file mode 100644 index 853b0146f..000000000 --- a/authentik/events/migrations/0016_add_tenant.py +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-14 15:33 - -from django.db import migrations, models - -import authentik.events.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0015_alter_event_action"), - ] - - operations = [ - migrations.AddField( - model_name="event", - name="tenant", - field=models.JSONField(blank=True, default=authentik.events.models.default_tenant), - ), - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("system_exception", "System Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0017_alter_event_action.py b/authentik/events/migrations/0017_alter_event_action.py deleted file mode 100644 index b385bc603..000000000 --- a/authentik/events/migrations/0017_alter_event_action.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-14 19:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0016_add_tenant"), - ] - - operations = [ - migrations.AlterField( - model_name="event", - name="action", - field=models.TextField( - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("secret_rotate", "Secret Rotate"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("system_exception", "System Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ] - ), - ), - ] diff --git a/authentik/events/migrations/0018_auto_20210911_2217.py b/authentik/events/migrations/0018_auto_20210911_2217.py deleted file mode 100644 index 66ce75656..000000000 --- a/authentik/events/migrations/0018_auto_20210911_2217.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by Django 3.2.6 on 2021-09-11 22:17 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0028_alter_token_intent"), - ("authentik_events", "0017_alter_event_action"), - ] - - operations = [ - migrations.CreateModel( - name="NotificationWebhookMapping", - fields=[ - ( - "propertymapping_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.propertymapping", - ), - ), - ], - options={ - "verbose_name": "Notification Webhook Mapping", - "verbose_name_plural": "Notification Webhook Mappings", - }, - bases=("authentik_core.propertymapping",), - ), - migrations.AddField( - model_name="notificationtransport", - name="webhook_mapping", - field=models.ForeignKey( - default=None, - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_events.notificationwebhookmapping", - ), - ), - ] diff --git a/authentik/events/migrations/0019_alter_notificationtransport_webhook_url.py b/authentik/events/migrations/0019_alter_notificationtransport_webhook_url.py deleted file mode 100644 index 65a83f247..000000000 --- a/authentik/events/migrations/0019_alter_notificationtransport_webhook_url.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.7 on 2021-10-04 15:31 - -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_events", "0018_auto_20210911_2217"), - ] - - operations = [ - migrations.AlterField( - model_name="notificationtransport", - name="webhook_url", - field=models.TextField( - blank=True, validators=[authentik.lib.models.DomainlessURLValidator()] - ), - ), - ] diff --git a/authentik/flows/migrations/0001_initial.py b/authentik/flows/migrations/0001_initial.py deleted file mode 100644 index 297f09c70..000000000 --- a/authentik/flows/migrations/0001_initial.py +++ /dev/null @@ -1,138 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:07 - -import uuid - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_policies", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="Flow", - fields=[ - ( - "flow_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField()), - ("slug", models.SlugField(unique=True)), - ( - "designation", - models.CharField( - choices=[ - ("authentication", "Authentication"), - ("invalidation", "Invalidation"), - ("enrollment", "Enrollment"), - ("unenrollment", "Unrenollment"), - ("recovery", "Recovery"), - ("password_change", "Password Change"), - ], - max_length=100, - ), - ), - ( - "pbm", - models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - related_name="+", - to="authentik_policies.PolicyBindingModel", - ), - ), - ], - options={ - "verbose_name": "Flow", - "verbose_name_plural": "Flows", - }, - bases=("authentik_policies.policybindingmodel",), - ), - migrations.CreateModel( - name="Stage", - fields=[ - ( - "stage_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField()), - ], - ), - migrations.CreateModel( - name="FlowStageBinding", - fields=[ - ( - "policybindingmodel_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - to="authentik_policies.PolicyBindingModel", - ), - ), - ( - "fsb_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "re_evaluate_policies", - models.BooleanField( - default=False, - help_text="When this option is enabled, the planner will re-evaluate policies bound to this.", - ), - ), - ("order", models.IntegerField()), - ( - "flow", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="authentik_flows.Flow", - ), - ), - ( - "stage", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="authentik_flows.Stage", - ), - ), - ], - options={ - "verbose_name": "Flow Stage Binding", - "verbose_name_plural": "Flow Stage Bindings", - "ordering": ["order", "flow"], - "unique_together": {("flow", "stage", "order")}, - }, - bases=("authentik_policies.policybindingmodel",), - ), - migrations.AddField( - model_name="flow", - name="stages", - field=models.ManyToManyField( - blank=True, - through="authentik_flows.FlowStageBinding", - to="authentik_flows.Stage", - ), - ), - ] diff --git a/authentik/flows/migrations/0003_auto_20200523_1133.py b/authentik/flows/migrations/0003_auto_20200523_1133.py deleted file mode 100644 index ef4388351..000000000 --- a/authentik/flows/migrations/0003_auto_20200523_1133.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 11:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="designation", - field=models.CharField( - choices=[ - ("authentication", "Authentication"), - ("authorization", "Authorization"), - ("invalidation", "Invalidation"), - ("enrollment", "Enrollment"), - ("unenrollment", "Unrenollment"), - ("recovery", "Recovery"), - ("password_change", "Password Change"), - ], - max_length=100, - ), - ), - ] diff --git a/authentik/flows/migrations/0006_auto_20200629_0857.py b/authentik/flows/migrations/0006_auto_20200629_0857.py deleted file mode 100644 index 2278bbf79..000000000 --- a/authentik/flows/migrations/0006_auto_20200629_0857.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.0.7 on 2020-06-29 08:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0003_auto_20200523_1133"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="designation", - field=models.CharField( - choices=[ - ("authentication", "Authentication"), - ("authorization", "Authorization"), - ("invalidation", "Invalidation"), - ("enrollment", "Enrollment"), - ("unenrollment", "Unrenollment"), - ("recovery", "Recovery"), - ("stage_setup", "Stage Setup"), - ], - max_length=100, - ), - ), - ] diff --git a/authentik/flows/migrations/0007_auto_20200703_2059.py b/authentik/flows/migrations/0007_auto_20200703_2059.py deleted file mode 100644 index 220d1cc24..000000000 --- a/authentik/flows/migrations/0007_auto_20200703_2059.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.0.7 on 2020-07-03 20:59 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies", "0002_auto_20200528_1647"), - ("authentik_flows", "0006_auto_20200629_0857"), - ] - - operations = [ - migrations.AlterModelOptions( - name="flowstagebinding", - options={ - "ordering": ["order", "target"], - "verbose_name": "Flow Stage Binding", - "verbose_name_plural": "Flow Stage Bindings", - }, - ), - migrations.RenameField( - model_name="flowstagebinding", - old_name="flow", - new_name="target", - ), - migrations.RenameField( - model_name="flow", - old_name="pbm", - new_name="policybindingmodel_ptr", - ), - migrations.AlterUniqueTogether( - name="flowstagebinding", - unique_together={("target", "stage", "order")}, - ), - migrations.AlterField( - model_name="flow", - name="policybindingmodel_ptr", - field=models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - to="authentik_policies.PolicyBindingModel", - ), - ), - ] diff --git a/authentik/flows/migrations/0012_auto_20200908_1542.py b/authentik/flows/migrations/0012_auto_20200908_1542.py deleted file mode 100644 index 2f19ab807..000000000 --- a/authentik/flows/migrations/0012_auto_20200908_1542.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-08 15:42 - -import django.db.models.deletion -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0011_flow_title"), - ] - - operations = [ - migrations.AlterField( - model_name="flowstagebinding", - name="stage", - field=authentik.lib.models.InheritanceForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="authentik_flows.stage" - ), - ), - migrations.AlterField( - model_name="stage", - name="name", - field=models.TextField(unique=True), - ), - ] diff --git a/authentik/flows/migrations/0013_auto_20200924_1605.py b/authentik/flows/migrations/0013_auto_20200924_1605.py deleted file mode 100644 index 138992a7a..000000000 --- a/authentik/flows/migrations/0013_auto_20200924_1605.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-24 16:05 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -from authentik.flows.models import FlowDesignation - - -def update_flow_designation(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - Flow = apps.get_model("authentik_flows", "Flow") - db_alias = schema_editor.connection.alias - - for flow in Flow.objects.using(db_alias).all(): - if flow.designation == "stage_setup": - flow.designation = FlowDesignation.STAGE_CONFIGURATION - flow.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0012_auto_20200908_1542"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="designation", - field=models.CharField( - choices=[ - ("authentication", "Authentication"), - ("authorization", "Authorization"), - ("invalidation", "Invalidation"), - ("enrollment", "Enrollment"), - ("unenrollment", "Unrenollment"), - ("recovery", "Recovery"), - ("stage_configuration", "Stage Configuration"), - ], - max_length=100, - ), - ), - migrations.RunPython(update_flow_designation), - ] diff --git a/authentik/flows/migrations/0014_auto_20200925_2332.py b/authentik/flows/migrations/0014_auto_20200925_2332.py deleted file mode 100644 index 267511832..000000000 --- a/authentik/flows/migrations/0014_auto_20200925_2332.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-25 23:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0013_auto_20200924_1605"), - ] - - operations = [ - migrations.AlterModelOptions( - name="flowstagebinding", - options={ - "ordering": ["target", "order"], - "verbose_name": "Flow Stage Binding", - "verbose_name_plural": "Flow Stage Bindings", - }, - ), - migrations.AlterField( - model_name="flowstagebinding", - name="re_evaluate_policies", - field=models.BooleanField( - default=False, - help_text="When this option is enabled, the planner will re-evaluate policies bound to this binding.", - ), - ), - ] diff --git a/authentik/flows/migrations/0015_flowstagebinding_evaluate_on_plan.py b/authentik/flows/migrations/0015_flowstagebinding_evaluate_on_plan.py deleted file mode 100644 index 86d5d51a6..000000000 --- a/authentik/flows/migrations/0015_flowstagebinding_evaluate_on_plan.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-20 12:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0014_auto_20200925_2332"), - ] - - operations = [ - migrations.AlterField( - model_name="flowstagebinding", - name="re_evaluate_policies", - field=models.BooleanField( - default=False, - help_text="Evaluate policies when the Stage is present to the user.", - ), - ), - migrations.AddField( - model_name="flowstagebinding", - name="evaluate_on_plan", - field=models.BooleanField( - default=True, - help_text="Evaluate policies during the Flow planning process. Disable this for input-based policies.", - ), - ), - ] diff --git a/authentik/flows/migrations/0016_auto_20201202_1307.py b/authentik/flows/migrations/0016_auto_20201202_1307.py deleted file mode 100644 index dfc80fc8b..000000000 --- a/authentik/flows/migrations/0016_auto_20201202_1307.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.1.3 on 2020-12-02 13:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0015_flowstagebinding_evaluate_on_plan"), - ] - - operations = [ - migrations.AddField( - model_name="flow", - name="background", - field=models.FileField( - blank=True, - default="../static/dist/assets/images/flow_background.jpg", - help_text="Background shown during execution", - upload_to="flow-backgrounds/", - ), - ), - migrations.AlterField( - model_name="flow", - name="designation", - field=models.CharField( - choices=[ - ("authentication", "Authentication"), - ("authorization", "Authorization"), - ("invalidation", "Invalidation"), - ("enrollment", "Enrollment"), - ("unenrollment", "Unrenollment"), - ("recovery", "Recovery"), - ("stage_configuration", "Stage Configuration"), - ], - help_text="Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik.", - max_length=100, - ), - ), - migrations.AlterField( - model_name="flow", - name="slug", - field=models.SlugField(help_text="Visible in the URL.", unique=True), - ), - migrations.AlterField( - model_name="flow", - name="title", - field=models.TextField(help_text="Shown as the Title in Flow pages."), - ), - ] diff --git a/authentik/flows/migrations/0017_auto_20210329_1334.py b/authentik/flows/migrations/0017_auto_20210329_1334.py deleted file mode 100644 index bcaf18eef..000000000 --- a/authentik/flows/migrations/0017_auto_20210329_1334.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-29 13:34 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0016_auto_20201202_1307"), - ] - - operations = [ - migrations.AlterModelOptions( - name="flow", - options={ - "permissions": [ - ("export_flow", "Can export a Flow"), - ("view_flow_cache", "View Flow's cache metrics"), - ("clear_flow_cache", "Clear Flow's cache metrics"), - ], - "verbose_name": "Flow", - "verbose_name_plural": "Flows", - }, - ), - ] diff --git a/authentik/flows/migrations/0019_alter_flow_background.py b/authentik/flows/migrations/0019_alter_flow_background.py deleted file mode 100644 index fd8dab59a..000000000 --- a/authentik/flows/migrations/0019_alter_flow_background.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-05 17:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0018_oob_flows"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="background", - field=models.FileField( - default=None, - help_text="Background shown during execution", - null=True, - upload_to="flow-backgrounds/", - ), - ), - ] diff --git a/authentik/flows/migrations/0020_flow_compatibility_mode.py b/authentik/flows/migrations/0020_flow_compatibility_mode.py deleted file mode 100644 index bb967e81e..000000000 --- a/authentik/flows/migrations/0020_flow_compatibility_mode.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-05 17:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0019_alter_flow_background"), - ] - - operations = [ - migrations.AddField( - model_name="flow", - name="compatibility_mode", - field=models.BooleanField( - default=True, - help_text="Enable compatibility mode, increases compatibility with password managers on mobile devices.", - ), - ), - ] diff --git a/authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py b/authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py deleted file mode 100644 index 1c0add77f..000000000 --- a/authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-27 16:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0020_flow_compatibility_mode"), - ] - - operations = [ - migrations.AddField( - model_name="flowstagebinding", - name="invalid_response_action", - field=models.TextField( - choices=[("retry", "Retry"), ("continue", "Continue")], - default="retry", - help_text="Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor while CONTINUE continues with the next stage.", - ), - ), - ] diff --git a/authentik/flows/migrations/0022_alter_flowstagebinding_invalid_response_action.py b/authentik/flows/migrations/0022_alter_flowstagebinding_invalid_response_action.py deleted file mode 100644 index bb858cc3b..000000000 --- a/authentik/flows/migrations/0022_alter_flowstagebinding_invalid_response_action.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.4 on 2021-07-03 13:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0021_flowstagebinding_invalid_response_action"), - ] - - operations = [ - migrations.AlterField( - model_name="flowstagebinding", - name="invalid_response_action", - field=models.TextField( - choices=[ - ("retry", "Retry"), - ("restart", "Restart"), - ("restart_with_context", "Restart With Context"), - ], - default="retry", - help_text="Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor. RESTART restarts the flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the current context.", - ), - ), - ] diff --git a/authentik/flows/migrations/0023_alter_flow_background.py b/authentik/flows/migrations/0023_alter_flow_background.py deleted file mode 100644 index e7ee64008..000000000 --- a/authentik/flows/migrations/0023_alter_flow_background.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-09 17:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0022_alter_flowstagebinding_invalid_response_action"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="background", - field=models.FileField( - default=None, - help_text="Background shown during execution", - max_length=500, - null=True, - upload_to="flow-backgrounds/", - ), - ), - ] diff --git a/authentik/flows/migrations/0024_alter_flow_compatibility_mode.py b/authentik/flows/migrations/0024_alter_flow_compatibility_mode.py deleted file mode 100644 index 7b1d9f7eb..000000000 --- a/authentik/flows/migrations/0024_alter_flow_compatibility_mode.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.6 on 2021-08-30 14:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0023_alter_flow_background"), - ] - - operations = [ - migrations.AlterField( - model_name="flow", - name="compatibility_mode", - field=models.BooleanField( - default=False, - help_text="Enable compatibility mode, increases compatibility with password managers on mobile devices.", - ), - ), - ] diff --git a/authentik/flows/planner.py b/authentik/flows/planner.py index 4a120b418..b422a66cd 100644 --- a/authentik/flows/planner.py +++ b/authentik/flows/planner.py @@ -192,16 +192,18 @@ class FlowPlanner: if default_context: plan.context = default_context # Check Flow policies - for binding in FlowStageBinding.objects.filter(target__pk=self.flow.pk).order_by( - "order" - ): + bindings = list( + FlowStageBinding.objects.filter(target__pk=self.flow.pk).order_by("order") + ) + stages = Stage.objects.filter(flowstagebinding__in=[binding.pk for binding in bindings]) + for binding in bindings: binding: FlowStageBinding - stage = binding.stage + stage = [stage for stage in stages if stage.pk == binding.stage_id][0] marker = StageMarker() if binding.evaluate_on_plan: self._logger.debug( "f(plan): evaluating on plan", - stage=binding.stage, + stage=stage, ) engine = PolicyEngine(binding, user, request) engine.request.context["flow_plan"] = plan @@ -210,19 +212,19 @@ class FlowPlanner: if engine.passing: self._logger.debug( "f(plan): stage passing", - stage=binding.stage, + stage=stage, ) else: stage = None else: self._logger.debug( "f(plan): not evaluating on plan", - stage=binding.stage, + stage=stage, ) if binding.re_evaluate_policies and stage: self._logger.debug( "f(plan): stage has re-evaluate marker", - stage=binding.stage, + stage=stage, ) marker = ReevaluateMarker(binding=binding) if stage: diff --git a/authentik/outposts/migrations/0001_initial.py b/authentik/outposts/migrations/0001_initial.py deleted file mode 100644 index ec5769d61..000000000 --- a/authentik/outposts/migrations/0001_initial.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.1 on 2020-08-25 20:45 - -import uuid - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_core", "0008_auto_20200824_1532"), - ] - - operations = [ - migrations.CreateModel( - name="Outpost", - fields=[ - ( - "uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField()), - ( - "channels", - django.contrib.postgres.fields.ArrayField( - base_field=models.TextField(), size=None - ), - ), - ("providers", models.ManyToManyField(to="authentik_core.Provider")), - ], - ), - ] diff --git a/authentik/outposts/migrations/0002_auto_20200826_1306.py b/authentik/outposts/migrations/0002_auto_20200826_1306.py deleted file mode 100644 index 2eb6f0d2e..000000000 --- a/authentik/outposts/migrations/0002_auto_20200826_1306.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.1 on 2020-08-26 13:06 - -from django.db import migrations, models - -import authentik.outposts.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="outpost", - name="_config", - field=models.JSONField(default=authentik.outposts.models.default_outpost_config), - ), - migrations.AddField( - model_name="outpost", - name="type", - field=models.TextField(choices=[("proxy", "Proxy")], default="proxy"), - ), - ] diff --git a/authentik/outposts/migrations/0003_auto_20200827_2108.py b/authentik/outposts/migrations/0003_auto_20200827_2108.py deleted file mode 100644 index 0c76de4c0..000000000 --- a/authentik/outposts/migrations/0003_auto_20200827_2108.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.1 on 2020-08-27 21:08 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0002_auto_20200826_1306"), - ] - - operations = [ - migrations.AddField( - model_name="outpost", - name="deployment_type", - field=models.TextField( - choices=[ - ("docker_compose", "Docker Compose"), - ("kubernetes", "Kubernetes"), - ("custom", "Custom"), - ], - default="custom", - help_text="Select between authentik-managed deployment types or a custom deployment.", - ), - ), - migrations.AlterField( - model_name="outpost", - name="channels", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.TextField(), default=list, size=None - ), - ), - ] diff --git a/authentik/outposts/migrations/0004_auto_20200830_1056.py b/authentik/outposts/migrations/0004_auto_20200830_1056.py deleted file mode 100644 index e4b9d3d74..000000000 --- a/authentik/outposts/migrations/0004_auto_20200830_1056.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1 on 2020-08-30 10:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0003_auto_20200827_2108"), - ] - - operations = [ - migrations.AlterField( - model_name="outpost", - name="deployment_type", - field=models.TextField( - choices=[("kubernetes", "Kubernetes"), ("custom", "Custom")], - default="custom", - help_text="Select between authentik-managed deployment types or a custom deployment.", - ), - ), - ] diff --git a/authentik/outposts/migrations/0005_auto_20200909_1733.py b/authentik/outposts/migrations/0005_auto_20200909_1733.py deleted file mode 100644 index 9ec22e025..000000000 --- a/authentik/outposts/migrations/0005_auto_20200909_1733.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-09 17:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0004_auto_20200830_1056"), - ] - - operations = [ - migrations.AlterField( - model_name="outpost", - name="deployment_type", - field=models.TextField( - choices=[("custom", "Custom")], - default="custom", - help_text="Select between authentik-managed deployment types or a custom deployment.", - ), - ), - ] diff --git a/authentik/outposts/migrations/0006_auto_20201003_2239.py b/authentik/outposts/migrations/0006_auto_20201003_2239.py deleted file mode 100644 index ffc5bc0f7..000000000 --- a/authentik/outposts/migrations/0006_auto_20201003_2239.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-03 22:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0005_auto_20200909_1733"), - ] - - operations = [ - migrations.AlterField( - model_name="outpost", - name="deployment_type", - field=models.TextField( - choices=[ - ("docker", "Docker"), - ("custom", "Custom"), - ], - default="custom", - help_text="Select between authentik-managed deployment types or a custom deployment.", - ), - ), - ] diff --git a/authentik/outposts/migrations/0007_remove_outpost_channels.py b/authentik/outposts/migrations/0007_remove_outpost_channels.py deleted file mode 100644 index e4b0950df..000000000 --- a/authentik/outposts/migrations/0007_remove_outpost_channels.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-14 08:32 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0006_auto_20201003_2239"), - ] - - operations = [ - migrations.RemoveField( - model_name="outpost", - name="channels", - ), - ] diff --git a/authentik/outposts/migrations/0008_auto_20201014_1547.py b/authentik/outposts/migrations/0008_auto_20201014_1547.py deleted file mode 100644 index bbed57b1f..000000000 --- a/authentik/outposts/migrations/0008_auto_20201014_1547.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-14 15:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0007_remove_outpost_channels"), - ] - - operations = [ - migrations.AlterField( - model_name="outpost", - name="deployment_type", - field=models.TextField( - choices=[ - ("kubernetes", "Kubernetes"), - ("docker", "Docker"), - ("custom", "Custom"), - ], - default="custom", - help_text="Select between authentik-managed deployment types or a custom deployment.", - ), - ), - ] diff --git a/authentik/outposts/migrations/0009_fix_missing_token_identifier.py b/authentik/outposts/migrations/0009_fix_missing_token_identifier.py deleted file mode 100644 index 2cc600574..000000000 --- a/authentik/outposts/migrations/0009_fix_missing_token_identifier.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-17 14:26 - -from django.apps.registry import Apps -from django.db import migrations -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def fix_missing_token_identifier(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - User = apps.get_model("authentik_core", "User") - Token = apps.get_model("authentik_core", "Token") - from authentik.outposts.models import Outpost - - for outpost in Outpost.objects.using(schema_editor.connection.alias).all().only("pk"): - user_identifier = outpost.user_identifier - users = User.objects.filter(username=user_identifier) - if not users.exists(): - continue - tokens = Token.objects.filter(user=users.first()) - for token in tokens: - if token.identifier != outpost.token_identifier: - token.identifier = outpost.token_identifier - token.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0014_auto_20201018_1158"), - ("authentik_outposts", "0008_auto_20201014_1547"), - ] - - operations = [ - migrations.RunPython(fix_missing_token_identifier), - ] diff --git a/authentik/outposts/migrations/0010_service_connection.py b/authentik/outposts/migrations/0010_service_connection.py deleted file mode 100644 index b13433def..000000000 --- a/authentik/outposts/migrations/0010_service_connection.py +++ /dev/null @@ -1,164 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-04 09:11 - -import uuid - -import django.db.models.deletion -from django.apps.registry import Apps -from django.core.exceptions import FieldError -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -import authentik.lib.models - - -def migrate_to_service_connection(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - Outpost = apps.get_model("authentik_outposts", "Outpost") - DockerServiceConnection = apps.get_model("authentik_outposts", "DockerServiceConnection") - KubernetesServiceConnection = apps.get_model( - "authentik_outposts", "KubernetesServiceConnection" - ) - - docker = DockerServiceConnection.objects.filter(local=True).first() - k8s = KubernetesServiceConnection.objects.filter(local=True).first() - - try: - for outpost in Outpost.objects.using(db_alias).all().exclude(deployment_type="custom"): - if outpost.deployment_type == "kubernetes": - outpost.service_connection = k8s - elif outpost.deployment_type == "docker": - outpost.service_connection = docker - outpost.save() - except FieldError: - # This is triggered during e2e tests when this function is called on an already-upgraded - # schema - pass - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0009_fix_missing_token_identifier"), - ] - - operations = [ - migrations.CreateModel( - name="OutpostServiceConnection", - fields=[ - ( - "uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField()), - ( - "local", - models.BooleanField( - default=False, - help_text="If enabled, use the local connection. Required Docker socket/Kubernetes Integration", - unique=True, - ), - ), - ], - ), - migrations.CreateModel( - name="DockerServiceConnection", - fields=[ - ( - "outpostserviceconnection_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_outposts.outpostserviceconnection", - ), - ), - ("url", models.TextField()), - ("tls", models.BooleanField()), - ], - bases=("authentik_outposts.outpostserviceconnection",), - ), - migrations.CreateModel( - name="KubernetesServiceConnection", - fields=[ - ( - "outpostserviceconnection_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_outposts.outpostserviceconnection", - ), - ), - ("kubeconfig", models.JSONField()), - ], - bases=("authentik_outposts.outpostserviceconnection",), - ), - migrations.AddField( - model_name="outpost", - name="service_connection", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_outposts.outpostserviceconnection", - ), - ), - migrations.RunPython(migrate_to_service_connection), - migrations.RemoveField( - model_name="outpost", - name="deployment_type", - ), - migrations.AlterModelOptions( - name="dockerserviceconnection", - options={ - "verbose_name": "Docker Service-Connection", - "verbose_name_plural": "Docker Service-Connections", - }, - ), - migrations.AlterModelOptions( - name="kubernetesserviceconnection", - options={ - "verbose_name": "Kubernetes Service-Connection", - "verbose_name_plural": "Kubernetes Service-Connections", - }, - ), - migrations.AlterField( - model_name="outpost", - name="service_connection", - field=authentik.lib.models.InheritanceForeignKey( - blank=True, - default=None, - help_text="Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_outposts.outpostserviceconnection", - ), - ), - migrations.AlterModelOptions( - name="outpostserviceconnection", - options={ - "verbose_name": "Outpost Service-Connection", - "verbose_name_plural": "Outpost Service-Connections", - }, - ), - migrations.AlterField( - model_name="kubernetesserviceconnection", - name="kubeconfig", - field=models.JSONField( - default=None, - help_text="Paste your kubeconfig here. authentik will automatically use the currently selected context.", - ), - preserve_default=False, - ), - ] diff --git a/authentik/outposts/migrations/0011_docker_tls_auth.py b/authentik/outposts/migrations/0011_docker_tls_auth.py deleted file mode 100644 index 0905d44af..000000000 --- a/authentik/outposts/migrations/0011_docker_tls_auth.py +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-18 21:51 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_outposts", "0010_service_connection"), - ] - - operations = [ - migrations.RemoveField( - model_name="dockerserviceconnection", - name="tls", - ), - migrations.AddField( - model_name="dockerserviceconnection", - name="tls_authentication", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Certificate/Key used for authentication. Can be left empty for no authentication.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_crypto.certificatekeypair", - ), - ), - migrations.AddField( - model_name="dockerserviceconnection", - name="tls_verification", - field=models.ForeignKey( - blank=True, - default=None, - help_text="CA which the endpoint's Certificate is verified against. Can be left empty for no validation.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_crypto.certificatekeypair", - ), - ), - ] diff --git a/authentik/outposts/migrations/0012_service_connection_non_unique.py b/authentik/outposts/migrations/0012_service_connection_non_unique.py deleted file mode 100644 index f7f7815ad..000000000 --- a/authentik/outposts/migrations/0012_service_connection_non_unique.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-18 21:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0011_docker_tls_auth"), - ] - - operations = [ - migrations.AlterField( - model_name="outpostserviceconnection", - name="local", - field=models.BooleanField( - default=False, - help_text="If enabled, use the local connection. Required Docker socket/Kubernetes Integration", - ), - ), - ] diff --git a/authentik/outposts/migrations/0013_auto_20201203_2009.py b/authentik/outposts/migrations/0013_auto_20201203_2009.py deleted file mode 100644 index 223fae32d..000000000 --- a/authentik/outposts/migrations/0013_auto_20201203_2009.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-03 20:09 - -from django.apps.registry import Apps -from django.db import migrations -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def remove_pb_prefix_users(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - alias = schema_editor.connection.alias - User = apps.get_model("authentik_core", "User") - Outpost = apps.get_model("authentik_outposts", "Outpost") - - for outpost in Outpost.objects.using(alias).all(): - matching = User.objects.using(alias).filter(username=f"pb-outpost-{outpost.uuid.hex}") - if matching.exists(): - matching.delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0016_auto_20201202_2234"), - ("authentik_outposts", "0012_service_connection_non_unique"), - ] - - operations = [ - migrations.RunPython(remove_pb_prefix_users), - ] diff --git a/authentik/outposts/migrations/0014_auto_20201213_1407.py b/authentik/outposts/migrations/0014_auto_20201213_1407.py deleted file mode 100644 index 5edf64bd3..000000000 --- a/authentik/outposts/migrations/0014_auto_20201213_1407.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-13 14:07 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def update_config_prefix(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - alias = schema_editor.connection.alias - Outpost = apps.get_model("authentik_outposts", "Outpost") - - for outpost in Outpost.objects.using(alias).all(): - config = outpost._config - for key in list(config): - if "passbook" in key: - new_key = key.replace("passbook", "authentik") - config[new_key] = config[key] - del config[key] - outpost._config = config - outpost.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0013_auto_20201203_2009"), - ] - - operations = [ - migrations.RunPython(update_config_prefix), - migrations.AlterField( - model_name="dockerserviceconnection", - name="url", - field=models.TextField( - help_text="Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system." - ), - ), - ] diff --git a/authentik/outposts/migrations/0015_auto_20201224_1206.py b/authentik/outposts/migrations/0015_auto_20201224_1206.py deleted file mode 100644 index 5531e7833..000000000 --- a/authentik/outposts/migrations/0015_auto_20201224_1206.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-24 12:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0014_auto_20201213_1407"), - ] - - operations = [ - migrations.AlterField( - model_name="kubernetesserviceconnection", - name="kubeconfig", - field=models.JSONField( - blank=True, - help_text="Paste your kubeconfig here. authentik will automatically use the currently selected context.", - ), - ), - ] diff --git a/authentik/outposts/migrations/0016_alter_outpost_type.py b/authentik/outposts/migrations/0016_alter_outpost_type.py deleted file mode 100644 index 9103e40a3..000000000 --- a/authentik/outposts/migrations/0016_alter_outpost_type.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2 on 2021-04-26 09:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0015_auto_20201224_1206"), - ] - - operations = [ - migrations.AlterField( - model_name="outpost", - name="type", - field=models.TextField(choices=[("proxy", "Proxy"), ("ldap", "Ldap")], default="proxy"), - ), - ] diff --git a/authentik/outposts/migrations/0017_outpost_managed.py b/authentik/outposts/migrations/0017_outpost_managed.py deleted file mode 100644 index 70b47841a..000000000 --- a/authentik/outposts/migrations/0017_outpost_managed.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-23 19:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_outposts", "0016_alter_outpost_type"), - ] - - operations = [ - migrations.AddField( - model_name="outpost", - name="managed", - field=models.TextField( - default=None, - help_text="Objects which are managed by authentik. These objects are created and updated automatically. This is flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.", - null=True, - unique=True, - verbose_name="Managed by authentik", - ), - ), - ] diff --git a/authentik/policies/dummy/migrations/0002_dummypolicy_authentik_p_policy__648f9b_idx.py b/authentik/policies/dummy/migrations/0002_dummypolicy_authentik_p_policy__648f9b_idx.py new file mode 100644 index 000000000..d5c6989f9 --- /dev/null +++ b/authentik/policies/dummy/migrations/0002_dummypolicy_authentik_p_policy__648f9b_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_dummy", "0001_initial"), + ] + + operations = [ + migrations.AddIndex( + model_name="dummypolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__648f9b_idx"), + ), + ] diff --git a/authentik/policies/dummy/models.py b/authentik/policies/dummy/models.py index a91c86453..597aff05c 100644 --- a/authentik/policies/dummy/models.py +++ b/authentik/policies/dummy/models.py @@ -40,7 +40,7 @@ class DummyPolicy(Policy): sleep(wait) return PolicyResult(self.result, "dummy") - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Dummy Policy") verbose_name_plural = _("Dummy Policies") diff --git a/authentik/policies/event_matcher/migrations/0001_initial.py b/authentik/policies/event_matcher/migrations/0001_initial.py deleted file mode 100644 index f96f82976..000000000 --- a/authentik/policies/event_matcher/migrations/0001_initial.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-24 10:32 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_policies", "0004_policy_execution_logging"), - ] - - operations = [ - migrations.CreateModel( - name="EventMatcherPolicy", - fields=[ - ( - "policy_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_policies.policy", - ), - ), - ( - "action", - models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_created", "Invite Created"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ( - "property_mapping_exception", - "Property Mapping Exception", - ), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - ), - ), - ("client_ip", models.TextField(blank=True)), - ], - options={ - "verbose_name": "Group Membership Policy", - "verbose_name_plural": "Group Membership Policies", - }, - bases=("authentik_policies.policy",), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0002_auto_20201230_2046.py b/authentik/policies/event_matcher/migrations/0002_auto_20201230_2046.py deleted file mode 100644 index 9f65e5299..000000000 --- a/authentik/policies/event_matcher/migrations/0002_auto_20201230_2046.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-30 20:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0003_auto_20210110_1907.py b/authentik/policies/event_matcher/migrations/0003_auto_20210110_1907.py deleted file mode 100644 index 4ed20e27b..000000000 --- a/authentik/policies/event_matcher/migrations/0003_auto_20210110_1907.py +++ /dev/null @@ -1,114 +0,0 @@ -# Generated by Django 3.1.4 on 2021-01-10 19:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0002_auto_20201230_2046"), - ] - - operations = [ - migrations.AddField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.stages.otp_static", "authentik OTP.Static"), - ("authentik.stages.authenticator_totp", "authentik OTP.Time"), - ( - "authentik.stages.authenticator_validate", - "authentik OTP.Validate", - ), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - migrations.AlterField( - model_name="eventmatcherpolicy", - name="client_ip", - field=models.TextField( - blank=True, - help_text="Matches Event's Client IP (strict matching, for network matching use an Expression Policy)", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0004_auto_20210112_2158.py b/authentik/policies/event_matcher/migrations/0004_auto_20210112_2158.py deleted file mode 100644 index 21d531790..000000000 --- a/authentik/policies/event_matcher/migrations/0004_auto_20210112_2158.py +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by Django 3.1.4 on 2021-01-12 21:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0003_auto_20210110_1907"), - ] - - operations = [ - migrations.AlterModelOptions( - name="eventmatcherpolicy", - options={ - "verbose_name": "Event Matcher Policy", - "verbose_name_plural": "Event Matcher Policies", - }, - ), - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.stages.otp_static", "authentik Stages.OTP.Static"), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.OTP.Time", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.OTP.Validate", - ), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0005_auto_20210202_1821.py b/authentik/policies/event_matcher/migrations/0005_auto_20210202_1821.py deleted file mode 100644 index 4e0b80b8d..000000000 --- a/authentik/policies/event_matcher/migrations/0005_auto_20210202_1821.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-02 18:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0004_auto_20210112_2158"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("token_view", "Token View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0006_auto_20210203_1134.py b/authentik/policies/event_matcher/migrations/0006_auto_20210203_1134.py deleted file mode 100644 index 22ab2314b..000000000 --- a/authentik/policies/event_matcher/migrations/0006_auto_20210203_1134.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-03 11:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0005_auto_20210202_1821"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.stages.otp_static", "authentik Stages.OTP.Static"), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.OTP.Time", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.OTP.Validate", - ), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.blueprints", "authentik Blueprints"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0007_auto_20210209_1657.py b/authentik/policies/event_matcher/migrations/0007_auto_20210209_1657.py deleted file mode 100644 index 906e89fa9..000000000 --- a/authentik/policies/event_matcher/migrations/0007_auto_20210209_1657.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-09 16:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0006_auto_20210203_1134"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0008_auto_20210213_1640.py b/authentik/policies/event_matcher/migrations/0008_auto_20210213_1640.py deleted file mode 100644 index dbf4e165c..000000000 --- a/authentik/policies/event_matcher/migrations/0008_auto_20210213_1640.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-13 16:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0007_auto_20210209_1657"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.stages.otp_static", "authentik Stages.OTP.Static"), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.OTP.Time", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.OTP.Validate", - ), - ("authentik.stages.password", "authentik Stages.Password"), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.WebAuthn", - ), - ("authentik.blueprints", "authentik Blueprints"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0009_auto_20210215_2159.py b/authentik/policies/event_matcher/migrations/0009_auto_20210215_2159.py deleted file mode 100644 index 1003ee956..000000000 --- a/authentik/policies/event_matcher/migrations/0009_auto_20210215_2159.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-15 21:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0008_auto_20210213_1640"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.blueprints", "authentik Blueprints"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0010_auto_20210222_1821.py b/authentik/policies/event_matcher/migrations/0010_auto_20210222_1821.py deleted file mode 100644 index 553ea4319..000000000 --- a/authentik/policies/event_matcher/migrations/0010_auto_20210222_1821.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-22 18:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0009_auto_20210215_2159"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.blueprints", "authentik Blueprints"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0011_auto_20210302_0856.py b/authentik/policies/event_matcher/migrations/0011_auto_20210302_0856.py deleted file mode 100644 index c5c3710a0..000000000 --- a/authentik/policies/event_matcher/migrations/0011_auto_20210302_0856.py +++ /dev/null @@ -1,87 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-02 08:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0010_auto_20210222_1821"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ( - "authentik.policies.group_membership", - "authentik Policies.Group Membership", - ), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.deny", "authentik Stages.Deny"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.blueprints", "authentik Blueprints"), - ("authentik.core", "authentik Core"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0012_auto_20210323_1339.py b/authentik/policies/event_matcher/migrations/0012_auto_20210323_1339.py deleted file mode 100644 index 2bb4fa839..000000000 --- a/authentik/policies/event_matcher/migrations/0012_auto_20210323_1339.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-23 13:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0011_auto_20210302_0856"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.deny", "authentik Stages.Deny"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.core", "authentik Core"), - ("authentik.blueprints", "authentik Blueprints"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0013_alter_eventmatcherpolicy_app.py b/authentik/policies/event_matcher/migrations/0013_alter_eventmatcherpolicy_app.py deleted file mode 100644 index 5ef2298b0..000000000 --- a/authentik/policies/event_matcher/migrations/0013_alter_eventmatcherpolicy_app.py +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by Django 3.2 on 2021-05-02 17:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0012_auto_20210323_1339"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.plex", "authentik Sources.Plex"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.deny", "authentik Stages.Deny"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.core", "authentik Core"), - ("authentik.blueprints", "authentik Blueprints"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0014_alter_eventmatcherpolicy_app.py b/authentik/policies/event_matcher/migrations/0014_alter_eventmatcherpolicy_app.py deleted file mode 100644 index 857a99937..000000000 --- a/authentik/policies/event_matcher/migrations/0014_alter_eventmatcherpolicy_app.py +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by Django 3.2.1 on 2021-05-05 17:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0013_alter_eventmatcherpolicy_app"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.ldap", "authentik Providers.LDAP"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.plex", "authentik Sources.Plex"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.deny", "authentik Stages.Deny"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.core", "authentik Core"), - ("authentik.blueprints", "authentik Blueprints"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0015_alter_eventmatcherpolicy_app.py b/authentik/policies/event_matcher/migrations/0015_alter_eventmatcherpolicy_app.py deleted file mode 100644 index 313a4de67..000000000 --- a/authentik/policies/event_matcher/migrations/0015_alter_eventmatcherpolicy_app.py +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-25 12:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0014_alter_eventmatcherpolicy_app"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="app", - field=models.TextField( - blank=True, - choices=[ - ("authentik.admin", "authentik Admin"), - ("authentik.api", "authentik API"), - ("authentik.events", "authentik Events"), - ("authentik.crypto", "authentik Crypto"), - ("authentik.flows", "authentik Flows"), - ("authentik.outposts", "authentik Outpost"), - ("authentik.lib", "authentik lib"), - ("authentik.policies", "authentik Policies"), - ("authentik.policies.dummy", "authentik Policies.Dummy"), - ( - "authentik.policies.event_matcher", - "authentik Policies.Event Matcher", - ), - ("authentik.policies.expiry", "authentik Policies.Expiry"), - ("authentik.policies.expression", "authentik Policies.Expression"), - ("authentik.policies.hibp", "authentik Policies.HaveIBeenPwned"), - ("authentik.policies.password", "authentik Policies.Password"), - ("authentik.policies.reputation", "authentik Policies.Reputation"), - ("authentik.providers.proxy", "authentik Providers.Proxy"), - ("authentik.providers.ldap", "authentik Providers.LDAP"), - ("authentik.providers.oauth2", "authentik Providers.OAuth2"), - ("authentik.providers.saml", "authentik Providers.SAML"), - ("authentik.recovery", "authentik Recovery"), - ("authentik.sources.ldap", "authentik Sources.LDAP"), - ("authentik.sources.oauth", "authentik Sources.OAuth"), - ("authentik.sources.plex", "authentik Sources.Plex"), - ("authentik.sources.saml", "authentik Sources.SAML"), - ( - "authentik.stages.authenticator_duo", - "authentik Stages.Authenticator.Duo", - ), - ( - "authentik.stages.authenticator_static", - "authentik Stages.Authenticator.Static", - ), - ( - "authentik.stages.authenticator_totp", - "authentik Stages.Authenticator.TOTP", - ), - ( - "authentik.stages.authenticator_validate", - "authentik Stages.Authenticator.Validate", - ), - ( - "authentik.stages.authenticator_webauthn", - "authentik Stages.Authenticator.WebAuthn", - ), - ("authentik.stages.captcha", "authentik Stages.Captcha"), - ("authentik.stages.consent", "authentik Stages.Consent"), - ("authentik.stages.deny", "authentik Stages.Deny"), - ("authentik.stages.dummy", "authentik Stages.Dummy"), - ("authentik.stages.email", "authentik Stages.Email"), - ( - "authentik.stages.identification", - "authentik Stages.Identification", - ), - ("authentik.stages.invitation", "authentik Stages.User Invitation"), - ("authentik.stages.password", "authentik Stages.Password"), - ("authentik.stages.prompt", "authentik Stages.Prompt"), - ("authentik.stages.user_delete", "authentik Stages.User Delete"), - ("authentik.stages.user_login", "authentik Stages.User Login"), - ("authentik.stages.user_logout", "authentik Stages.User Logout"), - ("authentik.stages.user_write", "authentik Stages.User Write"), - ("authentik.tenants", "authentik Tenants"), - ("authentik.core", "authentik Core"), - ("authentik.blueprints", "authentik Blueprints"), - ], - default="", - help_text="Match events created by selected application. When left empty, all applications are matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0016_alter_eventmatcherpolicy_action.py b/authentik/policies/event_matcher/migrations/0016_alter_eventmatcherpolicy_action.py deleted file mode 100644 index 0ba7769ff..000000000 --- a/authentik/policies/event_matcher/migrations/0016_alter_eventmatcherpolicy_action.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-09 07:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0015_alter_eventmatcherpolicy_app"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0017_alter_eventmatcherpolicy_action.py b/authentik/policies/event_matcher/migrations/0017_alter_eventmatcherpolicy_action.py deleted file mode 100644 index 1e3ff01d7..000000000 --- a/authentik/policies/event_matcher/migrations/0017_alter_eventmatcherpolicy_action.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-14 15:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0016_alter_eventmatcherpolicy_action"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("system_exception", "System Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0018_alter_eventmatcherpolicy_action.py b/authentik/policies/event_matcher/migrations/0018_alter_eventmatcherpolicy_action.py deleted file mode 100644 index e2c767c56..000000000 --- a/authentik/policies/event_matcher/migrations/0018_alter_eventmatcherpolicy_action.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-14 19:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_policies_event_matcher", "0017_alter_eventmatcherpolicy_action"), - ] - - operations = [ - migrations.AlterField( - model_name="eventmatcherpolicy", - name="action", - field=models.TextField( - blank=True, - choices=[ - ("login", "Login"), - ("login_failed", "Login Failed"), - ("logout", "Logout"), - ("user_write", "User Write"), - ("suspicious_request", "Suspicious Request"), - ("password_set", "Password Set"), - ("secret_view", "Secret View"), - ("secret_rotate", "Secret Rotate"), - ("invitation_used", "Invite Used"), - ("authorize_application", "Authorize Application"), - ("source_linked", "Source Linked"), - ("impersonation_started", "Impersonation Started"), - ("impersonation_ended", "Impersonation Ended"), - ("policy_execution", "Policy Execution"), - ("policy_exception", "Policy Exception"), - ("property_mapping_exception", "Property Mapping Exception"), - ("system_task_execution", "System Task Execution"), - ("system_task_exception", "System Task Exception"), - ("system_exception", "System Exception"), - ("configuration_error", "Configuration Error"), - ("model_created", "Model Created"), - ("model_updated", "Model Updated"), - ("model_deleted", "Model Deleted"), - ("email_sent", "Email Sent"), - ("update_available", "Update Available"), - ("custom_", "Custom Prefix"), - ], - help_text="Match created events with this action type. When left empty, all action types will be matched.", - ), - ), - ] diff --git a/authentik/policies/event_matcher/migrations/0020_eventmatcherpolicy_authentik_p_policy__e605cf_idx.py b/authentik/policies/event_matcher/migrations/0020_eventmatcherpolicy_authentik_p_policy__e605cf_idx.py new file mode 100644 index 000000000..3aeb8b86f --- /dev/null +++ b/authentik/policies/event_matcher/migrations/0020_eventmatcherpolicy_authentik_p_policy__e605cf_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_event_matcher", "0019_alter_eventmatcherpolicy_app"), + ] + + operations = [ + migrations.AddIndex( + model_name="eventmatcherpolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__e605cf_idx"), + ), + ] diff --git a/authentik/policies/event_matcher/models.py b/authentik/policies/event_matcher/models.py index 57f437da7..e367361d5 100644 --- a/authentik/policies/event_matcher/models.py +++ b/authentik/policies/event_matcher/models.py @@ -75,7 +75,7 @@ class EventMatcherPolicy(Policy): return PolicyResult(True, "App matched.") return PolicyResult(False) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Event Matcher Policy") verbose_name_plural = _("Event Matcher Policies") diff --git a/authentik/policies/expiry/migrations/0002_passwordexpirypolicy_authentik_p_policy__cf73a7_idx.py b/authentik/policies/expiry/migrations/0002_passwordexpirypolicy_authentik_p_policy__cf73a7_idx.py new file mode 100644 index 000000000..6e797c961 --- /dev/null +++ b/authentik/policies/expiry/migrations/0002_passwordexpirypolicy_authentik_p_policy__cf73a7_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_expiry", "0001_initial"), + ] + + operations = [ + migrations.AddIndex( + model_name="passwordexpirypolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__cf73a7_idx"), + ), + ] diff --git a/authentik/policies/expiry/models.py b/authentik/policies/expiry/models.py index 595cdf594..58ce968a7 100644 --- a/authentik/policies/expiry/models.py +++ b/authentik/policies/expiry/models.py @@ -49,7 +49,7 @@ class PasswordExpiryPolicy(Policy): return PolicyResult(False, _("Password has expired.")) return PolicyResult(True) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Password Expiry Policy") verbose_name_plural = _("Password Expiry Policies") diff --git a/authentik/policies/expression/migrations/0004_expressionpolicy_authentik_p_policy__fb6feb_idx.py b/authentik/policies/expression/migrations/0004_expressionpolicy_authentik_p_policy__fb6feb_idx.py new file mode 100644 index 000000000..7f069c490 --- /dev/null +++ b/authentik/policies/expression/migrations/0004_expressionpolicy_authentik_p_policy__fb6feb_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_expression", "0003_auto_20201203_1223"), + ] + + operations = [ + migrations.AddIndex( + model_name="expressionpolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__fb6feb_idx"), + ), + ] diff --git a/authentik/policies/expression/models.py b/authentik/policies/expression/models.py index d79efb372..9fb8967e9 100644 --- a/authentik/policies/expression/models.py +++ b/authentik/policies/expression/models.py @@ -36,7 +36,7 @@ class ExpressionPolicy(Policy): evaluator.validate(self.expression) return super().save(*args, **kwargs) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Expression Policy") verbose_name_plural = _("Expression Policies") diff --git a/authentik/policies/hibp/migrations/0003_haveibeenpwendpolicy_authentik_p_policy__6957d7_idx.py b/authentik/policies/hibp/migrations/0003_haveibeenpwendpolicy_authentik_p_policy__6957d7_idx.py new file mode 100644 index 000000000..c12a4e2f7 --- /dev/null +++ b/authentik/policies/hibp/migrations/0003_haveibeenpwendpolicy_authentik_p_policy__6957d7_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_hibp", "0002_haveibeenpwendpolicy_password_field"), + ] + + operations = [ + migrations.AddIndex( + model_name="haveibeenpwendpolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__6957d7_idx"), + ), + ] diff --git a/authentik/policies/hibp/models.py b/authentik/policies/hibp/models.py index 971318e92..6123a775d 100644 --- a/authentik/policies/hibp/models.py +++ b/authentik/policies/hibp/models.py @@ -65,7 +65,7 @@ class HaveIBeenPwendPolicy(Policy): return PolicyResult(False, message) return PolicyResult(True) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Have I Been Pwned Policy") verbose_name_plural = _("Have I Been Pwned Policies") diff --git a/authentik/policies/migrations/0008_policybinding_authentik_p_policy__534e15_idx_and_more.py b/authentik/policies/migrations/0008_policybinding_authentik_p_policy__534e15_idx_and_more.py new file mode 100644 index 000000000..83244faca --- /dev/null +++ b/authentik/policies/migrations/0008_policybinding_authentik_p_policy__534e15_idx_and_more.py @@ -0,0 +1,29 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies", "0007_policybindingmodel_policy_engine_mode"), + ] + + operations = [ + migrations.AddIndex( + model_name="policybinding", + index=models.Index(fields=["policy"], name="authentik_p_policy__534e15_idx"), + ), + migrations.AddIndex( + model_name="policybinding", + index=models.Index(fields=["group"], name="authentik_p_group_i_5d2d24_idx"), + ), + migrations.AddIndex( + model_name="policybinding", + index=models.Index(fields=["user"], name="authentik_p_user_id_603323_idx"), + ), + migrations.AddIndex( + model_name="policybinding", + index=models.Index(fields=["target"], name="authentik_p_target__2e4d50_idx"), + ), + ] diff --git a/authentik/policies/models.py b/authentik/policies/models.py index 43b5ab577..71d82239f 100644 --- a/authentik/policies/models.py +++ b/authentik/policies/models.py @@ -141,6 +141,12 @@ class PolicyBinding(SerializerModel): verbose_name = _("Policy Binding") verbose_name_plural = _("Policy Bindings") unique_together = ("policy", "target", "order") + indexes = [ + models.Index(fields=["policy"]), + models.Index(fields=["group"]), + models.Index(fields=["user"]), + models.Index(fields=["target"]), + ] class Policy(SerializerModel, CreatedUpdatedModel): @@ -185,3 +191,10 @@ class Policy(SerializerModel, CreatedUpdatedModel): ("view_policy_cache", "View Policy's cache metrics"), ("clear_policy_cache", "Clear Policy's cache metrics"), ] + + class PolicyMeta: + """Base class for the Meta class for all policies""" + + indexes = [ + models.Index(fields=["policy_ptr_id"]), + ] diff --git a/authentik/policies/password/migrations/0004_passwordpolicy_authentik_p_policy__855e80_idx.py b/authentik/policies/password/migrations/0004_passwordpolicy_authentik_p_policy__855e80_idx.py new file mode 100644 index 000000000..1c984525b --- /dev/null +++ b/authentik/policies/password/migrations/0004_passwordpolicy_authentik_p_policy__855e80_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_policies_password", "0003_passwordpolicy_amount_digits"), + ] + + operations = [ + migrations.AddIndex( + model_name="passwordpolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__855e80_idx"), + ), + ] diff --git a/authentik/policies/password/models.py b/authentik/policies/password/models.py index ca757bc64..640eaf8c5 100644 --- a/authentik/policies/password/models.py +++ b/authentik/policies/password/models.py @@ -84,7 +84,7 @@ class PasswordPolicy(Policy): return PolicyResult(True) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Password Policy") verbose_name_plural = _("Password Policies") diff --git a/authentik/policies/reputation/migrations/0004_reputationpolicy_authentik_p_policy__8f0d70_idx.py b/authentik/policies/reputation/migrations/0004_reputationpolicy_authentik_p_policy__8f0d70_idx.py new file mode 100644 index 000000000..9c6800c01 --- /dev/null +++ b/authentik/policies/reputation/migrations/0004_reputationpolicy_authentik_p_policy__8f0d70_idx.py @@ -0,0 +1,20 @@ +# Generated by Django 4.1.2 on 2022-10-19 19:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "authentik_policies_reputation", + "0003_reputation_delete_ipreputation_delete_userreputation", + ), + ] + + operations = [ + migrations.AddIndex( + model_name="reputationpolicy", + index=models.Index(fields=["policy_ptr_id"], name="authentik_p_policy__8f0d70_idx"), + ), + ] diff --git a/authentik/policies/reputation/models.py b/authentik/policies/reputation/models.py index a75498c86..8ea7a1674 100644 --- a/authentik/policies/reputation/models.py +++ b/authentik/policies/reputation/models.py @@ -54,7 +54,7 @@ class ReputationPolicy(Policy): ) return PolicyResult(bool(passing)) - class Meta: + class Meta(Policy.PolicyMeta): verbose_name = _("Reputation Policy") verbose_name_plural = _("Reputation Policies") diff --git a/authentik/providers/ldap/migrations/0001_initial.py b/authentik/providers/ldap/migrations/0001_initial.py deleted file mode 100644 index eaf490403..000000000 --- a/authentik/providers/ldap/migrations/0001_initial.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2 on 2021-04-26 12:45 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_core", "0019_source_managed"), - ] - - operations = [ - migrations.CreateModel( - name="LDAPProvider", - fields=[ - ( - "provider_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.provider", - ), - ), - ( - "base_dn", - models.TextField( - default="DC=ldap,DC=goauthentik,DC=io", - help_text="DN under which objects are accessible.", - ), - ), - ], - options={ - "verbose_name": "LDAP Provider", - "verbose_name_plural": "LDAP Providers", - }, - bases=("authentik_core.provider", models.Model), - ), - ] diff --git a/authentik/providers/ldap/migrations/0002_ldapprovider_search_group.py b/authentik/providers/ldap/migrations/0002_ldapprovider_search_group.py deleted file mode 100644 index afa4aa4a0..000000000 --- a/authentik/providers/ldap/migrations/0002_ldapprovider_search_group.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2 on 2021-04-26 19:57 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0019_source_managed"), - ("authentik_providers_ldap", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="ldapprovider", - name="search_group", - field=models.ForeignKey( - default=None, - help_text="Users in this group can do search queries. If not set, every user can execute search queries.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_core.group", - ), - ), - ] diff --git a/authentik/providers/ldap/migrations/0003_auto_20210713_1138.py b/authentik/providers/ldap/migrations/0003_auto_20210713_1138.py deleted file mode 100644 index bc76c6ca3..000000000 --- a/authentik/providers/ldap/migrations/0003_auto_20210713_1138.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-13 11:38 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_providers_ldap", "0002_ldapprovider_search_group"), - ] - - operations = [ - migrations.AddField( - model_name="ldapprovider", - name="certificate", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.certificatekeypair", - ), - ), - migrations.AddField( - model_name="ldapprovider", - name="tls_server_name", - field=models.TextField(blank=True, default=""), - ), - ] diff --git a/authentik/providers/ldap/migrations/0004_auto_20210713_2115.py b/authentik/providers/ldap/migrations/0004_auto_20210713_2115.py deleted file mode 100644 index 3f559aefc..000000000 --- a/authentik/providers/ldap/migrations/0004_auto_20210713_2115.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-13 21:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_ldap", "0003_auto_20210713_1138"), - ] - - operations = [ - migrations.AddField( - model_name="ldapprovider", - name="gid_start_number", - field=models.IntegerField( - default=4000, - help_text="The start for gidNumbers, this number is added to a number generated from the group.Pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber", - ), - ), - migrations.AddField( - model_name="ldapprovider", - name="uid_start_number", - field=models.IntegerField( - default=2000, - help_text="The start for uidNumbers, this number is added to the user.Pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber", - ), - ), - ] diff --git a/authentik/providers/ldap/migrations/0005_ldapprovider_search_mode.py b/authentik/providers/ldap/migrations/0005_ldapprovider_search_mode.py deleted file mode 100644 index b30032a25..000000000 --- a/authentik/providers/ldap/migrations/0005_ldapprovider_search_mode.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.8 on 2021-11-05 09:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_ldap", "0004_auto_20210713_2115"), - ] - - operations = [ - migrations.AddField( - model_name="ldapprovider", - name="search_mode", - field=models.TextField( - choices=[("direct", "Direct"), ("cached", "Cached")], default="direct" - ), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0007_auto_20201016_1107.py b/authentik/providers/oauth2/migrations/0007_auto_20201016_1107.py deleted file mode 100644 index 1f5cab066..000000000 --- a/authentik/providers/oauth2/migrations/0007_auto_20201016_1107.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-16 11:07 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0006_remove_oauth2provider_name"), - ] - - operations = [ - migrations.AlterModelOptions( - name="refreshtoken", - options={ - "verbose_name": "OAuth2 Token", - "verbose_name_plural": "OAuth2 Tokens", - }, - ), - ] diff --git a/authentik/providers/oauth2/migrations/0008_oauth2provider_issuer_mode.py b/authentik/providers/oauth2/migrations/0008_oauth2provider_issuer_mode.py deleted file mode 100644 index a96255c81..000000000 --- a/authentik/providers/oauth2/migrations/0008_oauth2provider_issuer_mode.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-27 13:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0007_auto_20201016_1107"), - ] - - operations = [ - migrations.AddField( - model_name="oauth2provider", - name="issuer_mode", - field=models.TextField( - choices=[ - ("global", "Same identifier is used for all providers"), - ( - "per_provider", - "Each provider has a different issuer, based on the application slug.", - ), - ], - default="per_provider", - help_text="Configure how the issuer field of the ID Token should be filled.", - ), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0009_remove_oauth2provider_response_type.py b/authentik/providers/oauth2/migrations/0009_remove_oauth2provider_response_type.py deleted file mode 100644 index 7dcf48ddb..000000000 --- a/authentik/providers/oauth2/migrations/0009_remove_oauth2provider_response_type.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-27 16:32 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0008_oauth2provider_issuer_mode"), - ] - - operations = [ - migrations.RemoveField( - model_name="oauth2provider", - name="response_type", - ), - ] diff --git a/authentik/providers/oauth2/migrations/0010_auto_20201227_1804.py b/authentik/providers/oauth2/migrations/0010_auto_20201227_1804.py deleted file mode 100644 index 96ba7e53b..000000000 --- a/authentik/providers/oauth2/migrations/0010_auto_20201227_1804.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-27 18:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0009_remove_oauth2provider_response_type"), - ] - - operations = [ - migrations.AlterField( - model_name="refreshtoken", - name="access_token", - field=models.TextField(verbose_name="Access Token"), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0011_managed.py b/authentik/providers/oauth2/migrations/0011_managed.py deleted file mode 100644 index 5b1764920..000000000 --- a/authentik/providers/oauth2/migrations/0011_managed.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-03 09:24 - -from django.apps.registry import Apps -from django.db import migrations - -scope_uid_map = { - "openid": "goauthentik.io/providers/oauth2/scope-openid", - "email": "goauthentik.io/providers/oauth2/scope-email", - "profile": "goauthentik.io/providers/oauth2/scope-profile", - "ak_proxy": "goauthentik.io/providers/proxy/scope-proxy", -} - - -def set_managed_flag(apps: Apps, schema_editor): - ScopeMapping = apps.get_model("authentik_providers_oauth2", "ScopeMapping") - db_alias = schema_editor.connection.alias - for mapping in ScopeMapping.objects.using(db_alias).filter(name__startswith="Autogenerated "): - mapping.managed = scope_uid_map[mapping.scope_name] - mapping.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0017_managed"), - ("authentik_providers_oauth2", "0010_auto_20201227_1804"), - ] - - operations = [ - migrations.RunPython(set_managed_flag), - ] diff --git a/authentik/providers/oauth2/migrations/0012_oauth2provider_access_code_validity.py b/authentik/providers/oauth2/migrations/0012_oauth2provider_access_code_validity.py deleted file mode 100644 index 2aaa9983d..000000000 --- a/authentik/providers/oauth2/migrations/0012_oauth2provider_access_code_validity.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2 on 2021-04-28 18:17 - -from django.db import migrations, models - -import authentik.lib.utils.time - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0011_managed"), - ] - - operations = [ - migrations.AddField( - model_name="oauth2provider", - name="access_code_validity", - field=models.TextField( - default="minutes=1", - help_text="Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0013_alter_authorizationcode_nonce.py b/authentik/providers/oauth2/migrations/0013_alter_authorizationcode_nonce.py deleted file mode 100644 index 8a9b5886b..000000000 --- a/authentik/providers/oauth2/migrations/0013_alter_authorizationcode_nonce.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-02 18:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0012_oauth2provider_access_code_validity"), - ] - - operations = [ - migrations.AlterField( - model_name="authorizationcode", - name="nonce", - field=models.TextField(blank=True, default="", verbose_name="Nonce"), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0014_alter_oauth2provider_rsa_key.py b/authentik/providers/oauth2/migrations/0014_alter_oauth2provider_rsa_key.py deleted file mode 100644 index 5376b9ea8..000000000 --- a/authentik/providers/oauth2/migrations/0014_alter_oauth2provider_rsa_key.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-09 21:52 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_providers_oauth2", "0013_alter_authorizationcode_nonce"), - ] - - operations = [ - migrations.AlterField( - model_name="oauth2provider", - name="rsa_key", - field=models.ForeignKey( - help_text="Key used to sign the tokens. Only required when JWT Algorithm is set to RS256.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.certificatekeypair", - verbose_name="RSA Key", - ), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0015_auto_20210703_1313.py b/authentik/providers/oauth2/migrations/0015_auto_20210703_1313.py deleted file mode 100644 index 79654b521..000000000 --- a/authentik/providers/oauth2/migrations/0015_auto_20210703_1313.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.4 on 2021-07-03 13:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0014_alter_oauth2provider_rsa_key"), - ] - - operations = [ - migrations.AddField( - model_name="authorizationcode", - name="revoked", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="refreshtoken", - name="revoked", - field=models.BooleanField(default=False), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0016_alter_authorizationcode_nonce.py b/authentik/providers/oauth2/migrations/0016_alter_authorizationcode_nonce.py deleted file mode 100644 index f0da01639..000000000 --- a/authentik/providers/oauth2/migrations/0016_alter_authorizationcode_nonce.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-20 22:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0015_auto_20210703_1313"), - ] - - operations = [ - migrations.AlterField( - model_name="authorizationcode", - name="nonce", - field=models.TextField(default=None, null=True, verbose_name="Nonce"), - ), - ] diff --git a/authentik/providers/oauth2/migrations/0017_alter_oauth2provider_token_validity.py b/authentik/providers/oauth2/migrations/0017_alter_oauth2provider_token_validity.py deleted file mode 100644 index 5783ff7ea..000000000 --- a/authentik/providers/oauth2/migrations/0017_alter_oauth2provider_token_validity.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.6 on 2021-09-08 15:12 - -from django.db import migrations, models - -import authentik.lib.utils.time - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_oauth2", "0016_alter_authorizationcode_nonce"), - ] - - operations = [ - migrations.AlterField( - model_name="oauth2provider", - name="token_validity", - field=models.TextField( - default="days=30", - help_text="Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0001_initial.py b/authentik/providers/proxy/migrations/0001_initial.py deleted file mode 100644 index 4b2a02136..000000000 --- a/authentik/providers/proxy/migrations/0001_initial.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.1 on 2020-08-18 18:16 - -import django.core.validators -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_providers_oauth2", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="ProxyProvider", - fields=[ - ( - "oauth2provider_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_providers_oauth2.oauth2provider", - ), - ), - ( - "internal_host", - models.TextField( - validators=[django.core.validators.URLValidator(schemes=("http", "https"))] - ), - ), - ( - "external_host", - models.TextField( - validators=[django.core.validators.URLValidator(schemes=("http", "https"))] - ), - ), - ], - options={ - "verbose_name": "Proxy Provider", - "verbose_name_plural": "Proxy Providers", - }, - bases=("authentik_providers_oauth2.oauth2provider",), - ), - ] diff --git a/authentik/providers/proxy/migrations/0002_proxyprovider_cookie_secret.py b/authentik/providers/proxy/migrations/0002_proxyprovider_cookie_secret.py deleted file mode 100644 index c6b1ad4ee..000000000 --- a/authentik/providers/proxy/migrations/0002_proxyprovider_cookie_secret.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1 on 2020-08-19 14:50 - -from django.db import migrations, models - -import authentik.providers.proxy.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="cookie_secret", - field=models.TextField(default=authentik.providers.proxy.models.get_cookie_secret), - ), - ] diff --git a/authentik/providers/proxy/migrations/0003_proxyprovider_certificate.py b/authentik/providers/proxy/migrations/0003_proxyprovider_certificate.py deleted file mode 100644 index cbdbb8620..000000000 --- a/authentik/providers/proxy/migrations/0003_proxyprovider_certificate.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.1 on 2020-08-23 22:46 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_providers_proxy", "0002_proxyprovider_cookie_secret"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="certificate", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.certificatekeypair", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0004_auto_20200913_1947.py b/authentik/providers/proxy/migrations/0004_auto_20200913_1947.py deleted file mode 100644 index ab5ce8ba3..000000000 --- a/authentik/providers/proxy/migrations/0004_auto_20200913_1947.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-13 19:47 - -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0003_proxyprovider_certificate"), - ] - - operations = [ - migrations.AlterField( - model_name="proxyprovider", - name="external_host", - field=models.TextField( - validators=[authentik.lib.models.DomainlessURLValidator(schemes=("http", "https"))] - ), - ), - migrations.AlterField( - model_name="proxyprovider", - name="internal_host", - field=models.TextField( - validators=[authentik.lib.models.DomainlessURLValidator(schemes=("http", "https"))] - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0005_auto_20200914_1536.py b/authentik/providers/proxy/migrations/0005_auto_20200914_1536.py deleted file mode 100644 index 0e8ec244d..000000000 --- a/authentik/providers/proxy/migrations/0005_auto_20200914_1536.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-14 15:36 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_providers_proxy", "0004_auto_20200913_1947"), - ] - - operations = [ - migrations.AlterField( - model_name="proxyprovider", - name="certificate", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.certificatekeypair", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0006_proxyprovider_skip_path_regex.py b/authentik/providers/proxy/migrations/0006_proxyprovider_skip_path_regex.py deleted file mode 100644 index de7bd7d5b..000000000 --- a/authentik/providers/proxy/migrations/0006_proxyprovider_skip_path_regex.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-19 09:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0005_auto_20200914_1536"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="skip_path_regex", - field=models.TextField( - blank=True, - default="", - help_text="Regular expression for which authentication is not required. Each new line is interpreted as a new Regular Expression.", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0007_auto_20200923_1017.py b/authentik/providers/proxy/migrations/0007_auto_20200923_1017.py deleted file mode 100644 index 722bb87ed..000000000 --- a/authentik/providers/proxy/migrations/0007_auto_20200923_1017.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-23 10:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0006_proxyprovider_skip_path_regex"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="internal_host_ssl_validation", - field=models.BooleanField( - default=True, help_text="Validate SSL Certificates of upstream servers" - ), - ), - migrations.AlterField( - model_name="proxyprovider", - name="skip_path_regex", - field=models.TextField( - blank=True, - default="", - help_text="Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression.", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0008_auto_20200930_0810.py b/authentik/providers/proxy/migrations/0008_auto_20200930_0810.py deleted file mode 100644 index 39c245029..000000000 --- a/authentik/providers/proxy/migrations/0008_auto_20200930_0810.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-30 08:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0007_auto_20200923_1017"), - ] - - operations = [ - migrations.AlterField( - model_name="proxyprovider", - name="internal_host_ssl_validation", - field=models.BooleanField( - default=True, - help_text="Validate SSL Certificates of upstream servers", - verbose_name="Internal host SSL Validation", - ), - ), - migrations.AddField( - model_name="proxyprovider", - name="basic_auth_enabled", - field=models.BooleanField( - default=False, - help_text="Set a custom HTTP-Basic Authentication header based on values from authentik.", - verbose_name="Set HTTP-Basic Authentication", - ), - ), - migrations.AddField( - model_name="proxyprovider", - name="basic_auth_password_attribute", - field=models.TextField( - blank=True, - help_text="User Attribute used for the password part of the HTTP-Basic Header.", - verbose_name="HTTP-Basic Password", - ), - ), - migrations.AddField( - model_name="proxyprovider", - name="basic_auth_user_attribute", - field=models.TextField( - blank=True, - help_text="User Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used.", - verbose_name="HTTP-Basic Username", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0009_auto_20201007_1721.py b/authentik/providers/proxy/migrations/0009_auto_20201007_1721.py deleted file mode 100644 index 94c6e2a3b..000000000 --- a/authentik/providers/proxy/migrations/0009_auto_20201007_1721.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-07 17:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0008_auto_20200930_0810"), - ] - - operations = [ - migrations.AlterField( - model_name="proxyprovider", - name="basic_auth_password_attribute", - field=models.TextField( - blank=True, - help_text="User/Group Attribute used for the password part of the HTTP-Basic Header.", - verbose_name="HTTP-Basic Password Key", - ), - ), - migrations.AlterField( - model_name="proxyprovider", - name="basic_auth_user_attribute", - field=models.TextField( - blank=True, - help_text="User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used.", - verbose_name="HTTP-Basic Username Key", - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0010_auto_20201214_0942.py b/authentik/providers/proxy/migrations/0010_auto_20201214_0942.py deleted file mode 100644 index 47ee856df..000000000 --- a/authentik/providers/proxy/migrations/0010_auto_20201214_0942.py +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-14 09:42 -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0009_auto_20201007_1721"), - ] - - operations = [] diff --git a/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py b/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py deleted file mode 100644 index 45f728836..000000000 --- a/authentik/providers/proxy/migrations/0011_proxyprovider_forward_auth_mode.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2 on 2021-04-27 18:47 - -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0010_auto_20201214_0942"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="forward_auth_mode", - field=models.BooleanField( - default=False, - help_text="Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.", - ), - ), - migrations.AlterField( - model_name="proxyprovider", - name="internal_host", - field=models.TextField( - blank=True, - validators=[authentik.lib.models.DomainlessURLValidator(schemes=("http", "https"))], - ), - ), - ] diff --git a/authentik/providers/proxy/migrations/0012_proxyprovider_cookie_domain.py b/authentik/providers/proxy/migrations/0012_proxyprovider_cookie_domain.py deleted file mode 100644 index f88dd6968..000000000 --- a/authentik/providers/proxy/migrations/0012_proxyprovider_cookie_domain.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-31 20:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0011_proxyprovider_forward_auth_mode"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="cookie_domain", - field=models.TextField(blank=True, default=""), - ), - ] diff --git a/authentik/providers/proxy/migrations/0013_mode.py b/authentik/providers/proxy/migrations/0013_mode.py deleted file mode 100644 index f0acd2548..000000000 --- a/authentik/providers/proxy/migrations/0013_mode.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-06 16:29 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def migrate_mode(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - from authentik.providers.proxy.models import ProxyMode - - db_alias = schema_editor.connection.alias - ProxyProvider = apps.get_model("authentik_providers_proxy", "proxyprovider") - for provider in ProxyProvider.objects.using(db_alias).all(): - if provider.forward_auth_mode: - provider.mode = ProxyMode.FORWARD_SINGLE - provider.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0012_proxyprovider_cookie_domain"), - ] - - operations = [ - migrations.AddField( - model_name="proxyprovider", - name="mode", - field=models.TextField( - choices=[ - ("proxy", "Proxy"), - ("forward_single", "Forward Single"), - ("forward_domain", "Forward Domain"), - ], - default="proxy", - help_text="Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.", - ), - ), - migrations.RunPython(migrate_mode), - migrations.RemoveField( - model_name="proxyprovider", - name="forward_auth_mode", - ), - ] diff --git a/authentik/providers/proxy/migrations/0014_proxy_v2.py b/authentik/providers/proxy/migrations/0014_proxy_v2.py deleted file mode 100644 index 2ff0f51df..000000000 --- a/authentik/providers/proxy/migrations/0014_proxy_v2.py +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Django 3.2.6 on 2021-09-09 11:24 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_proxy", "0013_mode"), - ] - - operations = [] diff --git a/authentik/providers/saml/migrations/0001_initial.py b/authentik/providers/saml/migrations/0001_initial.py deleted file mode 100644 index a8cb964fc..000000000 --- a/authentik/providers/saml/migrations/0001_initial.py +++ /dev/null @@ -1,134 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:08 - -import django.db.models.deletion -from django.db import migrations, models - -import authentik.lib.utils.time - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_crypto", "0001_initial"), - ("authentik_core", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="SAMLPropertyMapping", - fields=[ - ( - "propertymapping_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.PropertyMapping", - ), - ), - ("saml_name", models.TextField(verbose_name="SAML Name")), - ( - "friendly_name", - models.TextField(blank=True, default=None, null=True), - ), - ], - options={ - "verbose_name": "SAML Property Mapping", - "verbose_name_plural": "SAML Property Mappings", - }, - bases=("authentik_core.propertymapping",), - ), - migrations.CreateModel( - name="SAMLProvider", - fields=[ - ( - "provider_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.Provider", - ), - ), - ("name", models.TextField()), - ("processor_path", models.CharField(choices=[], max_length=255)), - ("acs_url", models.URLField(verbose_name="ACS URL")), - ("audience", models.TextField(default="")), - ("issuer", models.TextField(help_text="Also known as EntityID")), - ( - "assertion_valid_not_before", - models.TextField( - default="minutes=-5", - help_text="Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ( - "assertion_valid_not_on_or_after", - models.TextField( - default="minutes=5", - help_text="Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ( - "session_valid_not_on_or_after", - models.TextField( - default="minutes=86400", - help_text="Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ( - "digest_algorithm", - models.CharField( - choices=[("sha1", "SHA1"), ("sha256", "SHA256")], - default="sha256", - max_length=50, - ), - ), - ( - "signature_algorithm", - models.CharField( - choices=[ - ("rsa-sha1", "RSA-SHA1"), - ("rsa-sha256", "RSA-SHA256"), - ("ecdsa-sha256", "ECDSA-SHA256"), - ("dsa-sha1", "DSA-SHA1"), - ], - default="rsa-sha256", - max_length=50, - ), - ), - ( - "require_signing", - models.BooleanField( - default=False, - help_text="Require Requests to be signed by an X509 Certificate. Must match the Certificate selected in `Signing Keypair`.", - ), - ), - ( - "signing_kp", - models.ForeignKey( - default=None, - help_text="Signing is enabled upon selection of a Key Pair.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.CertificateKeyPair", - verbose_name="Signing Keypair", - ), - ), - ], - options={ - "verbose_name": "SAML Provider", - "verbose_name_plural": "SAML Providers", - }, - bases=("authentik_core.provider",), - ), - ] diff --git a/authentik/providers/saml/migrations/0002_default_saml_property_mappings.py b/authentik/providers/saml/migrations/0002_default_saml_property_mappings.py deleted file mode 100644 index ba694ba1c..000000000 --- a/authentik/providers/saml/migrations/0002_default_saml_property_mappings.py +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 19:32 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_saml", "0001_initial"), - ] - - operations = [] diff --git a/authentik/providers/saml/migrations/0003_samlprovider_sp_binding.py b/authentik/providers/saml/migrations/0003_samlprovider_sp_binding.py deleted file mode 100644 index 9119f1cc8..000000000 --- a/authentik/providers/saml/migrations/0003_samlprovider_sp_binding.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.0.6 on 2020-06-06 13:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_saml", "0002_default_saml_property_mappings"), - ] - - operations = [ - migrations.AddField( - model_name="samlprovider", - name="sp_binding", - field=models.TextField( - choices=[("redirect", "Redirect"), ("post", "Post")], default="redirect" - ), - ), - ] diff --git a/authentik/providers/saml/migrations/0004_auto_20200620_1950.py b/authentik/providers/saml/migrations/0004_auto_20200620_1950.py deleted file mode 100644 index 723d16cb7..000000000 --- a/authentik/providers/saml/migrations/0004_auto_20200620_1950.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.7 on 2020-06-20 19:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_saml", "0003_samlprovider_sp_binding"), - ] - - operations = [ - migrations.AlterField( - model_name="samlprovider", - name="sp_binding", - field=models.TextField( - choices=[("redirect", "Redirect"), ("post", "Post")], - default="redirect", - verbose_name="Service Prodier Binding", - ), - ), - ] diff --git a/authentik/providers/saml/migrations/0005_remove_samlprovider_processor_path.py b/authentik/providers/saml/migrations/0005_remove_samlprovider_processor_path.py deleted file mode 100644 index db5a834ab..000000000 --- a/authentik/providers/saml/migrations/0005_remove_samlprovider_processor_path.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-11 00:02 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_providers_saml", "0004_auto_20200620_1950"), - ] - - operations = [ - migrations.RemoveField( - model_name="samlprovider", - name="processor_path", - ), - ] diff --git a/authentik/sources/ldap/migrations/0001_initial.py b/authentik/sources/ldap/migrations/0001_initial.py deleted file mode 100644 index 3599fd069..000000000 --- a/authentik/sources/ldap/migrations/0001_initial.py +++ /dev/null @@ -1,127 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:08 - -import django.core.validators -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_core", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="LDAPPropertyMapping", - fields=[ - ( - "propertymapping_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.PropertyMapping", - ), - ), - ("object_field", models.TextField()), - ], - options={ - "verbose_name": "LDAP Property Mapping", - "verbose_name_plural": "LDAP Property Mappings", - }, - bases=("authentik_core.propertymapping",), - ), - migrations.CreateModel( - name="LDAPSource", - fields=[ - ( - "source_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.Source", - ), - ), - ( - "server_uri", - models.TextField( - validators=[django.core.validators.URLValidator(schemes=["ldap", "ldaps"])], - verbose_name="Server URI", - ), - ), - ("bind_cn", models.TextField(verbose_name="Bind CN")), - ("bind_password", models.TextField()), - ( - "start_tls", - models.BooleanField(default=False, verbose_name="Enable Start TLS"), - ), - ("base_dn", models.TextField(verbose_name="Base DN")), - ( - "additional_user_dn", - models.TextField( - help_text="Prepended to Base DN for User-queries.", - verbose_name="Addition User DN", - ), - ), - ( - "additional_group_dn", - models.TextField( - help_text="Prepended to Base DN for Group-queries.", - verbose_name="Addition Group DN", - ), - ), - ( - "user_object_filter", - models.TextField( - default="(objectCategory=Person)", - help_text="Consider Objects matching this filter to be Users.", - ), - ), - ( - "user_group_membership_field", - models.TextField( - default="memberOf", - help_text="Field which contains Groups of user.", - ), - ), - ( - "group_object_filter", - models.TextField( - default="(objectCategory=Group)", - help_text="Consider Objects matching this filter to be Groups.", - ), - ), - ( - "object_uniqueness_field", - models.TextField( - default="objectSid", - help_text="Field which contains a unique Identifier.", - ), - ), - ("sync_groups", models.BooleanField(default=True)), - ( - "sync_parent_group", - models.ForeignKey( - blank=True, - default=None, - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_core.Group", - ), - ), - ], - options={ - "verbose_name": "LDAP Source", - "verbose_name_plural": "LDAP Sources", - }, - bases=("authentik_core.source",), - ), - ] diff --git a/authentik/sources/ldap/migrations/0002_ldapsource_sync_users.py b/authentik/sources/ldap/migrations/0002_ldapsource_sync_users.py deleted file mode 100644 index 93df6ff7e..000000000 --- a/authentik/sources/ldap/migrations/0002_ldapsource_sync_users.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 19:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="ldapsource", - name="sync_users", - field=models.BooleanField(default=True), - ), - ] diff --git a/authentik/sources/ldap/migrations/0003_default_ldap_property_mappings.py b/authentik/sources/ldap/migrations/0003_default_ldap_property_mappings.py deleted file mode 100644 index 54b514b9d..000000000 --- a/authentik/sources/ldap/migrations/0003_default_ldap_property_mappings.py +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 19:30 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0002_ldapsource_sync_users"), - ] - - operations = [] diff --git a/authentik/sources/ldap/migrations/0004_auto_20200524_1146.py b/authentik/sources/ldap/migrations/0004_auto_20200524_1146.py deleted file mode 100644 index 2bc5397e5..000000000 --- a/authentik/sources/ldap/migrations/0004_auto_20200524_1146.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-24 11:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0003_default_ldap_property_mappings"), - ] - - operations = [ - migrations.AlterField( - model_name="ldapsource", - name="additional_group_dn", - field=models.TextField( - blank=True, - help_text="Prepended to Base DN for Group-queries.", - verbose_name="Addition Group DN", - ), - ), - migrations.AlterField( - model_name="ldapsource", - name="additional_user_dn", - field=models.TextField( - blank=True, - help_text="Prepended to Base DN for User-queries.", - verbose_name="Addition User DN", - ), - ), - ] diff --git a/authentik/sources/ldap/migrations/0005_auto_20200913_1947.py b/authentik/sources/ldap/migrations/0005_auto_20200913_1947.py deleted file mode 100644 index 81218f77e..000000000 --- a/authentik/sources/ldap/migrations/0005_auto_20200913_1947.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-13 19:47 - -from django.db import migrations, models - -import authentik.lib.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0004_auto_20200524_1146"), - ] - - operations = [ - migrations.AlterField( - model_name="ldapsource", - name="server_uri", - field=models.TextField( - validators=[authentik.lib.models.DomainlessURLValidator(schemes=["ldap", "ldaps"])], - verbose_name="Server URI", - ), - ), - ] diff --git a/authentik/sources/ldap/migrations/0006_auto_20200915_1919.py b/authentik/sources/ldap/migrations/0006_auto_20200915_1919.py deleted file mode 100644 index 8c9a506ab..000000000 --- a/authentik/sources/ldap/migrations/0006_auto_20200915_1919.py +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-15 19:19 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0005_auto_20200913_1947"), - ] - - operations = [] diff --git a/authentik/sources/ldap/migrations/0007_ldapsource_sync_users_password.py b/authentik/sources/ldap/migrations/0007_ldapsource_sync_users_password.py deleted file mode 100644 index 51bda8d27..000000000 --- a/authentik/sources/ldap/migrations/0007_ldapsource_sync_users_password.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-21 09:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0006_auto_20200915_1919"), - ] - - operations = [ - migrations.AddField( - model_name="ldapsource", - name="sync_users_password", - field=models.BooleanField( - default=True, - help_text="When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source.", - unique=True, - ), - ), - ] diff --git a/authentik/sources/ldap/migrations/0008_managed.py b/authentik/sources/ldap/migrations/0008_managed.py deleted file mode 100644 index 107906e6b..000000000 --- a/authentik/sources/ldap/migrations/0008_managed.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-02 20:51 - -from django.apps.registry import Apps -from django.db import migrations - - -def set_managed_flag(apps: Apps, schema_editor): - LDAPPropertyMapping = apps.get_model("authentik_sources_ldap", "LDAPPropertyMapping") - db_alias = schema_editor.connection.alias - field_to_uid = { - "name": "goauthentik.io/sources/ldap/default-name", - "email": "goauthentik.io/sources/ldap/default-mail", - "username": "goauthentik.io/sources/ldap/ms-samaccountname", - "attributes.upn": "goauthentik.io/sources/ldap/ms-userprincipalname", - "first_name": "goauthentik.io/sources/ldap/ms-givenName", - "last_name": "goauthentik.io/sources/ldap/ms-sn", - } - for mapping in LDAPPropertyMapping.objects.using(db_alias).filter( - name__startswith="Autogenerated " - ): - mapping.managed = field_to_uid.get(mapping.object_field) - mapping.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0017_managed"), - ("authentik_sources_ldap", "0007_ldapsource_sync_users_password"), - ] - - operations = [migrations.RunPython(set_managed_flag)] diff --git a/authentik/sources/ldap/migrations/0009_auto_20210204_1834.py b/authentik/sources/ldap/migrations/0009_auto_20210204_1834.py deleted file mode 100644 index 77718f323..000000000 --- a/authentik/sources/ldap/migrations/0009_auto_20210204_1834.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-04 18:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0008_managed"), - ] - - operations = [ - migrations.RemoveField( - model_name="ldapsource", - name="user_group_membership_field", - ), - migrations.AddField( - model_name="ldapsource", - name="group_membership_field", - field=models.TextField( - default="member", help_text="Field which contains members of a group." - ), - ), - ] diff --git a/authentik/sources/ldap/migrations/0010_auto_20210205_1027.py b/authentik/sources/ldap/migrations/0010_auto_20210205_1027.py deleted file mode 100644 index 4ef47a541..000000000 --- a/authentik/sources/ldap/migrations/0010_auto_20210205_1027.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-05 10:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0009_auto_20210204_1834"), - ] - - operations = [ - migrations.AlterField( - model_name="ldapsource", - name="group_object_filter", - field=models.TextField( - default="(objectClass=group)", - help_text="Consider Objects matching this filter to be Groups.", - ), - ), - migrations.AlterField( - model_name="ldapsource", - name="user_object_filter", - field=models.TextField( - default="(objectClass=person)", - help_text="Consider Objects matching this filter to be Users.", - ), - ), - ] diff --git a/authentik/sources/ldap/migrations/0011_ldapsource_property_mappings_group.py b/authentik/sources/ldap/migrations/0011_ldapsource_property_mappings_group.py deleted file mode 100644 index 6a2c55c21..000000000 --- a/authentik/sources/ldap/migrations/0011_ldapsource_property_mappings_group.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-06 14:01 - -from django.apps.registry import Apps -from django.db import migrations, models - - -def set_default_group_mappings(apps: Apps, schema_editor): - LDAPPropertyMapping = apps.get_model("authentik_sources_ldap", "LDAPPropertyMapping") - LDAPSource = apps.get_model("authentik_sources_ldap", "LDAPSource") - db_alias = schema_editor.connection.alias - - for source in LDAPSource.objects.using(db_alias).all(): - if source.property_mappings_group.exists(): - continue - source.property_mappings_group.set( - LDAPPropertyMapping.objects.using(db_alias).filter( - managed="goauthentik.io/sources/ldap/default-name" - ) - ) - source.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0010_auto_20210205_1027"), - ] - - operations = [ - migrations.AddField( - model_name="ldapsource", - name="property_mappings_group", - field=models.ManyToManyField( - blank=True, - default=None, - help_text="Property mappings used for group creation/updating.", - to="authentik_core.PropertyMapping", - ), - ), - migrations.RunPython(set_default_group_mappings), - ] diff --git a/authentik/sources/ldap/migrations/0012_auto_20210812_1703.py b/authentik/sources/ldap/migrations/0012_auto_20210812_1703.py deleted file mode 100644 index fc440c38e..000000000 --- a/authentik/sources/ldap/migrations/0012_auto_20210812_1703.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.5 on 2021-08-12 17:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_ldap", "0011_ldapsource_property_mappings_group"), - ] - - operations = [ - migrations.AlterField( - model_name="ldapsource", - name="bind_cn", - field=models.TextField(blank=True, verbose_name="Bind CN"), - ), - migrations.AlterField( - model_name="ldapsource", - name="bind_password", - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name="ldapsource", - name="sync_users_password", - field=models.BooleanField( - default=True, - help_text="When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source.", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0001_initial.py b/authentik/sources/saml/migrations/0001_initial.py deleted file mode 100644 index 775d9bb5f..000000000 --- a/authentik/sources/saml/migrations/0001_initial.py +++ /dev/null @@ -1,68 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:08 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_crypto", "0001_initial"), - ("authentik_core", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="SAMLSource", - fields=[ - ( - "source_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_core.Source", - ), - ), - ( - "issuer", - models.TextField( - blank=True, - default=None, - help_text="Also known as Entity ID. Defaults the Metadata URL.", - verbose_name="Issuer", - ), - ), - ("idp_url", models.URLField(verbose_name="IDP URL")), - ( - "idp_logout_url", - models.URLField( - blank=True, - default=None, - null=True, - verbose_name="IDP Logout URL", - ), - ), - ("auto_logout", models.BooleanField(default=False)), - ( - "signing_kp", - models.ForeignKey( - default=None, - help_text="Certificate Key Pair of the IdP which Assertions are validated against.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_crypto.CertificateKeyPair", - ), - ), - ], - options={ - "verbose_name": "SAML Source", - "verbose_name_plural": "SAML Sources", - }, - bases=("authentik_core.source",), - ), - ] diff --git a/authentik/sources/saml/migrations/0002_auto_20200523_2329.py b/authentik/sources/saml/migrations/0002_auto_20200523_2329.py deleted file mode 100644 index b1397f78b..000000000 --- a/authentik/sources/saml/migrations/0002_auto_20200523_2329.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-23 23:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="samlsource", - name="binding_type", - field=models.CharField( - choices=[("REDIRECT", "Redirect"), ("POST", "Post")], - default="REDIRECT", - max_length=100, - ), - ), - migrations.AlterField( - model_name="samlsource", - name="idp_url", - field=models.URLField( - help_text="URL that the initial SAML Request is sent to. Also known as a Binding.", - verbose_name="IDP URL", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0003_auto_20200624_1957.py b/authentik/sources/saml/migrations/0003_auto_20200624_1957.py deleted file mode 100644 index c3f83d5b6..000000000 --- a/authentik/sources/saml/migrations/0003_auto_20200624_1957.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Django 3.0.7 on 2020-06-24 19:57 - -import django.db.models.deletion -from django.db import migrations, models - -import authentik.lib.utils.time - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_sources_saml", "0002_auto_20200523_2329"), - ] - - operations = [ - migrations.RemoveField( - model_name="samlsource", - name="auto_logout", - ), - migrations.RenameField( - model_name="samlsource", - old_name="idp_url", - new_name="sso_url", - ), - migrations.RenameField( - model_name="samlsource", - old_name="idp_logout_url", - new_name="slo_url", - ), - migrations.AddField( - model_name="samlsource", - name="temporary_user_delete_after", - field=models.TextField( - default="days=1", - help_text="Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - verbose_name="Delete temporary users after", - ), - ), - migrations.AlterField( - model_name="samlsource", - name="signing_kp", - field=models.ForeignKey( - help_text="Certificate Key Pair of the IdP which Assertion's Signature is validated against.", - on_delete=django.db.models.deletion.PROTECT, - to="authentik_crypto.CertificateKeyPair", - verbose_name="Signing Keypair", - ), - ), - migrations.AlterField( - model_name="samlsource", - name="slo_url", - field=models.URLField( - blank=True, - default=None, - help_text="Optional URL if your IDP supports Single-Logout.", - null=True, - verbose_name="SLO URL", - ), - ), - migrations.AlterField( - model_name="samlsource", - name="sso_url", - field=models.URLField( - help_text="URL that the initial Login request is sent to.", - verbose_name="SSO URL", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0004_auto_20200708_1207.py b/authentik/sources/saml/migrations/0004_auto_20200708_1207.py deleted file mode 100644 index 836510d84..000000000 --- a/authentik/sources/saml/migrations/0004_auto_20200708_1207.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-08 12:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0003_auto_20200624_1957"), - ] - - operations = [ - migrations.AlterField( - model_name="samlsource", - name="binding_type", - field=models.CharField( - choices=[ - ("REDIRECT", "Redirect Binding"), - ("POST", "POST Binding"), - ("POST_AUTO", "POST Binding with auto-confirmation"), - ], - default="REDIRECT", - max_length=100, - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0005_samlsource_name_id_policy.py b/authentik/sources/saml/migrations/0005_samlsource_name_id_policy.py deleted file mode 100644 index 4269255e3..000000000 --- a/authentik/sources/saml/migrations/0005_samlsource_name_id_policy.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.0.8 on 2020-07-08 13:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0004_auto_20200708_1207"), - ] - - operations = [ - migrations.AddField( - model_name="samlsource", - name="name_id_policy", - field=models.TextField( - choices=[ - ("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", "Email"), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - "Persistent", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName", - "X509", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName", - "Windows", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - "Transient", - ), - ], - default="urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - help_text="NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0006_samlsource_allow_idp_initiated.py b/authentik/sources/saml/migrations/0006_samlsource_allow_idp_initiated.py deleted file mode 100644 index 06aca5877..000000000 --- a/authentik/sources/saml/migrations/0006_samlsource_allow_idp_initiated.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-11 22:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0005_samlsource_name_id_policy"), - ] - - operations = [ - migrations.AddField( - model_name="samlsource", - name="allow_idp_initiated", - field=models.BooleanField( - default=False, - help_text="Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0007_auto_20201112_1055.py b/authentik/sources/saml/migrations/0007_auto_20201112_1055.py deleted file mode 100644 index 0f3ca1a40..000000000 --- a/authentik/sources/saml/migrations/0007_auto_20201112_1055.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-12 10:55 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0002_create_self_signed_kp"), - ("authentik_sources_saml", "0006_samlsource_allow_idp_initiated"), - ] - - operations = [ - migrations.AddField( - model_name="samlsource", - name="digest_algorithm", - field=models.CharField( - choices=[("sha1", "SHA1"), ("sha256", "SHA256")], - default="sha256", - max_length=50, - ), - ), - migrations.AddField( - model_name="samlsource", - name="signature_algorithm", - field=models.CharField( - choices=[ - ("rsa-sha1", "RSA-SHA1"), - ("rsa-sha256", "RSA-SHA256"), - ("ecdsa-sha256", "ECDSA-SHA256"), - ("dsa-sha1", "DSA-SHA1"), - ], - default="rsa-sha256", - max_length=50, - ), - ), - migrations.AlterField( - model_name="samlsource", - name="signing_kp", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Keypair which is used to sign outgoing requests. Leave empty to disable signing.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_crypto.certificatekeypair", - verbose_name="Signing Keypair", - ), - ), - ] diff --git a/authentik/sources/saml/migrations/0008_auto_20201112_2016.py b/authentik/sources/saml/migrations/0008_auto_20201112_2016.py deleted file mode 100644 index dc823e6ae..000000000 --- a/authentik/sources/saml/migrations/0008_auto_20201112_2016.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-12 20:16 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - -from authentik.sources.saml.processors import constants - - -def update_algorithms(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - SAMLSource = apps.get_model("authentik_sources_saml", "SAMLSource") - signature_translation_map = { - "rsa-sha1": constants.RSA_SHA1, - "rsa-sha256": constants.RSA_SHA256, - "ecdsa-sha256": constants.RSA_SHA256, - "dsa-sha1": constants.DSA_SHA1, - } - digest_translation_map = { - "sha1": constants.SHA1, - "sha256": constants.SHA256, - } - - for source in SAMLSource.objects.all(): - source.signature_algorithm = signature_translation_map.get( - source.signature_algorithm, constants.RSA_SHA256 - ) - source.digest_algorithm = digest_translation_map.get( - source.digest_algorithm, constants.SHA256 - ) - source.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0007_auto_20201112_1055"), - ] - - operations = [ - migrations.AlterField( - model_name="samlsource", - name="signature_algorithm", - field=models.CharField( - choices=[ - (constants.RSA_SHA1, "RSA-SHA1"), - (constants.RSA_SHA256, "RSA-SHA256"), - (constants.RSA_SHA384, "RSA-SHA384"), - (constants.RSA_SHA512, "RSA-SHA512"), - (constants.DSA_SHA1, "DSA-SHA1"), - ], - default=constants.RSA_SHA256, - max_length=50, - ), - ), - migrations.AlterField( - model_name="samlsource", - name="digest_algorithm", - field=models.CharField( - choices=[ - (constants.SHA1, "SHA1"), - (constants.SHA256, "SHA256"), - (constants.SHA384, "SHA384"), - (constants.SHA512, "SHA512"), - ], - default=constants.SHA256, - max_length=50, - ), - ), - migrations.RunPython(update_algorithms), - ] diff --git a/authentik/sources/saml/migrations/0009_auto_20210301_0949.py b/authentik/sources/saml/migrations/0009_auto_20210301_0949.py deleted file mode 100644 index b52675c39..000000000 --- a/authentik/sources/saml/migrations/0009_auto_20210301_0949.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.1.7 on 2021-03-01 09:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_sources_saml", "0008_auto_20201112_2016"), - ] - - operations = [ - migrations.AlterField( - model_name="samlsource", - name="name_id_policy", - field=models.TextField( - choices=[ - ("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", "Email"), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - "Persistent", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName", - "X509", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName", - "Windows", - ), - ( - "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", - "Transient", - ), - ], - default="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", - help_text="NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.", - ), - ), - ] diff --git a/authentik/stages/authenticator_sms/migrations/0001_initial.py b/authentik/stages/authenticator_sms/migrations/0001_initial.py deleted file mode 100644 index dc5f3fab8..000000000 --- a/authentik/stages/authenticator_sms/migrations/0001_initial.py +++ /dev/null @@ -1,100 +0,0 @@ -# Generated by Django 3.2.8 on 2021-10-09 19:15 - -import django.db.models.deletion -import django.utils.timezone -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_flows", "0024_alter_flow_compatibility_mode"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatorSMSStage", - fields=[ - ( - "stage_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_flows.stage", - ), - ), - ("provider", models.TextField(choices=[("twilio", "Twilio")])), - ("twilio_account_sid", models.TextField()), - ("twilio_auth", models.TextField()), - ( - "configure_flow", - models.ForeignKey( - blank=True, - help_text="Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_flows.flow", - ), - ), - ], - options={ - "verbose_name": "SMS Authenticator Setup Stage", - "verbose_name_plural": "SMS Authenticator Setup Stages", - }, - bases=("authentik_flows.stage", models.Model), - ), - migrations.CreateModel( - name="SMSDevice", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - ( - "name", - models.CharField( - help_text="The human-readable name of this device.", max_length=64 - ), - ), - ( - "confirmed", - models.BooleanField(default=True, help_text="Is this device ready for use?"), - ), - ("token", models.CharField(blank=True, max_length=16, null=True)), - ( - "valid_until", - models.DateTimeField( - default=django.utils.timezone.now, - help_text="The timestamp of the moment of expiry of the saved token.", - ), - ), - ("phone_number", models.TextField()), - ( - "stage", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="authentik_stages_authenticator_sms.authenticatorsmsstage", - ), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL - ), - ), - ], - options={ - "verbose_name": "SMS Device", - "verbose_name_plural": "SMS Devices", - }, - ), - ] diff --git a/authentik/stages/authenticator_sms/migrations/0002_authenticatorsmsstage_from_number.py b/authentik/stages/authenticator_sms/migrations/0002_authenticatorsmsstage_from_number.py deleted file mode 100644 index 9671cc70d..000000000 --- a/authentik/stages/authenticator_sms/migrations/0002_authenticatorsmsstage_from_number.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.8 on 2021-10-09 20:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_authenticator_sms", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="authenticatorsmsstage", - name="from_number", - field=models.TextField(default=""), - preserve_default=False, - ), - ] diff --git a/authentik/stages/authenticator_sms/migrations/0003_auto_20211014_0813.py b/authentik/stages/authenticator_sms/migrations/0003_auto_20211014_0813.py deleted file mode 100644 index cdb50c21e..000000000 --- a/authentik/stages/authenticator_sms/migrations/0003_auto_20211014_0813.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.2.8 on 2021-10-14 08:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_authenticator_sms", "0002_authenticatorsmsstage_from_number"), - ] - - operations = [ - migrations.RenameField( - model_name="authenticatorsmsstage", - old_name="twilio_account_sid", - new_name="account_sid", - ), - migrations.RenameField( - model_name="authenticatorsmsstage", - old_name="twilio_auth", - new_name="auth", - ), - migrations.AddField( - model_name="authenticatorsmsstage", - name="auth_password", - field=models.TextField(null=True), - ), - migrations.AddField( - model_name="authenticatorsmsstage", - name="auth_type", - field=models.TextField(choices=[("bearer", "Bearer"), ("basic", "Basic")], null=True), - ), - migrations.AlterField( - model_name="authenticatorsmsstage", - name="provider", - field=models.TextField(choices=[("twilio", "Twilio"), ("generic", "Generic")]), - ), - ] diff --git a/authentik/stages/authenticator_sms/migrations/0004_auto_20211014_0936.py b/authentik/stages/authenticator_sms/migrations/0004_auto_20211014_0936.py deleted file mode 100644 index 2dde13cd7..000000000 --- a/authentik/stages/authenticator_sms/migrations/0004_auto_20211014_0936.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.8 on 2021-10-14 09:36 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_authenticator_sms", "0003_auto_20211014_0813"), - ] - - operations = [ - migrations.AlterField( - model_name="authenticatorsmsstage", - name="auth_type", - field=models.TextField( - choices=[("basic", "Basic"), ("bearer", "Bearer")], default="basic" - ), - ), - migrations.AlterField( - model_name="authenticatorsmsstage", - name="auth_password", - field=models.TextField(blank=True, default=""), - ), - ] diff --git a/authentik/stages/identification/migrations/0002_auto_20200530_2204.py b/authentik/stages/identification/migrations/0002_auto_20200530_2204.py deleted file mode 100644 index 7b5c6610e..000000000 --- a/authentik/stages/identification/migrations/0002_auto_20200530_2204.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-30 22:04 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0003_auto_20200523_1133"), - ("authentik_stages_identification", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="enrollment_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Optional enrollment flow, which is linked at the bottom of the page.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_flows.Flow", - ), - ), - migrations.AddField( - model_name="identificationstage", - name="recovery_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Optional enrollment flow, which is linked at the bottom of the page.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_flows.Flow", - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0003_auto_20200615_1641.py b/authentik/stages/identification/migrations/0003_auto_20200615_1641.py deleted file mode 100644 index 4955dc35a..000000000 --- a/authentik/stages/identification/migrations/0003_auto_20200615_1641.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.0.7 on 2020-06-15 16:41 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0007_auto_20200703_2059"), - ("authentik_stages_identification", "0002_auto_20200530_2204"), - ] - - operations = [ - migrations.AlterField( - model_name="identificationstage", - name="recovery_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Optional recovery flow, which is linked at the bottom of the page.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_flows.Flow", - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0004_identificationstage_case_insensitive_matching.py b/authentik/stages/identification/migrations/0004_identificationstage_case_insensitive_matching.py deleted file mode 100644 index aae31537c..000000000 --- a/authentik/stages/identification/migrations/0004_identificationstage_case_insensitive_matching.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.1 on 2020-09-30 21:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_identification", "0003_auto_20200615_1641"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="case_insensitive_matching", - field=models.BooleanField( - default=True, - help_text="When enabled, user fields are matched regardless of their casing.", - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0005_auto_20201003_1734.py b/authentik/stages/identification/migrations/0005_auto_20201003_1734.py deleted file mode 100644 index 30f6d6b7f..000000000 --- a/authentik/stages/identification/migrations/0005_auto_20201003_1734.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.1.2 on 2020-10-03 17:34 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "authentik_stages_identification", - "0004_identificationstage_case_insensitive_matching", - ), - ] - - operations = [ - migrations.AlterField( - model_name="identificationstage", - name="user_fields", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField( - choices=[("email", "E Mail"), ("username", "Username")], - max_length=100, - ), - help_text="Fields of the user object to match against. (Hold shift to select multiple options)", - size=None, - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0006_identificationstage_show_matched_user.py b/authentik/stages/identification/migrations/0006_identificationstage_show_matched_user.py deleted file mode 100644 index 239d1f905..000000000 --- a/authentik/stages/identification/migrations/0006_identificationstage_show_matched_user.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-06 11:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_identification", "0005_auto_20201003_1734"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="show_matched_user", - field=models.BooleanField( - default=True, - help_text="When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown", - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0007_remove_identificationstage_template.py b/authentik/stages/identification/migrations/0007_remove_identificationstage_template.py deleted file mode 100644 index 953ba7919..000000000 --- a/authentik/stages/identification/migrations/0007_remove_identificationstage_template.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-20 22:46 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "authentik_stages_identification", - "0006_identificationstage_show_matched_user", - ), - ] - - operations = [ - migrations.RemoveField( - model_name="identificationstage", - name="template", - ), - ] diff --git a/authentik/stages/identification/migrations/0008_alter_identificationstage_user_fields.py b/authentik/stages/identification/migrations/0008_alter_identificationstage_user_fields.py deleted file mode 100644 index d9a810e2b..000000000 --- a/authentik/stages/identification/migrations/0008_alter_identificationstage_user_fields.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2 on 2021-04-29 22:56 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_identification", "0007_remove_identificationstage_template"), - ] - - operations = [ - migrations.AlterField( - model_name="identificationstage", - name="user_fields", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField( - choices=[("email", "E Mail"), ("username", "Username")], - max_length=100, - ), - blank=True, - help_text="Fields of the user object to match against. (Hold shift to select multiple options)", - size=None, - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0009_identificationstage_sources.py b/authentik/stages/identification/migrations/0009_identificationstage_sources.py deleted file mode 100644 index 39806fea7..000000000 --- a/authentik/stages/identification/migrations/0009_identificationstage_sources.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-25 14:01 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def assign_sources(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - - IdentificationStage = apps.get_model("authentik_stages_identification", "identificationstage") - Source = apps.get_model("authentik_core", "source") - - sources = Source.objects.all() - for stage in IdentificationStage.objects.all().using(db_alias): - stage.sources.set(sources) - stage.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_core", "0021_alter_application_slug"), - ( - "authentik_stages_identification", - "0008_alter_identificationstage_user_fields", - ), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="sources", - field=models.ManyToManyField( - default=list, - help_text="Specify which sources should be shown.", - to="authentik_core.Source", - ), - ), - migrations.RunPython(assign_sources), - ] diff --git a/authentik/stages/identification/migrations/0010_identificationstage_password_stage.py b/authentik/stages/identification/migrations/0010_identificationstage_password_stage.py deleted file mode 100644 index 3ebd17753..000000000 --- a/authentik/stages/identification/migrations/0010_identificationstage_password_stage.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-05 12:30 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_password", "0005_auto_20210402_2221"), - ("authentik_stages_identification", "0009_identificationstage_sources"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="password_stage", - field=models.ForeignKey( - default=None, - help_text="When set, shows a password field, instead of showing the password field as seaprate step.", - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="authentik_stages_password.passwordstage", - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0011_alter_identificationstage_user_fields.py b/authentik/stages/identification/migrations/0011_alter_identificationstage_user_fields.py deleted file mode 100644 index c75020272..000000000 --- a/authentik/stages/identification/migrations/0011_alter_identificationstage_user_fields.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-14 15:32 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_identification", "0010_identificationstage_password_stage"), - ] - - operations = [ - migrations.AlterField( - model_name="identificationstage", - name="user_fields", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField( - choices=[ - ("email", "E Mail"), - ("username", "Username"), - ("upn", "Upn"), - ], - max_length=100, - ), - blank=True, - help_text="Fields of the user object to match against. (Hold shift to select multiple options)", - size=None, - ), - ), - ] diff --git a/authentik/stages/identification/migrations/0012_identificationstage_show_source_labels.py b/authentik/stages/identification/migrations/0012_identificationstage_show_source_labels.py deleted file mode 100644 index 71198c1ea..000000000 --- a/authentik/stages/identification/migrations/0012_identificationstage_show_source_labels.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.8 on 2021-10-31 16:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_identification", "0011_alter_identificationstage_user_fields"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="show_source_labels", - field=models.BooleanField(default=False), - ), - ] diff --git a/authentik/stages/identification/migrations/0013_identificationstage_passwordless_flow.py b/authentik/stages/identification/migrations/0013_identificationstage_passwordless_flow.py deleted file mode 100644 index 6333cbd6d..000000000 --- a/authentik/stages/identification/migrations/0013_identificationstage_passwordless_flow.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.0 on 2021-12-23 17:10 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_flows", "0020_flowtoken"), - ("authentik_stages_identification", "0012_identificationstage_show_source_labels"), - ] - - operations = [ - migrations.AddField( - model_name="identificationstage", - name="passwordless_flow", - field=models.ForeignKey( - blank=True, - default=None, - help_text="Optional passwordless flow, which is linked at the bottom of the page.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - related_name="+", - to="authentik_flows.flow", - ), - ), - ] diff --git a/authentik/stages/invitation/migrations/0001_initial.py b/authentik/stages/invitation/migrations/0001_initial.py deleted file mode 100644 index 162ba81b3..000000000 --- a/authentik/stages/invitation/migrations/0001_initial.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by Django 3.0.6 on 2020-05-19 22:08 - -import uuid - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("authentik_flows", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="InvitationStage", - fields=[ - ( - "stage_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="authentik_flows.Stage", - ), - ), - ( - "continue_flow_without_invitation", - models.BooleanField( - default=False, - help_text="If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By default this Stage will cancel the Flow when no invitation is given.", - ), - ), - ], - options={ - "verbose_name": "Invitation Stage", - "verbose_name_plural": "Invitation Stages", - }, - bases=("authentik_flows.stage",), - ), - migrations.CreateModel( - name="Invitation", - fields=[ - ( - "invite_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("expires", models.DateTimeField(blank=True, default=None, null=True)), - ( - "fixed_data", - models.JSONField(default=dict), - ), - ( - "created_by", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "verbose_name": "Invitation", - "verbose_name_plural": "Invitations", - }, - ), - ] diff --git a/authentik/stages/invitation/migrations/0002_auto_20201225_2143.py b/authentik/stages/invitation/migrations/0002_auto_20201225_2143.py deleted file mode 100644 index fc5fa67b9..000000000 --- a/authentik/stages/invitation/migrations/0002_auto_20201225_2143.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-25 21:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_invitation", "0001_initial"), - ] - - operations = [ - migrations.AlterField( - model_name="invitation", - name="fixed_data", - field=models.JSONField(blank=True, default=dict), - ), - ] diff --git a/authentik/stages/invitation/migrations/0003_auto_20201227_1210.py b/authentik/stages/invitation/migrations/0003_auto_20201227_1210.py deleted file mode 100644 index ea973ed59..000000000 --- a/authentik/stages/invitation/migrations/0003_auto_20201227_1210.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-27 12:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_invitation", "0002_auto_20201225_2143"), - ] - - operations = [ - migrations.AlterField( - model_name="invitation", - name="fixed_data", - field=models.JSONField( - blank=True, - default=dict, - help_text="Optional fixed data to enforce on user enrollment.", - ), - ), - ] diff --git a/authentik/stages/invitation/migrations/0004_invitation_single_use.py b/authentik/stages/invitation/migrations/0004_invitation_single_use.py deleted file mode 100644 index f03d5e699..000000000 --- a/authentik/stages/invitation/migrations/0004_invitation_single_use.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2 on 2021-05-03 07:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_invitation", "0003_auto_20201227_1210"), - ] - - operations = [ - migrations.AddField( - model_name="invitation", - name="single_use", - field=models.BooleanField( - default=False, - help_text="When enabled, the invitation will be deleted after usage.", - ), - ), - ] diff --git a/authentik/stages/invitation/migrations/0005_auto_20210901_1211.py b/authentik/stages/invitation/migrations/0005_auto_20210901_1211.py deleted file mode 100644 index e8ddca3db..000000000 --- a/authentik/stages/invitation/migrations/0005_auto_20210901_1211.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.6 on 2021-09-01 12:11 - -from django.db import migrations, models - -import authentik.core.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_invitation", "0004_invitation_single_use"), - ] - - operations = [ - migrations.AddField( - model_name="invitation", - name="expiring", - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name="invitation", - name="expires", - field=models.DateTimeField(default=authentik.core.models.default_token_duration), - ), - ] diff --git a/authentik/stages/invitation/migrations/0006_invitation_name.py b/authentik/stages/invitation/migrations/0006_invitation_name.py deleted file mode 100644 index abbc66b5a..000000000 --- a/authentik/stages/invitation/migrations/0006_invitation_name.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 4.0.3 on 2022-03-26 17:22 - -from django.apps.registry import Apps -from django.db import migrations, models -from django.db.backends.base.schema import BaseDatabaseSchemaEditor - - -def migrate_add_name(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): - db_alias = schema_editor.connection.alias - - Invitation = apps.get_model("authentik_stages_invitation", "invitation") - - for invite in Invitation.objects.using(db_alias).all(): - invite.name = str(invite.pk) - invite.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_stages_invitation", "0005_auto_20210901_1211"), - ] - - operations = [ - migrations.AddField( - model_name="invitation", - name="name", - field=models.SlugField(default=""), - preserve_default=False, - ), - migrations.RunPython(migrate_add_name), - migrations.AlterField( - model_name="invitation", - name="name", - field=models.SlugField(), - preserve_default=False, - ), - ] diff --git a/authentik/tenants/migrations/0001_initial.py b/authentik/tenants/migrations/0001_initial.py deleted file mode 100644 index 354290149..000000000 --- a/authentik/tenants/migrations/0001_initial.py +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-29 16:10 - -import uuid - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("authentik_flows", "0018_oob_flows"), - ] - - operations = [ - migrations.CreateModel( - name="Tenant", - fields=[ - ( - "tenant_uuid", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "domain", - models.TextField( - help_text="Domain that activates this tenant. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b`" - ), - ), - ("default", models.BooleanField(default=False)), - ("branding_title", models.TextField(default="authentik")), - ( - "branding_logo", - models.TextField(default="/static/dist/assets/icons/icon_left_brand.svg"), - ), - ( - "flow_authentication", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="tenant_authentication", - to="authentik_flows.flow", - ), - ), - ( - "flow_invalidation", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="tenant_invalidation", - to="authentik_flows.flow", - ), - ), - ( - "flow_recovery", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="tenant_recovery", - to="authentik_flows.flow", - ), - ), - ( - "flow_unenrollment", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="tenant_unenrollment", - to="authentik_flows.flow", - ), - ), - ], - options={ - "verbose_name": "Tenant", - "verbose_name_plural": "Tenants", - }, - ), - ] diff --git a/authentik/tenants/migrations/0002_default.py b/authentik/tenants/migrations/0002_default.py deleted file mode 100644 index 10576aba5..000000000 --- a/authentik/tenants/migrations/0002_default.py +++ /dev/null @@ -1,12 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-29 16:55 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_tenants", "0001_initial"), - ] - - operations = [] diff --git a/authentik/tenants/migrations/0002_tenant_flow_user_settings.py b/authentik/tenants/migrations/0002_tenant_flow_user_settings.py index e09dc6cdc..a8eb8fa64 100644 --- a/authentik/tenants/migrations/0002_tenant_flow_user_settings.py +++ b/authentik/tenants/migrations/0002_tenant_flow_user_settings.py @@ -7,7 +7,6 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("authentik_policies_expression", "__latest__"), ("authentik_stages_prompt", "0007_prompt_placeholder_expression"), ("authentik_flows", "0021_auto_20211227_2103"), ("authentik_tenants", "0001_squashed_0005_tenant_web_certificate"), diff --git a/authentik/tenants/migrations/0003_tenant_branding_favicon.py b/authentik/tenants/migrations/0003_tenant_branding_favicon.py deleted file mode 100644 index 590353d18..000000000 --- a/authentik/tenants/migrations/0003_tenant_branding_favicon.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-02 19:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_tenants", "0002_default"), - ] - - operations = [ - migrations.AddField( - model_name="tenant", - name="branding_favicon", - field=models.TextField(default="/static/dist/assets/icons/icon.png"), - ), - ] diff --git a/authentik/tenants/migrations/0004_tenant_event_retention.py b/authentik/tenants/migrations/0004_tenant_event_retention.py deleted file mode 100644 index 751528e7f..000000000 --- a/authentik/tenants/migrations/0004_tenant_event_retention.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.5 on 2021-07-24 17:06 - -from django.db import migrations, models - -import authentik.lib.utils.time - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_tenants", "0003_tenant_branding_favicon"), - ] - - operations = [ - migrations.AddField( - model_name="tenant", - name="event_retention", - field=models.TextField( - default="days=365", - help_text="Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2).", - validators=[authentik.lib.utils.time.timedelta_string_validator], - ), - ), - ] diff --git a/authentik/tenants/migrations/0005_tenant_web_certificate.py b/authentik/tenants/migrations/0005_tenant_web_certificate.py deleted file mode 100644 index 14c247d55..000000000 --- a/authentik/tenants/migrations/0005_tenant_web_certificate.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 4.0 on 2021-12-22 09:42 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("authentik_crypto", "0003_certificatekeypair_managed"), - ("authentik_tenants", "0004_tenant_event_retention"), - ] - - operations = [ - migrations.AddField( - model_name="tenant", - name="web_certificate", - field=models.ForeignKey( - default=None, - help_text="Web Certificate used by the authentik Core webserver.", - null=True, - on_delete=django.db.models.deletion.SET_DEFAULT, - to="authentik_crypto.certificatekeypair", - ), - ), - ] diff --git a/website/docs/releases/v2022.10.md b/website/docs/releases/v2022.10.md index 63b126393..d74380b2d 100644 --- a/website/docs/releases/v2022.10.md +++ b/website/docs/releases/v2022.10.md @@ -5,6 +5,7 @@ slug: "2022.10" ## Breaking changes +- This version removes old migrations that have been replaced by squashed versions in previous versions. As such it is only possible to upgrade to this version from **2022.1** or later. - Several challenge components have been renamed to better match the rest of the challenges - The SAML Source has been updated to use connection objects instead of directly creating users.