Skip to content

core: handle overflow in duration validation - #26680

Merged
BeryJu merged 1 commit into
goauthentik:mainfrom
deronnax:fix/timedelta-validation-overflow
Oct 4, 2026
Merged

BeryJu merged 1 commit into
goauthentik:mainfrom
deronnax:fix/timedelta-validation-overflow

Conversation

@deronnax

@deronnax deronnax commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Catch OverflowError in the duration validator and convert it to a Django ValidationError. Add regression tests for positive overflow, negative overflow, and infinity.

Why is this change needed?

Values such as days=1000000000 currently raise an uncaught exception instead of a validation error.

How was this tested?

Four focused tests passed with Django 5.2.17 in an isolated environment, without the project database setup. make test authentik.lib.tests.test_utils_time could not start because development dependencies were unavailable offline. make all and make docs were not run.

AI assistance: OpenAI Codex chatGPT 6 Astra effort medium identified the issue and drafted the fix, tests, and PR description. (but the human behind is a seasonned django dev. Hi 👋)(very good AI policy by the way)

Linked issues

None.


Checklist

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)
  • I have read the AI usage policy.

@deronnax
deronnax requested a review from a team as a code owner October 3, 2026 20:49
@netlify

netlify Bot commented Oct 3, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 0fab6d0
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ac16a3e0af802000813f3ad
😎 Deploy Preview https://deploy-preview-26680--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 Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (2c6f657) to head (0fab6d0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26680      +/-   ##
==========================================
+ Coverage   92.24%   92.27%   +0.03%     
==========================================
  Files        1175     1175              
  Lines       77693    77697       +4     
  Branches     4129     4129              
==========================================
+ Hits        71668    71697      +29     
+ Misses       5959     5934      -25     
  Partials       66       66              
Flag Coverage Δ
conformance 32.96% <0.00%> (-0.01%) ⬇️
e2e 37.75% <0.00%> (+0.36%) ⬆️
integration 29.26% <0.00%> (-0.49%) ⬇️
rust 46.45% <ø> (ø)
unit 93.73% <100.00%> (+<0.01%) ⬆️
unit-migrate 93.73% <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 Harness.
📢 Have feedback on the report? Share it here.

@BeryJu BeryJu added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Oct 4, 2026
@BeryJu
BeryJu merged commit 9ffe0bc into goauthentik:main Oct 4, 2026
138 of 139 checks passed
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26687

BeryJu pushed a commit that referenced this pull request Oct 5, 2026
…ersion-2026.8) (#26687)

core: handle overflow in duration validation (#26680)

Co-authored-by: Mathieu Dupuy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants