-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
core: add user settable token durations #7410
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7410 +/- ##
===========================================
- Coverage 92.40% 45.89% -46.51%
===========================================
Files 646 646
Lines 31851 31926 +75
===========================================
- Hits 29431 14654 -14777
- Misses 2420 17272 +14852
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for authentik ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny edits, thanks for remembering to add docs!
raise ValidationError( | ||
{"expires": f"Token expires exceeds maximum lifetime ({max_token_lifetime})."} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we instead set the token expiration to something like min(attrs.get("expires"), token_expires_from_timedelta(max_token_lifetime_dt))
?
Co-authored-by: Tana M Berry <tanamarieberry@yahoo.com> Signed-off-by: Jean-Michel DILLY <48059109+jmdilly@users.noreply.github.com>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
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>
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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>
* main: website/docs: add more info and links about enforciing unique email addresses (#9154) core: bump goauthentik.io/api/v3 from 3.2024022.7 to 3.2024022.8 (#9215) web: bump API Client version (#9214) stages/authenticator_validate: add ability to limit webauthn device types (#9180) web: bump API Client version (#9213) core: add user settable token durations (#7410) core, web: update translations (#9205) web: bump typescript from 5.4.4 to 5.4.5 in /tests/wdio (#9206) web: bump chromedriver from 123.0.2 to 123.0.3 in /tests/wdio (#9207) core: bump sentry-sdk from 1.44.1 to 1.45.0 (#9208) web: bump typescript from 5.4.4 to 5.4.5 in /web (#9209) website: bump typescript from 5.4.4 to 5.4.5 in /website (#9210) core: bump python from 3.12.2-slim-bookworm to 3.12.3-slim-bookworm (#9211)
Details
This PR enables users to specify a non default lifetime for users created app application token. By the way, it enforces expires value on API side.
Closes #5881
Current limitation : maximum duration is currently not enforce in the UI but only on API side. This is because I haven't find yet an easy way to provide that piece of information to the UI without add a new API endpoint which would require additionnal work. Nevertheless, if the chosen expiration date is invalid, an error message is still thrown up to the use explaining why it has failed.
In my opinion, this enforcement within the UI could be enforced in a future improvement.
Checklist
ak test authentik/
)make lint-fix
)If an API change has been made
make gen-build
)If changes to the frontend have been made
make web
)make i18n-extract
)If applicable
make website
)