Skip to content

enterprise/core: add scheduled user offboarding - #23624

Merged
melizeche merged 42 commits into
mainfrom
user_offboarding
Jul 27, 2026
Merged

melizeche merged 42 commits into
mainfrom
user_offboarding

Conversation

@melizeche

@melizeche melizeche commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

Details

Adds a way to schedule deactivating or deleting a user at a future time, instead of doing it by hand when someone leaves.

From a user's page (Admin > Users) there's a new "Schedule Offboarding" button. You pick an action (deactivate or delete), a date/time, and whether to also revoke their sessions and tokens.

A worker checks every 5 minutes and runs anything that's due. While one is pending, the button flips to "Cancel Offboarding", which asks for confirmation and keeps the record as canceled.

You can't schedule one for yourself or an internal service account, and a user can only have one pending at a time.

The actual deactivate/delete logic lives in a small offboard_user() helper so it can be reused later by the policy-driven action lifecycle. Every run emits a USER_OFFBOARDED audit event, attributed to the admin who scheduled it.

image image image image

Report UI

#24266

Related

#5375
#22823


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)

@netlify

netlify Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 421450b
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a5fc4b55998360008cd6076
😎 Deploy Preview https://deploy-preview-23624--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit f955dce
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a627ab157be9f00085b02c3
😎 Deploy Preview https://deploy-preview-23624--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 421450b
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a5fc4b59d5d1400087d1082
😎 Deploy Preview https://deploy-preview-23624--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.85039% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.56%. Comparing base (d79ff6f) to head (836a1f8).
⚠️ Report is 60 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
authentik/enterprise/lifecycle/review/tasks.py 51.72% 14 Missing ⚠️
...se/lifecycle/offboarding/tests/test_offboarding.py 97.84% 6 Missing ⚠️
...hentik/enterprise/lifecycle/offboarding/actions.py 91.66% 2 Missing ⚠️
authentik/enterprise/lifecycle/offboarding/api.py 98.38% 1 Missing ⚠️
...thentik/enterprise/lifecycle/offboarding/models.py 98.27% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23624      +/-   ##
==========================================
+ Coverage   93.52%   93.56%   +0.03%     
==========================================
  Files        1062     1076      +14     
  Lines       63848    64894    +1046     
  Branches      424      424              
==========================================
+ Hits        59715    60718    +1003     
- Misses       4133     4176      +43     
Flag Coverage Δ
conformance 35.18% <31.88%> (-0.33%) ⬇️
e2e 40.08% <31.88%> (-0.39%) ⬇️
integration 31.74% <31.88%> (-0.27%) ⬇️
rust 0.00% <ø> (ø)
unit 92.76% <96.85%> (+0.06%) ⬆️
unit-migrate 92.79% <96.85%> (+0.06%) ⬆️

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

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

@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-836a1f8dba459f2f686e2fcac0777863d23b489f
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-836a1f8dba459f2f686e2fcac0777863d23b489f

Afterwards, run the upgrade commands from the latest release notes.

@melizeche melizeche changed the title [WIP] core: add scheduled user offboarding [WIP] core/enterpise: add scheduled user offboarding Jul 3, 2026
@melizeche

melizeche commented Jul 21, 2026 •

Copy link
Copy Markdown
Member Author

@gergosimonyi @BeryJu changes since review:

  • Session/token revocation moved to a shared revoke_user_access() in authentik/enterprise/core/revocation.py, used by both offboarding and account lockdown so the two can't drift on what "revoke access" means. The delete-and-retry loop now runs in a single transaction.
  • UserOffboardingViewSet is composed from mixins instead of ModelViewSet with http_method_names, so the update handlers don't exist at all (records stay immutable, same as before, just structural now)
  • Restructured the lifecycle app into an umbrella with two sibling packages: the existing access-review feature moved to enterprise/lifecycle/review/, offboarding lives in enterprise/lifecycle/offboarding/. Internal-only: app label, migrations, and API paths are unchanged (no schema diff). Dramatiq actor names change with the module paths; stale schedules are cleaned up by the reconciler on startup


# Import order sets model registration order, which the API schema's ModelEnum
# follows; review stays first to match the pre-split layout.
# isort: off

@melizeche melizeche Jul 21, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The # isort: off here pins review before offboarding so ModelEnum keeps its old order and this stays a zero-diff move in schema.yml and the generated clients. No problem to drop it and eat the reorder diff if you'd rather

@gergosimonyi gergosimonyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works for me, you may or may not want to wait for @BeryJu's review.

@rissson rissson changed the title core/enterprise: add scheduled user offboarding enterprise/core: add scheduled user offboarding Jul 22, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core Jul 24, 2026
@melizeche
melizeche requested a review from rissson July 24, 2026 16:25
@melizeche
melizeche merged commit 41514e5 into main Jul 27, 2026
123 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Jul 27, 2026
@melizeche
melizeche deleted the user_offboarding branch July 27, 2026 18:44
kensternberg-authentik added a commit that referenced this pull request Jul 27, 2026
* main: (70 commits)
  web/enterprise: add UI for pending offboardings (#24266)
  website: enterprise CTA (#24416)
  enterprise/core: add scheduled user offboarding (#23624)
  website/integrations: Dashy: cleanup (#23636)
  website/integrations: Arcane: cleanup (#23694)
  website/integrations: MeshCentral: cleanup (#23685)
  website/integrations: Proxmox VE: cleanup (#23703)
  web/elements: key the message list so stacked toasts don't share state (#24361)
  core, web: update translations (#24411)
  web/admin: better table filter (#24368)
  ci: fix source-docs publish (#24405)
  core, web: update translations (#24364)
  translate: Updates for project authentik and language sk_SK (#24406)
  brands: fix schema for current brand's flags (#24376)
  website/integrations: Google Workspace: cleanup (#23637)
  website/integrations: Fleet: cleanup (#23692)
  website/integrations: engomo: cleanup (#23644)
  website/integrations: Forgejo: cleanup (#23642)
  website/integrations: Organizr: cleanup (#23640)
  website/integrations: Linkwarden: cleanup (#23639)
  ...
kensternberg-authentik added a commit that referenced this pull request Jul 27, 2026
* main: (70 commits)
  web/enterprise: add UI for pending offboardings (#24266)
  website: enterprise CTA (#24416)
  enterprise/core: add scheduled user offboarding (#23624)
  website/integrations: Dashy: cleanup (#23636)
  website/integrations: Arcane: cleanup (#23694)
  website/integrations: MeshCentral: cleanup (#23685)
  website/integrations: Proxmox VE: cleanup (#23703)
  web/elements: key the message list so stacked toasts don't share state (#24361)
  core, web: update translations (#24411)
  web/admin: better table filter (#24368)
  ci: fix source-docs publish (#24405)
  core, web: update translations (#24364)
  translate: Updates for project authentik and language sk_SK (#24406)
  brands: fix schema for current brand's flags (#24376)
  website/integrations: Google Workspace: cleanup (#23637)
  website/integrations: Fleet: cleanup (#23692)
  website/integrations: engomo: cleanup (#23644)
  website/integrations: Forgejo: cleanup (#23642)
  website/integrations: Organizr: cleanup (#23640)
  website/integrations: Linkwarden: cleanup (#23639)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants