authentik.providers.oauth2.migrations.0035_oauth2providerjwtfederationprovider_and_more

  1# Generated by Django 5.2.15 on 2026-06-23 15:35
  2
  3import django.db.models.deletion
  4from django.db import migrations, models
  5
  6
  7class Migration(migrations.Migration):
  8
  9    dependencies = [
 10        (
 11            "authentik_providers_oauth2",
 12            "0034_authorizationcode_dpop_jkt_devicetoken_dpop_jkt_and_more",
 13        ),
 14        ("authentik_sources_oauth", "0014_migrate_azuread_to_entraid"),
 15    ]
 16
 17    operations = [
 18        migrations.SeparateDatabaseAndState(
 19            database_operations=[],
 20            state_operations=[
 21                migrations.CreateModel(
 22                    name="OAuth2ProviderJWTFederationSource",
 23                    fields=[
 24                        (
 25                            "id",
 26                            models.AutoField(
 27                                auto_created=True,
 28                                primary_key=True,
 29                                serialize=False,
 30                                verbose_name="ID",
 31                            ),
 32                        ),
 33                        (
 34                            "oauth_source",
 35                            models.ForeignKey(
 36                                db_column="oauthsource_id",
 37                                on_delete=django.db.models.deletion.CASCADE,
 38                                to="authentik_sources_oauth.oauthsource",
 39                            ),
 40                        ),
 41                        (
 42                            "oauth2_provider",
 43                            models.ForeignKey(
 44                                db_column="oauth2provider_id",
 45                                on_delete=django.db.models.deletion.CASCADE,
 46                                to="authentik_providers_oauth2.oauth2provider",
 47                            ),
 48                        ),
 49                    ],
 50                    options={
 51                        "db_table": "authentik_providers_oauth2_oauth2provider_jwt_federation_so2b48",
 52                        "unique_together": {("oauth2_provider", "oauth_source")},
 53                        "verbose_name": "OAuth2 Provider JWT Federation Source",
 54                        "verbose_name_plural": "OAuth2 Provider JWT Federation Sources",
 55                    },
 56                ),
 57                migrations.AlterField(
 58                    model_name="oauth2provider",
 59                    name="jwt_federation_sources",
 60                    field=models.ManyToManyField(
 61                        blank=True,
 62                        default=None,
 63                        related_name="oauth2_providers",
 64                        through="authentik_providers_oauth2.OAuth2ProviderJWTFederationSource",
 65                        to="authentik_sources_oauth.oauthsource",
 66                        verbose_name="Any JWT signed by the JWK of the selected source can be used to authenticate.",
 67                    ),
 68                ),
 69            ],
 70        ),
 71        migrations.SeparateDatabaseAndState(
 72            database_operations=[],
 73            state_operations=[
 74                migrations.CreateModel(
 75                    name="OAuth2ProviderJWTFederationProvider",
 76                    fields=[
 77                        (
 78                            "id",
 79                            models.AutoField(
 80                                auto_created=True,
 81                                primary_key=True,
 82                                serialize=False,
 83                                verbose_name="ID",
 84                            ),
 85                        ),
 86                        (
 87                            "jwt_federation_provider",
 88                            models.ForeignKey(
 89                                db_column="to_oauth2provider_id",
 90                                on_delete=django.db.models.deletion.CASCADE,
 91                                related_name="oauth2_provider_m2m_objects",
 92                                to="authentik_providers_oauth2.oauth2provider",
 93                            ),
 94                        ),
 95                        (
 96                            "oauth2_provider",
 97                            models.ForeignKey(
 98                                db_column="from_oauth2provider_id",
 99                                on_delete=django.db.models.deletion.CASCADE,
100                                related_name="jwt_federation_provider_m2m_objects",
101                                to="authentik_providers_oauth2.oauth2provider",
102                            ),
103                        ),
104                    ],
105                    options={
106                        "db_table": "authentik_providers_oauth2_oauth2provider_jwt_federation_pr9002",
107                        "unique_together": {("oauth2_provider", "jwt_federation_provider")},
108                        "verbose_name": "OAuth2 Provider JWT Federation Provider",
109                        "verbose_name_plural": "OAuth2 Provider JWT Federation Providers",
110                    },
111                ),
112                migrations.AlterField(
113                    model_name="oauth2provider",
114                    name="jwt_federation_providers",
115                    field=models.ManyToManyField(
116                        blank=True,
117                        default=None,
118                        through="authentik_providers_oauth2.OAuth2ProviderJWTFederationProvider",
119                        to="authentik_providers_oauth2.oauth2provider",
120                    ),
121                ),
122            ],
123        ),
124    ]
class Migration(django.db.migrations.migration.Migration):
  8class Migration(migrations.Migration):
  9
 10    dependencies = [
 11        (
 12            "authentik_providers_oauth2",
 13            "0034_authorizationcode_dpop_jkt_devicetoken_dpop_jkt_and_more",
 14        ),
 15        ("authentik_sources_oauth", "0014_migrate_azuread_to_entraid"),
 16    ]
 17
 18    operations = [
 19        migrations.SeparateDatabaseAndState(
 20            database_operations=[],
 21            state_operations=[
 22                migrations.CreateModel(
 23                    name="OAuth2ProviderJWTFederationSource",
 24                    fields=[
 25                        (
 26                            "id",
 27                            models.AutoField(
 28                                auto_created=True,
 29                                primary_key=True,
 30                                serialize=False,
 31                                verbose_name="ID",
 32                            ),
 33                        ),
 34                        (
 35                            "oauth_source",
 36                            models.ForeignKey(
 37                                db_column="oauthsource_id",
 38                                on_delete=django.db.models.deletion.CASCADE,
 39                                to="authentik_sources_oauth.oauthsource",
 40                            ),
 41                        ),
 42                        (
 43                            "oauth2_provider",
 44                            models.ForeignKey(
 45                                db_column="oauth2provider_id",
 46                                on_delete=django.db.models.deletion.CASCADE,
 47                                to="authentik_providers_oauth2.oauth2provider",
 48                            ),
 49                        ),
 50                    ],
 51                    options={
 52                        "db_table": "authentik_providers_oauth2_oauth2provider_jwt_federation_so2b48",
 53                        "unique_together": {("oauth2_provider", "oauth_source")},
 54                        "verbose_name": "OAuth2 Provider JWT Federation Source",
 55                        "verbose_name_plural": "OAuth2 Provider JWT Federation Sources",
 56                    },
 57                ),
 58                migrations.AlterField(
 59                    model_name="oauth2provider",
 60                    name="jwt_federation_sources",
 61                    field=models.ManyToManyField(
 62                        blank=True,
 63                        default=None,
 64                        related_name="oauth2_providers",
 65                        through="authentik_providers_oauth2.OAuth2ProviderJWTFederationSource",
 66                        to="authentik_sources_oauth.oauthsource",
 67                        verbose_name="Any JWT signed by the JWK of the selected source can be used to authenticate.",
 68                    ),
 69                ),
 70            ],
 71        ),
 72        migrations.SeparateDatabaseAndState(
 73            database_operations=[],
 74            state_operations=[
 75                migrations.CreateModel(
 76                    name="OAuth2ProviderJWTFederationProvider",
 77                    fields=[
 78                        (
 79                            "id",
 80                            models.AutoField(
 81                                auto_created=True,
 82                                primary_key=True,
 83                                serialize=False,
 84                                verbose_name="ID",
 85                            ),
 86                        ),
 87                        (
 88                            "jwt_federation_provider",
 89                            models.ForeignKey(
 90                                db_column="to_oauth2provider_id",
 91                                on_delete=django.db.models.deletion.CASCADE,
 92                                related_name="oauth2_provider_m2m_objects",
 93                                to="authentik_providers_oauth2.oauth2provider",
 94                            ),
 95                        ),
 96                        (
 97                            "oauth2_provider",
 98                            models.ForeignKey(
 99                                db_column="from_oauth2provider_id",
100                                on_delete=django.db.models.deletion.CASCADE,
101                                related_name="jwt_federation_provider_m2m_objects",
102                                to="authentik_providers_oauth2.oauth2provider",
103                            ),
104                        ),
105                    ],
106                    options={
107                        "db_table": "authentik_providers_oauth2_oauth2provider_jwt_federation_pr9002",
108                        "unique_together": {("oauth2_provider", "jwt_federation_provider")},
109                        "verbose_name": "OAuth2 Provider JWT Federation Provider",
110                        "verbose_name_plural": "OAuth2 Provider JWT Federation Providers",
111                    },
112                ),
113                migrations.AlterField(
114                    model_name="oauth2provider",
115                    name="jwt_federation_providers",
116                    field=models.ManyToManyField(
117                        blank=True,
118                        default=None,
119                        through="authentik_providers_oauth2.OAuth2ProviderJWTFederationProvider",
120                        to="authentik_providers_oauth2.oauth2provider",
121                    ),
122                ),
123            ],
124        ),
125    ]

