Skip to content

core: fix non-expiring service accounts and app passwords#19913

Merged
dominic-r merged 1 commit intomainfrom
sdko/sa-fix-expire
Feb 2, 2026
Merged

core: fix non-expiring service accounts and app passwords#19913
dominic-r merged 1 commit intomainfrom
sdko/sa-fix-expire

Conversation

@dominic-r
Copy link
Member

@dominic-r dominic-r commented Feb 1, 2026

We aim to fix
https://github.com/goauthentik/authentik/issues/19911 in the next patch
release, so this commit shouldn't include an API change, which is why we
do it a bit awkwardly. Additionally, `serializeForm` has no typechecking
for its return value (`return json as unknown as T`), and should be
refactored for type safety if at all possible.

There are at least two bugs we're solving in this commit:

1. Type checking fails on `serializeForm`, which results in
`expires: null` POSTed in a `UserServiceAccountRequest`, where it is not
allowed. The backend "correctly" returns a 400. For now we address this
by returning `undefined` from `serializeForm` on a `datetime-local`
input element when it is unset.

2. The schema allows for `expires: null` in `TokenModel`, but fails with
a 500 when that is actually sent. For now we address this with a `None`
check. (Note: this bug will not be encountered by the frontend after the
change from `null` to `undefined`, but it's still nice to fix.)

Both of these issues should eventually be solved by the backend handling
`ExpiringModel` in an `ExpiringModelSerializer` instead of the current
ad hoc way.

Introduced by https://github.com/goauthentik/authentik/pull/19561 for the frontend part

Closes: #19911

@dominic-r dominic-r added this to the Release 2025.12.3 milestone Feb 1, 2026
@dominic-r dominic-r self-assigned this Feb 1, 2026
@dominic-r dominic-r requested a review from a team as a code owner February 1, 2026 23:16
@dominic-r dominic-r added the backport/version-2025.12 Add this label to PRs to backport changes to version-2025.12 label Feb 1, 2026
@netlify
Copy link

netlify bot commented Feb 1, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit edddd2c
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/697fded7b75528000880eaa6
😎 Deploy Preview https://deploy-preview-19913--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
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (db63873) to head (bdccc07).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19913      +/-   ##
==========================================
+ Coverage   93.24%   93.26%   +0.02%     
==========================================
  Files         968      968              
  Lines       53331    53332       +1     
==========================================
+ Hits        49726    49738      +12     
+ Misses       3605     3594      -11     
Flag Coverage Δ
conformance 38.07% <0.00%> (+<0.01%) ⬆️
e2e 44.08% <0.00%> (-0.01%) ⬇️
integration 22.92% <0.00%> (+<0.01%) ⬆️
unit 91.40% <100.00%> (+<0.01%) ⬆️
unit-migrate 91.43% <100.00%> (+0.02%) ⬆️

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
Contributor

github-actions bot commented Feb 1, 2026

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

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

@dominic-r dominic-r marked this pull request as draft February 2, 2026 01:03
We aim to fix
#19911 in the next patch
release, so this commit shouldn't include an API change, which is why we
do it a bit awkwardly. Additionally, `serializeForm` has no typechecking
for its return value (`return json as unknown as T`), and should be
refactored for type safety if at all possible.

There are at least two bugs we're solving in this commit:

1. Type checking fails on `serializeForm`, which results in
`expires: null` POSTed in a `UserServiceAccountRequest`, where it is not
allowed. The backend "correctly" returns a 400. For now we address this
by returning `undefined` from `serializeForm` on a `datetime-local`
input element when it is unset.

2. The schema allows for `expires: null` in `TokenModel`, but fails with
a 500 when that is actually sent. For now we address this with a `None`
check. (Note: this bug will not be encountered by the frontend after the
change from `null` to `undefined`, but it's still nice to fix.)

Both of these issues should eventually be solved by the backend handling
`ExpiringModel` in an `ExpiringModelSerializer` instead of the current
ad hoc way.

Introduced by #19561
@netlify
Copy link

netlify bot commented Feb 2, 2026

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit bdccc07
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6980b1789772c80008a3ee57
😎 Deploy Preview https://deploy-preview-19913--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
Copy link

netlify bot commented Feb 2, 2026

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit bdccc07
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6980b1788993fd000821e01f
😎 Deploy Preview https://deploy-preview-19913--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.

@dominic-r dominic-r marked this pull request as ready for review February 2, 2026 14:18
@dominic-r dominic-r requested a review from a team as a code owner February 2, 2026 14:18
@dominic-r dominic-r marked this pull request as draft February 2, 2026 14:18
@dominic-r dominic-r marked this pull request as ready for review February 2, 2026 14:28
@dominic-r dominic-r enabled auto-merge (squash) February 2, 2026 14:43
@rissson rissson disabled auto-merge February 2, 2026 14:44
@github-project-automation github-project-automation bot moved this from Todo to In Progress in authentik Core Feb 2, 2026
@dominic-r dominic-r merged commit 12ebd3b into main Feb 2, 2026
102 checks passed
@dominic-r dominic-r deleted the sdko/sa-fix-expire branch February 2, 2026 14:59
@github-project-automation github-project-automation bot moved this from In Progress to Done in authentik Core Feb 2, 2026
authentik-automation bot pushed a commit that referenced this pull request Feb 2, 2026
core: fix datetime (de)?serialization

We aim to fix
#19911 in the next patch
release, so this commit shouldn't include an API change, which is why we
do it a bit awkwardly. Additionally, `serializeForm` has no typechecking
for its return value (`return json as unknown as T`), and should be
refactored for type safety if at all possible.

There are at least two bugs we're solving in this commit:

1. Type checking fails on `serializeForm`, which results in
`expires: null` POSTed in a `UserServiceAccountRequest`, where it is not
allowed. The backend "correctly" returns a 400. For now we address this
by returning `undefined` from `serializeForm` on a `datetime-local`
input element when it is unset.

2. The schema allows for `expires: null` in `TokenModel`, but fails with
a 500 when that is actually sent. For now we address this with a `None`
check. (Note: this bug will not be encountered by the frontend after the
change from `null` to `undefined`, but it's still nice to fix.)

Both of these issues should eventually be solved by the backend handling
`ExpiringModel` in an `ExpiringModelSerializer` instead of the current
ad hoc way.

Introduced by #19561

Co-authored-by: Simonyi Gergő <gergo@goauthentik.io>
@authentik-automation
Copy link
Contributor

🍒 Cherry-pick to version-2025.12 created: #19941

melizeche pushed a commit that referenced this pull request Feb 2, 2026
…#19913 to version-2025.12) (#19941)

core: fix non-expiring service accounts and app passwords (#19913)

core: fix datetime (de)?serialization

We aim to fix
#19911 in the next patch
release, so this commit shouldn't include an API change, which is why we
do it a bit awkwardly. Additionally, `serializeForm` has no typechecking
for its return value (`return json as unknown as T`), and should be
refactored for type safety if at all possible.

There are at least two bugs we're solving in this commit:

1. Type checking fails on `serializeForm`, which results in
`expires: null` POSTed in a `UserServiceAccountRequest`, where it is not
allowed. The backend "correctly" returns a 400. For now we address this
by returning `undefined` from `serializeForm` on a `datetime-local`
input element when it is unset.

2. The schema allows for `expires: null` in `TokenModel`, but fails with
a 500 when that is actually sent. For now we address this with a `None`
check. (Note: this bug will not be encountered by the frontend after the
change from `null` to `undefined`, but it's still nice to fix.)

Both of these issues should eventually be solved by the backend handling
`ExpiringModel` in an `ExpiringModelSerializer` instead of the current
ad hoc way.

Introduced by #19561

Co-authored-by: Dominic R <dominic@sdko.org>
Co-authored-by: Simonyi Gergő <gergo@goauthentik.io>
kensternberg-authentik added a commit that referenced this pull request Feb 2, 2026
* main: (30 commits)
  web/admin: fix default binding order (#19943)
  ci: fix test_docker.sh (#19944)
  lib: Add ssh/sftp schemas in to DomainlessFormattedURLValidator (#19881)
  core: fix non-expiring service accounts and app passwords (#19913)
  lifecycle/ak: make sure /data has the correct permissions (#19935)
  lifecycle/aws: add /data volume (#19936)
  website/docs: Update location of media storage and outdated references (#19885)
  web: bump @types/node from 25.1.0 to 25.2.0 in /web (#19923)
  web: bump @playwright/test from 1.58.0 to 1.58.1 in /web (#19926)
  web: bump the rollup group across 1 directory with 4 updates (#19922)
  ci: always generate API clients (#19906)
  providers/scim: add configuration warning for migration (#19859)
  core, web: update translations (#19868)
  core: bump gunicorn from 24.1.1 to 25.0.0 (#19916)
  core: bump pyjwt from 2.10.1 to 2.11.0 (#19920)
  core: bump cachetools from 6.2.6 to 7.0.0 (#19919)
  web: bump @formatjs/intl-listformat from 8.2.0 to 8.2.1 in /web (#19924)
  web: bump the storybook group across 1 directory with 5 updates (#19921)
  core: bump axllent/mailpit from v1.28.4 to v1.29.0 in /tests/e2e (#19918)
  core: bump goauthentik/selenium from 144.0-ak-0.35.9 to 144.0-ak-0.40.0 in /tests/e2e (#19917)
  ...
kensternberg-authentik added a commit that referenced this pull request Feb 4, 2026
* main: (30 commits)
  web/admin: fix default binding order (#19943)
  ci: fix test_docker.sh (#19944)
  lib: Add ssh/sftp schemas in to DomainlessFormattedURLValidator (#19881)
  core: fix non-expiring service accounts and app passwords (#19913)
  lifecycle/ak: make sure /data has the correct permissions (#19935)
  lifecycle/aws: add /data volume (#19936)
  website/docs: Update location of media storage and outdated references (#19885)
  web: bump @types/node from 25.1.0 to 25.2.0 in /web (#19923)
  web: bump @playwright/test from 1.58.0 to 1.58.1 in /web (#19926)
  web: bump the rollup group across 1 directory with 4 updates (#19922)
  ci: always generate API clients (#19906)
  providers/scim: add configuration warning for migration (#19859)
  core, web: update translations (#19868)
  core: bump gunicorn from 24.1.1 to 25.0.0 (#19916)
  core: bump pyjwt from 2.10.1 to 2.11.0 (#19920)
  core: bump cachetools from 6.2.6 to 7.0.0 (#19919)
  web: bump @formatjs/intl-listformat from 8.2.0 to 8.2.1 in /web (#19924)
  web: bump the storybook group across 1 directory with 5 updates (#19921)
  core: bump axllent/mailpit from v1.28.4 to v1.29.0 in /tests/e2e (#19918)
  core: bump goauthentik/selenium from 144.0-ak-0.35.9 to 144.0-ak-0.40.0 in /tests/e2e (#19917)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend backport/version-2025.12 Add this label to PRs to backport changes to version-2025.12

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Creating App Passwords with disabled expiration fails with an 405 method not allowed

4 participants