Skip to content

providers/oauth2: fix clean_expired_models failing - #15687

Open
BeryJu wants to merge 1 commit into
mainfrom
providers/oauth2/fix-clean_expired_models
Open

providers/oauth2: fix clean_expired_models failing#15687
BeryJu wants to merge 1 commit into
mainfrom
providers/oauth2/fix-clean_expired_models

Conversation

@BeryJu

@BeryJu BeryJu commented Jul 21, 2025

Copy link
Copy Markdown
Member

Details

In this signal we were accessing the relation which at that point might've been deleted already, but we can use the PK


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)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu
BeryJu requested a review from a team as a code owner July 21, 2025 13:15
@netlify

netlify Bot commented Jul 21, 2025

Copy link
Copy Markdown

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit f7c9b97
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/687e3d7a1781720008609f7b
😎 Deploy Preview https://deploy-preview-15687--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.

@netlify

netlify Bot commented Jul 21, 2025

Copy link
Copy Markdown

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit f7c9b97
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/687e3d7ae583820008c15861

@netlify

netlify Bot commented Jul 21, 2025

Copy link
Copy Markdown

Deploy Preview for authentik-integrations canceled.

Name Link
🔨 Latest commit f7c9b97
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/687e3d7af0d44c0008fa6366

@codecov

codecov Bot commented Jul 21, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.18%. Comparing base (21a73fe) to head (f7c9b97).
⚠️ Report is 3298 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15687   +/-   ##
=======================================
  Coverage   93.17%   93.18%           
=======================================
  Files         831      831           
  Lines       44161    44161           
=======================================
+ Hits        41149    41150    +1     
+ Misses       3012     3011    -1     
Flag Coverage Δ
e2e 46.62% <ø> (+<0.01%) ⬆️
integration 23.47% <ø> (+<0.01%) ⬆️
unit 91.27% <ø> (+<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.

@github-actions

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-f7c9b97dd538c05219e2e16eb350814c0fce622e
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-f7c9b97dd538c05219e2e16eb350814c0fce622e

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

@rissson

rissson commented Jul 23, 2025

Copy link
Copy Markdown
Member

Actually, the session field on the AccessToken might be null at that point, no?

AccessToken.objects.filter(
user=instance.user,
session__session__session_key=instance.session.session_key,
session__session__session_key=instance.pk,

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.

So this change should be fine, but we might need to also update the backchannel stuff that was added in the meantime.

One thing that is weird to me, is that the session field is marked as cascade on delete for AccessTokens, so that should happen automatically I think?

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.

2 participants