From 3f607ee2c89735064255aeb3760cfcf5760647c8 Mon Sep 17 00:00:00 2001 From: Jens L Date: Wed, 3 May 2023 18:16:16 +0300 Subject: [PATCH] policies: make policy engine modes consistent with database values (#5462) * policies: make policy engine modes consistent with database values Signed-off-by: Jens Langhammer * fix in ui Signed-off-by: Jens Langhammer * fix missing case Signed-off-by: Jens Langhammer --------- Signed-off-by: Jens Langhammer --- ...7_policybindingmodel_policy_engine_mode.py | 8 +- authentik/policies/models.py | 4 +- locale/en/LC_MESSAGES/django.po | 45 +- schema.yml | 46 +- web/src/admin/applications/ApplicationForm.ts | 4 +- web/src/admin/flows/FlowForm.ts | 4 +- web/src/admin/flows/StageBindingForm.ts | 4 +- .../sources/oauth/OAuthSourceViewPage.ts | 2 + web/src/locales/de.po | 17 + web/src/locales/en.po | 17 + web/src/locales/es.po | 17 + web/src/locales/fr_FR.po | 17 + web/src/locales/pl.po | 17 + web/src/locales/pseudo-LOCALE.po | 17 + web/src/locales/tr.po | 17 + web/src/locales/zh-Hans.po | 1780 +++++++---------- web/src/locales/zh-Hant.po | 17 + web/src/locales/zh_TW.po | 17 + 18 files changed, 992 insertions(+), 1058 deletions(-) diff --git a/authentik/policies/migrations/0007_policybindingmodel_policy_engine_mode.py b/authentik/policies/migrations/0007_policybindingmodel_policy_engine_mode.py index 97803c4e0..2c4ca23b5 100644 --- a/authentik/policies/migrations/0007_policybindingmodel_policy_engine_mode.py +++ b/authentik/policies/migrations/0007_policybindingmodel_policy_engine_mode.py @@ -15,8 +15,8 @@ class Migration(migrations.Migration): name="policy_engine_mode", field=models.TextField( choices=[ - ("all", "ALL, all policies must pass"), - ("any", "ANY, any policy must pass"), + ("all", "all, all policies must pass"), + ("any", "any, any policy must pass"), ], default="all", ), @@ -27,8 +27,8 @@ class Migration(migrations.Migration): name="policy_engine_mode", field=models.TextField( choices=[ - ("all", "ALL, all policies must pass"), - ("any", "ANY, any policy must pass"), + ("all", "all, all policies must pass"), + ("any", "any, any policy must pass"), ], default="any", ), diff --git a/authentik/policies/models.py b/authentik/policies/models.py index f47075ffe..0eb353206 100644 --- a/authentik/policies/models.py +++ b/authentik/policies/models.py @@ -19,8 +19,8 @@ from authentik.policies.types import PolicyRequest, PolicyResult class PolicyEngineMode(models.TextChoices): """Decide how results of multiple policies should be combined.""" - MODE_ALL = "all", _("ALL, all policies must pass") # type: "PolicyEngineMode" - MODE_ANY = "any", _("ANY, any policy must pass") # type: "PolicyEngineMode" + MODE_ALL = "all", _("all, all policies must pass") # type: "PolicyEngineMode" + MODE_ANY = "any", _("any, any policy must pass") # type: "PolicyEngineMode" class PolicyBindingModel(models.Model): diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index d1951692c..9b853b089 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-28 09:19+0000\n" +"POT-Creation-Date: 2023-05-03 14:41+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,11 +31,12 @@ msgstr "" msgid "Validation Error" msgstr "" -#: authentik/blueprints/api.py:52 -msgid "Failed to validate blueprint" +#: authentik/blueprints/api.py:53 +#, python-format +msgid "Failed to validate blueprint: %(logs)s" msgstr "" -#: authentik/blueprints/api.py:57 +#: authentik/blueprints/api.py:58 msgid "Either path or content must be set." msgstr "" @@ -703,11 +704,11 @@ msgid "Expression Policies" msgstr "" #: authentik/policies/models.py:22 -msgid "ALL, all policies must pass" +msgid "all, all policies must pass" msgstr "" #: authentik/policies/models.py:23 -msgid "ANY, any policy must pass" +msgid "any, any policy must pass" msgstr "" #: authentik/policies/models.py:46 @@ -1385,7 +1386,7 @@ msgstr "" msgid "Failed to sync user due to remote error %(name)s: %(error)s" msgstr "" -#: authentik/providers/scim/tasks.py:122 +#: authentik/providers/scim/tasks.py:123 #, python-format msgid "Failed to sync group due to remote error %(name)s: %(error)s" msgstr "" @@ -1580,50 +1581,58 @@ msgid "Discord OAuth Sources" msgstr "" #: authentik/sources/oauth/models.py:171 -msgid "Google OAuth Source" +msgid "Patreon OAuth Source" msgstr "" #: authentik/sources/oauth/models.py:172 -msgid "Google OAuth Sources" +msgid "Patreon OAuth Sources" msgstr "" #: authentik/sources/oauth/models.py:180 -msgid "Azure AD OAuth Source" +msgid "Google OAuth Source" msgstr "" #: authentik/sources/oauth/models.py:181 -msgid "Azure AD OAuth Sources" +msgid "Google OAuth Sources" msgstr "" #: authentik/sources/oauth/models.py:189 -msgid "OpenID OAuth Source" +msgid "Azure AD OAuth Source" msgstr "" #: authentik/sources/oauth/models.py:190 -msgid "OpenID OAuth Sources" +msgid "Azure AD OAuth Sources" msgstr "" #: authentik/sources/oauth/models.py:198 -msgid "Apple OAuth Source" +msgid "OpenID OAuth Source" msgstr "" #: authentik/sources/oauth/models.py:199 -msgid "Apple OAuth Sources" +msgid "OpenID OAuth Sources" msgstr "" #: authentik/sources/oauth/models.py:207 -msgid "Okta OAuth Source" +msgid "Apple OAuth Source" msgstr "" #: authentik/sources/oauth/models.py:208 +msgid "Apple OAuth Sources" +msgstr "" + +#: authentik/sources/oauth/models.py:216 +msgid "Okta OAuth Source" +msgstr "" + +#: authentik/sources/oauth/models.py:217 msgid "Okta OAuth Sources" msgstr "" -#: authentik/sources/oauth/models.py:230 +#: authentik/sources/oauth/models.py:239 msgid "User OAuth Source Connection" msgstr "" -#: authentik/sources/oauth/models.py:231 +#: authentik/sources/oauth/models.py:240 msgid "User OAuth Source Connections" msgstr "" diff --git a/schema.yml b/schema.yml index fdc7e7fa2..89f06dda7 100644 --- a/schema.yml +++ b/schema.yml @@ -6806,11 +6806,11 @@ paths: - all - any description: |- - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - in: query name: re_evaluate_policies schema: @@ -17552,11 +17552,11 @@ paths: - all - any description: |- - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - in: query name: profile_url schema: @@ -17921,11 +17921,11 @@ paths: - all - any description: |- - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - name: search required: false in: query @@ -18358,11 +18358,11 @@ paths: - all - any description: |- - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass - in: query name: pre_authentication_flow schema: @@ -37980,8 +37980,8 @@ components: - any type: string description: |- - * `all` - ALL, all policies must pass - * `any` - ANY, any policy must pass + * `all` - all, all policies must pass + * `any` - any, any policy must pass PolicyRequest: type: object description: Policy Serializer @@ -38441,12 +38441,13 @@ components: - facebook - github - google + - mailcow - openidconnect - okta + - patreon - reddit - - twitter - - mailcow - twitch + - twitter type: string description: |- * `apple` - Apple @@ -38455,12 +38456,13 @@ components: * `facebook` - Facebook * `github` - GitHub * `google` - Google + * `mailcow` - Mailcow * `openidconnect` - OpenID Connect * `okta` - Okta + * `patreon` - Patreon * `reddit` - reddit - * `twitter` - Twitter - * `mailcow` - Mailcow * `twitch` - Twitch + * `twitter` - Twitter ProxyMode: enum: - proxy diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts index 0842f46ee..233c70d12 100644 --- a/web/src/admin/applications/ApplicationForm.ts +++ b/web/src/admin/applications/ApplicationForm.ts @@ -151,13 +151,13 @@ export class ApplicationForm extends ModelForm { { {