Skip to content

fix(platform): preserve custom API-key expiry dates - #4582

Merged
yannickmonney merged 4 commits into
mainfrom
fix/api-key-expiry-calendar
Oct 13, 2026
Merged

yannickmonney merged 4 commits into
mainfrom
fix/api-key-expiry-calendar

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

A custom API-key expiry could land on the wrong local date across a daylight-saving change, and a dialog left open overnight used a stale lifetime. Resolve custom dates within the existing 24-hour to 365-day API interval, disable dates the interval cannot represent, and revalidate against the submission time. Presets and Never retain their behavior. Calendar guidance and the API-key guide agree in EN/DE/FR.

Validation: 32 focused helper/component tests, 685 docs checks, 33 locale checks, configured typed lint, formatting/manual guards and SAST pass. An isolated copy with the old calendar rounding fails three DST cases; the candidate passes all four controls. Real Chromium at a 390-pixel viewport in Europe/Zurich refuses the unrepresentable spring-forward date, previews the accepted date, and submits the expected 47-hour lifetime; the rendered dialog fits without overflow. Independent source/prose review accepted the patch.

This is a separate follow-up to #4495 and stays draft while the current release blockers finish. Creation still uses a relative expiresIn value; this client repair does not guarantee an absolute server timestamp under unbounded network delay or clock skew.

A picked expiry day is the day the key stops working where its maker is, even across a clock change; the calendar offers only days a 24-hour to 365-day lifetime can end on, and a form left open is checked again when it is sent.
The server refuses a lifetime that is not whole seconds, so each DST case now checks it, with a clock reading in milliseconds as its own case; the cases name APIKEY-R10, the rule they hold.
dayjs isSame(…, 'day') ends a day at its first 23:59:59.999, so on a 25-hour day whose repeated hour follows a midnight clock change (Cairo, Santiago) a lifetime ending in that hour read as the next day and an offered date was refused. Compare the calendar dates instead; the two zones are cases of the DST table.
@yannickmonney
yannickmonney force-pushed the fix/api-key-expiry-calendar branch from a47ae7a to 8e4df10 Compare October 13, 2026 10:56
@yannickmonney
yannickmonney marked this pull request as ready for review October 13, 2026 16:31
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 13, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@yannickmonney
yannickmonney merged commit 5197d94 into main Oct 13, 2026
@yannickmonney
yannickmonney deleted the fix/api-key-expiry-calendar branch October 13, 2026 19:51
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.

1 participant