Skip to content

enterprise/reports: add users and events export#18088

Merged
GirlBossRush merged 49 commits intogoauthentik:mainfrom
atereshkin:csv-export
Dec 9, 2025
Merged

enterprise/reports: add users and events export#18088
GirlBossRush merged 49 commits intogoauthentik:mainfrom
atereshkin:csv-export

Conversation

@atereshkin
Copy link
Contributor

Details

This implements users and events csv export for the enterprise version of authentik.
A new app called "authentik.enterprise.reports" has been added to house this as well as future report generation logic.
The following new UI elements were added: "Data Exports" page (under Events), Export button in Drectory > Users, Export button in Events > Logs. The buttons are only visible when a valid enterprise license is installed.

WARNING
This PR does not implement any access control on the export files. It should only be merged once secure file storage is available.


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make docs)

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit edcdede
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/693719bd31dec600071edf9b

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit edcdede
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/693719bd4cd04d0008276830

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit edcdede
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/693719bd9c20930008f7d21f

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 99.23077% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.20%. Comparing base (08551f1) to head (edcdede).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
authentik/enterprise/reports/api/reports.py 98.52% 1 Missing ⚠️
authentik/enterprise/reports/models.py 98.76% 1 Missing ⚠️
authentik/events/models.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #18088    +/-   ##
========================================
  Coverage   93.19%   93.20%            
========================================
  Files         929      941    +12     
  Lines       51174    51561   +387     
========================================
+ Hits        47694    48058   +364     
- Misses       3480     3503    +23     
Flag Coverage Δ
e2e 44.79% <28.97%> (-0.13%) ⬇️
integration 23.23% <27.17%> (+0.08%) ⬆️
unit 91.47% <99.23%> (+0.06%) ⬆️
unit-migrate 91.52% <99.23%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rissson rissson self-requested a review November 13, 2025 14:19
@dominic-r dominic-r mentioned this pull request Nov 23, 2025
@rissson rissson self-assigned this Nov 27, 2025
@rissson rissson added this to the Release 2025.12 milestone Nov 27, 2025
…umption check is not lost when compiling to optimised byte code
…ke reduce coupling of enterprise with the rest of authentik
…tead of accessing default_storage directly, so all the FileField.save logic can run correctly (e.g. creating directories)
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Copy link
Member

@dominic-r dominic-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for docs

Signed-off-by: Dewi Roberts <dewi@goauthentik.io>
Copy link
Contributor

@dewi-tik dewi-tik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM docs wise

Copy link
Contributor

@kensternberg-authentik kensternberg-authentik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a teeny-tiny bit of ugliness with the export button.

Comment on lines +213 to +224
renderEnterpriseRequired() {
return html`<a href="#/enterprise/licenses" class="pf-c-nav__link">
${this.label}
<span class="pf-c-nav__enterprise-notice">${msg("Enterprise only")}</span>
</a>`;
}

renderWithPath() {
if (this.enterprise && !this.hasEnterpriseLicense) {
if (!this.can(CapabilitiesEnum.IsEnterprise)) return nothing;
else return this.renderEnterpriseRequired();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kensternberg-authentik request for design opinions

Copy link
Contributor

@kensternberg-authentik kensternberg-authentik Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is fine. There's a difference between "That's not how we do things here" and "I wouldn't have named it that." This feels a little bit like the latter. And Marc's name is more expressive of intent, at least to me.

@BeryJu
Copy link
Member

BeryJu commented Dec 5, 2025

Proposal for the UI:

  • Add this page to the sidebar under Enterprise
  • Add an empty page to explain what it is and that it requires enterprise

Copy link
Contributor

@tanberry tanberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great feature, and great docs to go with it, thanks @atereshkin ! A couple of nits, please, then good-to-go.

atereshkin and others added 15 commits December 8, 2025 08:59
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Signed-off-by: Alexander Tereshkin <96586+atereshkin@users.noreply.github.com>
…ttings display:none) when there's no license
Signed-off-by: Jens Langhammer <jens@goauthentik.io>

# Conflicts:
#	authentik/core/api/users.py
#	schema.yml
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Copy link
Contributor

@tanberry tanberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, a fantastic feature to have, thanks @atereshkin !

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Copy link
Contributor

@kensternberg-authentik kensternberg-authentik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think the UI code looks fine. Routine, other than the "enterprise" tag.

@GirlBossRush GirlBossRush merged commit 7e9e0a8 into goauthentik:main Dec 9, 2025
96 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in authentik Core Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.