The base class for all migrations.

Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following attributes:

  • operations: A list of Operation instances, probably from django.db.migrations.operations
  • dependencies: A list of tuples of (app_path, migration_name)
  • run_before: A list of tuples of (app_path, migration_name)
  • replaces: A list of migration_names

Note that all migrations come out of migrations and into the Loader or Graph as instances, having been initialized with their app label and name.

dependencies = [('authentik_providers_oauth2', '0034_authorizationcode_dpop_jkt_devicetoken_dpop_jkt_and_more'), ('authentik_sources_oauth', '0014_migrate_azuread_to_entraid')]
operations = [<SeparateDatabaseAndState database_operations=[], state_operations=[<CreateModel name='OAuth2ProviderJWTFederationSource', fields=[('id', <django.db.models.fields.AutoField>), ('oauth_source', <django.db.models.fields.related.ForeignKey>), ('oauth2_provider', <django.db.models.fields.related.ForeignKey>)], options={'db_table': 'authentik_providers_oauth2_oauth2provider_jwt_federation_so2b48', 'unique_together': {('oauth2_provider', 'oauth_source')}, 'verbose_name': 'OAuth2 Provider JWT Federation Source', 'verbose_name_plural': 'OAuth2 Provider JWT Federation Sources'}>, <AlterField model_name='oauth2provider', name='jwt_federation_sources', field=<django.db.models.fields.related.ManyToManyField>>]>, <SeparateDatabaseAndState database_operations=[], state_operations=[<CreateModel name='OAuth2ProviderJWTFederationProvider', fields=[('id', <django.db.models.fields.AutoField>), ('jwt_federation_provider', <django.db.models.fields.related.ForeignKey>), ('oauth2_provider', <django.db.models.fields.related.ForeignKey>)], options={'db_table': 'authentik_providers_oauth2_oauth2provider_jwt_federation_pr9002', 'unique_together': {('oauth2_provider', 'jwt_federation_provider')}, 'verbose_name': 'OAuth2 Provider JWT Federation Provider', 'verbose_name_plural': 'OAuth2 Provider JWT Federation Providers'}>, <AlterField model_name='oauth2provider', name='jwt_federation_providers', field=<django.db.models.fields.related.ManyToManyField>>]>]