-
-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into web/flow/disambiguate-brand-links
* main: (23 commits) website/docs: update info about footer links to match new UI (#12120) website/docs: prepare release notes (#12142) providers/oauth2: fix migration (#12138) providers/oauth2: fix migration dependencies (#12123) web: bump API Client version (#12129) providers/oauth2: fix redirect uri input (#12122) providers/proxy: fix redirect_uri (#12121) website/docs: prepare release notes (#12119) web: bump API Client version (#12118) security: fix CVE 2024 52289 (#12113) security: fix CVE 2024 52307 (#12115) security: fix CVE 2024 52287 (#12114) website/docs: add CSP to hardening (#11970) core: bump uvicorn from 0.32.0 to 0.32.1 (#12103) core: bump google-api-python-client from 2.153.0 to 2.154.0 (#12104) core: bump pydantic from 2.9.2 to 2.10.0 (#12105) translate: Updates for file locale/en/LC_MESSAGES/django.po in it (#12110) internal: add CSP header to files in `/media` (#12092) core, web: update translations (#12101) web: fix bug that prevented error reporting in current wizard. (#12033) ...
- Loading branch information
Showing
81 changed files
with
1,381 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
authentik/providers/oauth2/migrations/0024_remove_oauth2provider_redirect_uris_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Generated by Django 5.0.9 on 2024-11-04 12:56 | ||
from dataclasses import asdict | ||
from django.apps.registry import Apps | ||
|
||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def migrate_redirect_uris(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): | ||
from authentik.providers.oauth2.models import RedirectURI, RedirectURIMatchingMode | ||
|
||
OAuth2Provider = apps.get_model("authentik_providers_oauth2", "oauth2provider") | ||
|
||
db_alias = schema_editor.connection.alias | ||
for provider in OAuth2Provider.objects.using(db_alias).all(): | ||
uris = [] | ||
for old in provider.old_redirect_uris.split("\n"): | ||
mode = RedirectURIMatchingMode.STRICT | ||
if old == "*" or old == ".*": | ||
mode = RedirectURIMatchingMode.REGEX | ||
uris.append(asdict(RedirectURI(mode, url=old))) | ||
provider._redirect_uris = uris | ||
provider.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("authentik_providers_oauth2", "0023_alter_accesstoken_refreshtoken_use_hash_index"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="oauth2provider", | ||
old_name="redirect_uris", | ||
new_name="old_redirect_uris", | ||
), | ||
migrations.AddField( | ||
model_name="oauth2provider", | ||
name="_redirect_uris", | ||
field=models.JSONField(default=dict, verbose_name="Redirect URIs"), | ||
), | ||
migrations.RunPython(migrate_redirect_uris, lambda *args: ...), | ||
migrations.RemoveField( | ||
model_name="oauth2provider", | ||
name="old_redirect_uris", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.