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

providers/oauth2: cleanup tokens when user is deactivated #12859

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rissson
Copy link
Member

@rissson rissson commented Jan 28, 2025

Details

Closes #12858


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 website)

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@rissson rissson self-assigned this Jan 28, 2025
@rissson rissson requested a review from a team as a code owner January 28, 2025 12:26
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit 10ba005
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6799706f881d02000864824a

Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 10ba005
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67997070804a200008e7deb4

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.75%. Comparing base (141ced8) to head (10ba005).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12859      +/-   ##
==========================================
+ Coverage   92.69%   92.75%   +0.05%     
==========================================
  Files         769      769              
  Lines       38926    38936      +10     
==========================================
+ Hits        36083    36115      +32     
+ Misses       2843     2821      -22     
Flag Coverage Δ
e2e 48.57% <100.00%> (+0.09%) ⬆️
integration 24.61% <75.00%> (+<0.01%) ⬆️
unit 90.40% <100.00%> (+<0.01%) ⬆️

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.

Copy link
Contributor

github-actions bot commented Jan 28, 2025

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-10ba005df74276c77f78e056e17f829510b025e3
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-10ba005df74276c77f78e056e17f829510b025e3

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

@@ -765,6 +766,8 @@ def partial_update(self, request: Request, *args, **kwargs) -> Response:
response = super().partial_update(request, *args, **kwargs)
instance: User = self.get_object()
if not instance.is_active:
RefreshToken.objects.filter(session__user=instance).delete()
Copy link
Member

Choose a reason for hiding this comment

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

This should be in a signal in the oauth2 provider app, as a user might get deactivated through other means (and we shouldn't introduce new direct app dependencies if possible)

Copy link
Member Author

Choose a reason for hiding this comment

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

any other places where this signal should be sent from?

rissson and others added 2 commits January 28, 2025 17:07
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

user refresh tokens still active after user deactivation.
2 participants