authentik.providers.oauth2.migrations.0016_alter_refreshtoken_token

 1# Generated by Django 4.1.7 on 2023-05-06 16:18
 2
 3from django.db import migrations, models
 4
 5import authentik.providers.oauth2.models
 6
 7
 8class Migration(migrations.Migration):
 9    dependencies = [
10        (
11            "authentik_providers_oauth2",
12            "0015_accesstoken_auth_time_authorizationcode_auth_time_and_more",
13        ),
14    ]
15
16    operations = [
17        migrations.AlterField(
18            model_name="refreshtoken",
19            name="token",
20            field=models.TextField(
21                default=authentik.providers.oauth2.models.generate_client_secret
22            ),
23        ),
24        migrations.AlterField(
25            model_name="oauth2provider",
26            name="sub_mode",
27            field=models.TextField(
28                choices=[
29                    ("hashed_user_id", "Based on the Hashed User ID"),
30                    ("user_id", "Based on user ID"),
31                    ("user_uuid", "Based on user UUID"),
32                    ("user_username", "Based on the username"),
33                    (
34                        "user_email",
35                        "Based on the User's Email. This is recommended over the UPN method.",
36                    ),
37                    (
38                        "user_upn",
39                        "Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.",
40                    ),
41                ],
42                default="hashed_user_id",
43                help_text="Configure what data should be used as unique User Identifier. For most cases, the default should be fine.",
44            ),
45        ),
46    ]
class Migration(django.db.migrations.migration.Migration):
 9class Migration(migrations.Migration):
10    dependencies = [
11        (
12            "authentik_providers_oauth2",
13            "0015_accesstoken_auth_time_authorizationcode_auth_time_and_more",
14        ),
15    ]
16
17    operations = [
18        migrations.AlterField(
19            model_name="refreshtoken",
20            name="token",
21            field=models.TextField(
22                default=authentik.providers.oauth2.models.generate_client_secret
23            ),
24        ),
25        migrations.AlterField(
26            model_name="oauth2provider",
27            name="sub_mode",
28            field=models.TextField(
29                choices=[
30                    ("hashed_user_id", "Based on the Hashed User ID"),
31                    ("user_id", "Based on user ID"),
32                    ("user_uuid", "Based on user UUID"),
33                    ("user_username", "Based on the username"),
34                    (
35                        "user_email",
36                        "Based on the User's Email. This is recommended over the UPN method.",
37                    ),
38                    (
39                        "user_upn",
40                        "Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.",
41                    ),
42                ],
43                default="hashed_user_id",
44                help_text="Configure what data should be used as unique User Identifier. For most cases, the default should be fine.",
45            ),
46        ),
47    ]

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', '0015_accesstoken_auth_time_authorizationcode_auth_time_and_more')]
operations = [<AlterField model_name='refreshtoken', name='token', field=<django.db.models.fields.TextField>>, <AlterField model_name='oauth2provider', name='sub_mode', field=<django.db.models.fields.TextField>>]