From 7d9c74ce04aa4514e6d4e6672277869a18dc0d89 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 26 Jun 2021 23:38:32 +0200 Subject: [PATCH] tenants: include all default flows in current_tenant Signed-off-by: Jens Langhammer --- authentik/tenants/api.py | 3 +++ schema.yml | 6 ++++++ web/src/pages/events/EventInfo.ts | 32 +++++++++++++++---------------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/authentik/tenants/api.py b/authentik/tenants/api.py index e5b7cc957..673373f8d 100644 --- a/authentik/tenants/api.py +++ b/authentik/tenants/api.py @@ -54,6 +54,9 @@ class CurrentTenantSerializer(PassiveSerializer): default=CONFIG.y("footer_links", []), ) + flow_authentication = CharField(source="flow_authentication.slug", required=False) + flow_invalidation = CharField(source="flow_invalidation.slug", required=False) + flow_recovery = CharField(source="flow_recovery.slug", required=False) flow_unenrollment = CharField(source="flow_unenrollment.slug", required=False) diff --git a/schema.yml b/schema.yml index f7e65eafb..761f424f9 100644 --- a/schema.yml +++ b/schema.yml @@ -18890,6 +18890,12 @@ components: name: Documentation - href: https://goauthentik.io/ name: authentik Website + flow_authentication: + type: string + flow_invalidation: + type: string + flow_recovery: + type: string flow_unenrollment: type: string required: diff --git a/web/src/pages/events/EventInfo.ts b/web/src/pages/events/EventInfo.ts index 38ca07072..439ff763c 100644 --- a/web/src/pages/events/EventInfo.ts +++ b/web/src/pages/events/EventInfo.ts @@ -1,7 +1,7 @@ import { t } from "@lingui/macro"; import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import { until } from "lit-html/directives/until"; -import { EventMatcherPolicyActionEnum, FlowsApi } from "authentik-api"; +import { EventActions, FlowsApi } from "authentik-api"; import "../../elements/Spinner"; import "../../elements/Expand"; import { PFSize } from "../../elements/Spinner"; @@ -189,14 +189,14 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)} return html``; } switch (this.event?.action) { - case EventMatcherPolicyActionEnum.ModelCreated: - case EventMatcherPolicyActionEnum.ModelUpdated: - case EventMatcherPolicyActionEnum.ModelDeleted: + case EventActions.ModelCreated: + case EventActions.ModelUpdated: + case EventActions.ModelDeleted: return html`

${t`Affected model:`}

${this.getModelInfo(this.event.context?.model as EventModel)} `; - case EventMatcherPolicyActionEnum.AuthorizeApplication: + case EventActions.AuthorizeApplication: return html`

${t`Authorized application:`}

@@ -213,17 +213,17 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)}
${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.EmailSent: + case EventActions.EmailSent: return html`

${t`Email info:`}

${this.getEmailInfo(this.event.context)} `; - case EventMatcherPolicyActionEnum.SecretView: + case EventActions.SecretView: return html`

${t`Secret:`}

${this.getModelInfo(this.event.context.secret as EventModel)}`; - case EventMatcherPolicyActionEnum.SystemException: + case EventActions.SystemException: return html` ${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.PropertyMappingException: + case EventActions.PropertyMappingException: return html`

${t`Exception`}

@@ -252,7 +252,7 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)}
${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.PolicyException: + case EventActions.PolicyException: return html`

${t`Binding`}

@@ -271,7 +271,7 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)}
${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.PolicyExecution: + case EventActions.PolicyExecution: return html`

${t`Binding`}

@@ -299,10 +299,10 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)}
${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.ConfigurationError: + case EventActions.ConfigurationError: return html`

${this.event.context.message}

${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.UpdateAvailable: + case EventActions.UpdateAvailable: return html`

${t`New version available!`}

`; // Action types which typically don't record any extra context. // If context is not empty, we fall to the default response. - case EventMatcherPolicyActionEnum.Login: + case EventActions.Login: if ("using_source" in this.event.context) { return html`
@@ -321,11 +321,11 @@ new?labels=bug,from_authentik&title=${encodeURIComponent(title)}
`; } return this.defaultResponse(); - case EventMatcherPolicyActionEnum.LoginFailed: + case EventActions.LoginFailed: return html`

${t`Attempted to log in as ${this.event.context.username}`}

${this.defaultResponse()}`; - case EventMatcherPolicyActionEnum.Logout: + case EventActions.Logout: if (this.event.context === {}) { return html`${t`No additional data available.`}`; }