From bc39320f8637b5ff8e4012fb7880397dcc5990fa Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 25 May 2021 09:48:45 +0200 Subject: [PATCH] tests/e2e: fix flow titles not being set Signed-off-by: Jens Langhammer --- tests/e2e/test_flows_authenticators.py | 3 ++ tests/e2e/test_flows_enroll.py | 2 ++ tests/e2e/test_flows_login.py | 1 + tests/e2e/test_flows_stage_setup.py | 1 + tests/e2e/test_provider_oauth2_github.py | 3 ++ tests/e2e/test_provider_oauth2_grafana.py | 5 +++ tests/e2e/test_provider_oauth2_oidc.py | 4 +++ .../e2e/test_provider_oauth2_oidc_implicit.py | 4 +++ tests/e2e/test_provider_proxy.py | 2 ++ tests/e2e/test_provider_saml.py | 4 +++ tests/e2e/test_source_oauth.py | 4 +++ tests/e2e/test_source_saml.py | 3 ++ web/src/flows/FlowExecutor.ts | 32 +++++++++---------- .../pages/user-settings/UserSettingsPage.ts | 2 +- 14 files changed, 53 insertions(+), 17 deletions(-) diff --git a/tests/e2e/test_flows_authenticators.py b/tests/e2e/test_flows_authenticators.py index a6c485c4a..6b62cdd8f 100644 --- a/tests/e2e/test_flows_authenticators.py +++ b/tests/e2e/test_flows_authenticators.py @@ -27,6 +27,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") def test_totp_validate(self): """test flow with otp stages""" sleep(1) @@ -65,6 +66,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_stages_authenticator_totp", "0006_default_setup_flow") def test_totp_setup(self): """test TOTP Setup stage""" @@ -115,6 +117,7 @@ class TestFlowsAuthenticator(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_stages_authenticator_static", "0005_default_setup_flow") def test_static_setup(self): """test Static OTP Setup stage""" diff --git a/tests/e2e/test_flows_enroll.py b/tests/e2e/test_flows_enroll.py index 2a9bef063..e1dee33bc 100644 --- a/tests/e2e/test_flows_enroll.py +++ b/tests/e2e/test_flows_enroll.py @@ -40,6 +40,7 @@ class TestFlowsEnroll(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") def test_enroll_2_step(self): """Test 2-step enroll flow""" # First stage fields @@ -108,6 +109,7 @@ class TestFlowsEnroll(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @override_settings(EMAIL_BACKEND="django.core.mail.backends.smtp.EmailBackend") def test_enroll_email(self): """Test enroll with Email verification""" diff --git a/tests/e2e/test_flows_login.py b/tests/e2e/test_flows_login.py index 2e663a179..5659e40b2 100644 --- a/tests/e2e/test_flows_login.py +++ b/tests/e2e/test_flows_login.py @@ -12,6 +12,7 @@ class TestFlowsLogin(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") def test_login(self): """test default login flow""" self.driver.get( diff --git a/tests/e2e/test_flows_stage_setup.py b/tests/e2e/test_flows_stage_setup.py index 43e5efa9e..7e2ccab44 100644 --- a/tests/e2e/test_flows_stage_setup.py +++ b/tests/e2e/test_flows_stage_setup.py @@ -19,6 +19,7 @@ class TestFlowsStageSetup(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_stages_password", "0002_passwordstage_change_flow") def test_password_change(self): """test password change flow""" diff --git a/tests/e2e/test_provider_oauth2_github.py b/tests/e2e/test_provider_oauth2_github.py index 827395b9c..17b7caaf5 100644 --- a/tests/e2e/test_provider_oauth2_github.py +++ b/tests/e2e/test_provider_oauth2_github.py @@ -63,6 +63,7 @@ class TestProviderOAuth2Github(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_authorization_consent_implied(self): @@ -117,6 +118,7 @@ class TestProviderOAuth2Github(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_authorization_consent_explicit(self): @@ -194,6 +196,7 @@ class TestProviderOAuth2Github(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_denied(self): diff --git a/tests/e2e/test_provider_oauth2_grafana.py b/tests/e2e/test_provider_oauth2_grafana.py index ee6a0af0b..ef1b1d767 100644 --- a/tests/e2e/test_provider_oauth2_grafana.py +++ b/tests/e2e/test_provider_oauth2_grafana.py @@ -83,6 +83,7 @@ class TestProviderOAuth2OAuth(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_redirect_uri_error(self): @@ -124,6 +125,7 @@ class TestProviderOAuth2OAuth(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -186,6 +188,7 @@ class TestProviderOAuth2OAuth(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -256,6 +259,7 @@ class TestProviderOAuth2OAuth(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -337,6 +341,7 @@ class TestProviderOAuth2OAuth(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_authorization_denied(self): diff --git a/tests/e2e/test_provider_oauth2_oidc.py b/tests/e2e/test_provider_oauth2_oidc.py index 5aa5f9845..90140a0e8 100644 --- a/tests/e2e/test_provider_oauth2_oidc.py +++ b/tests/e2e/test_provider_oauth2_oidc.py @@ -78,6 +78,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_redirect_uri_error(self): @@ -119,6 +120,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -168,6 +170,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -234,6 +237,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_authorization_denied(self): diff --git a/tests/e2e/test_provider_oauth2_oidc_implicit.py b/tests/e2e/test_provider_oauth2_oidc_implicit.py index 27dce41fe..7596a2700 100644 --- a/tests/e2e/test_provider_oauth2_oidc_implicit.py +++ b/tests/e2e/test_provider_oauth2_oidc_implicit.py @@ -78,6 +78,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_redirect_uri_error(self): @@ -119,6 +120,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -165,6 +167,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -228,6 +231,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") def test_authorization_denied(self): diff --git a/tests/e2e/test_provider_proxy.py b/tests/e2e/test_provider_proxy.py index cdae54b66..48658c5fd 100644 --- a/tests/e2e/test_provider_proxy.py +++ b/tests/e2e/test_provider_proxy.py @@ -60,6 +60,7 @@ class TestProviderProxy(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -112,6 +113,7 @@ class TestProviderProxyConnect(ChannelsLiveServerTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager diff --git a/tests/e2e/test_provider_saml.py b/tests/e2e/test_provider_saml.py index b05c5439c..cc49e693b 100644 --- a/tests/e2e/test_provider_saml.py +++ b/tests/e2e/test_provider_saml.py @@ -74,6 +74,7 @@ class TestProviderSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -138,6 +139,7 @@ class TestProviderSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -219,6 +221,7 @@ class TestProviderSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -289,6 +292,7 @@ class TestProviderSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0010_provider_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager diff --git a/tests/e2e/test_source_oauth.py b/tests/e2e/test_source_oauth.py index a26d9c368..3f6ea6114 100644 --- a/tests/e2e/test_source_oauth.py +++ b/tests/e2e/test_source_oauth.py @@ -131,6 +131,7 @@ class TestSourceOAuth2(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -188,6 +189,7 @@ class TestSourceOAuth2(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -228,6 +230,7 @@ class TestSourceOAuth2(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @object_manager @@ -318,6 +321,7 @@ class TestSourceOAuth1(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @patch( diff --git a/tests/e2e/test_source_saml.py b/tests/e2e/test_source_saml.py index 7a409c484..5673e4dde 100644 --- a/tests/e2e/test_source_saml.py +++ b/tests/e2e/test_source_saml.py @@ -98,6 +98,7 @@ class TestSourceSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @apply_migration( @@ -166,6 +167,7 @@ class TestSourceSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @apply_migration( @@ -247,6 +249,7 @@ class TestSourceSAML(SeleniumTestCase): @retry() @apply_migration("authentik_core", "0003_default_user") @apply_migration("authentik_flows", "0008_default_flows") + @apply_migration("authentik_flows", "0011_flow_title") @apply_migration("authentik_flows", "0009_source_flows") @apply_migration("authentik_crypto", "0002_create_self_signed_kp") @apply_migration( diff --git a/web/src/flows/FlowExecutor.ts b/web/src/flows/FlowExecutor.ts index 82d5c1e4a..98bdf4fd8 100644 --- a/web/src/flows/FlowExecutor.ts +++ b/web/src/flows/FlowExecutor.ts @@ -103,7 +103,7 @@ export class FlowExecutor extends LitElement implements StageHost { return new FlowsApi(DEFAULT_CONFIG).flowsExecutorSolve({ flowSlug: this.flowSlug, query: window.location.search.substring(1), - flowChallengeResponseRequest: payload as FlowChallengeResponseRequest, + flowChallengeResponseRequest: payload, }).then((data) => { this.challenge = data; this.postUpdate(); @@ -184,35 +184,35 @@ export class FlowExecutor extends LitElement implements StageHost { case ChallengeChoices.Native: switch (this.challenge.component) { case "ak-stage-access-denied": - return html``; + return html``; case "ak-stage-identification": - return html``; + return html``; case "ak-stage-password": - return html``; + return html``; case "ak-stage-captcha": - return html``; + return html``; case "ak-stage-consent": - return html``; + return html``; case "ak-stage-dummy": - return html``; + return html``; case "ak-stage-email": - return html``; + return html``; case "ak-stage-autosubmit": - return html``; + return html``; case "ak-stage-prompt": - return html``; + return html``; case "ak-stage-authenticator-totp": - return html``; + return html``; case "ak-stage-authenticator-duo": - return html``; + return html``; case "ak-stage-authenticator-static": - return html``; + return html``; case "ak-stage-authenticator-webauthn": - return html``; + return html``; case "ak-stage-authenticator-validate": - return html``; + return html``; case "ak-flow-sources-plex": - return html``; + return html``; default: break; } diff --git a/web/src/pages/user-settings/UserSettingsPage.ts b/web/src/pages/user-settings/UserSettingsPage.ts index b01d1e1b3..73fa08c45 100644 --- a/web/src/pages/user-settings/UserSettingsPage.ts +++ b/web/src/pages/user-settings/UserSettingsPage.ts @@ -41,7 +41,7 @@ export class UserSettingsPage extends LitElement { return html` `; case "ak-user-settings-password": - return html` + return html` `; case "ak-user-settings-authenticator-totp": return html`