diff --git a/authentik/policies/views.py b/authentik/policies/views.py index ce5969359..73f2526eb 100644 --- a/authentik/policies/views.py +++ b/authentik/policies/views.py @@ -12,8 +12,8 @@ from structlog.stdlib import get_logger from authentik.core.models import Application, Provider, User from authentik.flows.views import SESSION_KEY_APPLICATION_PRE from authentik.lib.sentry import SentryIgnoredException -from authentik.policies.engine import PolicyEngine from authentik.policies.denied import AccessDeniedResponse +from authentik.policies.engine import PolicyEngine from authentik.policies.types import PolicyResult LOGGER = get_logger() diff --git a/authentik/stages/email/tests/test_stage.py b/authentik/stages/email/tests/test_stage.py index aeba8c385..4356c333b 100644 --- a/authentik/stages/email/tests/test_stage.py +++ b/authentik/stages/email/tests/test_stage.py @@ -7,6 +7,7 @@ from django.urls import reverse from django.utils.encoding import force_str from authentik.core.models import Token, User +from authentik.flows.challenge import ChallengeTypes from authentik.flows.markers import StageMarker from authentik.flows.models import Flow, FlowDesignation, FlowStageBinding from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER, FlowPlan @@ -126,7 +127,12 @@ class TestEmailStage(TestCase): self.assertEqual(response.status_code, 200) self.assertJSONEqual( force_str(response.content), - {"to": reverse("authentik_core:root-redirect"), "type": "redirect"}, + { + "component": "ak-stage-access-denied", + "error_message": None, + "title": "", + "type": ChallengeTypes.native.value, + }, ) session = self.client.session diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 30bbb5e81..a36438ac2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,6 +56,22 @@ stages: - task: CmdLine@2 inputs: script: pipenv run black --check authentik tests lifecycle + - job: isort + pool: + vmImage: 'ubuntu-latest' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.9' + - task: CmdLine@2 + inputs: + script: | + sudo apt install -y libxmlsec1-dev pkg-config + sudo pip install -U wheel pipenv + pipenv install --dev + - task: CmdLine@2 + inputs: + script: pipenv run isort --check authentik tests lifecycle - job: bandit pool: vmImage: 'ubuntu-latest'