Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: always run policies for notification rules even if no group is selected #5353

Merged
merged 1 commit into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions authentik/events/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
LOGGER.debug("e(trigger): attempting to prevent infinite loop", trigger=trigger)
return

if not trigger.group:
LOGGER.debug("e(trigger): trigger has no group", trigger=trigger)
return

LOGGER.debug("e(trigger): checking if trigger applies", trigger=trigger)
try:
user = User.objects.filter(pk=event.user.get("pk")).first() or get_anonymous_user()
Expand All @@ -77,6 +73,10 @@
if not result.passing:
return

if not trigger.group:
LOGGER.debug("e(trigger): trigger has no group", trigger=trigger)
return

Check warning on line 78 in authentik/events/tasks.py

View check run for this annotation

Codecov / codecov/patch

authentik/events/tasks.py#L76-L78

Added lines #L76 - L78 were not covered by tests

LOGGER.debug("e(trigger): event trigger matched", trigger=trigger)
# Create the notification objects
for transport in trigger.transports.all():
Expand Down
4 changes: 4 additions & 0 deletions website/docs/events/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ After you've created the policies to match the events you want, create a "Notifi

You have to select which group the generated notification should be sent to. If left empty, the rule will be disabled.

:::info
Before authentik 2023.5, when no group is selected, policies bound to the rule are not executed. Starting with authentik 2023.5, policies are executed even when no group is selected.
:::

You also have to select which transports should be used to send the notification.
A transport with the name "default-email-transport" is created by default. This transport will use the [global email configuration](../installation/docker-compose#email-configuration-optional-but-recommended).

Expand Down
Loading