Repository navigation
Hotfix 1.26.7: accept a child delegation expiring at its parent's exact expiry (TC-3076) - #609
Merged
Merged
Conversation
…full precision when no renewal applies
samgbafa
marked this pull request as ready for review
November 16, 2026 01:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotfix 1.26.7: a child delegation may expire at its parent's exact expiry again
Branched from
v1.26.5. This is the fix plus the 1.26.7 version bump, and nothing else: no migration, no compose or workflow change.Behaviour
Since 1.26.0,
POST /delegatereads the parent's end in whole seconds when it checks a child's expiry. A child signed to expire at its parent's exact expiry, including the parent's milliseconds, is therefore refused with 401 "Child delegation expiry exceeds parent expiry". Up to 1.25.x the comparison used full precision. This change restores acceptance of a child that expires at its parent's exact expiry.Fix
parent_end_for_childchooses the end a child is held to:This changes the bound only in the first case, from the floored second to the exact signed instant, which is less than 1 s later. An ancestor can end inside that gap only for a renewed parent whose ancestor expires in the same second as the parent's signed expiry. The bound then exceeds that ancestor's exact expiry by less than 1 s, and use is still bounded at invocation time by the chain's whole-second end. A child 1 ms past its parent is still refused.
Not changed: invocation-time expiry checks still use whole seconds, so a session stops working at most one fraction of a second early.
Tests
a_child_may_expire_at_its_parents_millisecond_but_not_after: for a parent whose expiry has milliseconds, children at the same second (.000) and at the exact instant are accepted, and a child 1 ms later is refused withExpiryExceedsParent.the_parent_end_is_exact_only_where_it_is_the_signed_expiry: the helper returns the exact signed expiry only for its own second; renewed ends, ancestor caps and missing expiries keep the effective end.child_delegation_uses_renewed_parent_effective_expiryis unchanged and passes.Locally,
cargo test -p tinycloud-core --lib -- delegation renewal auth_graph(SQLite and PostgreSQL) gives 110 passed, 0 failed.Release
Order:
v1.26.7at the hotfix commit (this head) before anything reaches main. The tag push builds the images. Because the tag already exists, the post-merge release-plz run cannot createv1.26.7on main's merge commit.CHANGELOG.md, the crate version and both lock files, so the resolution goes in a merge commit on top of the tagged commit: the 1.26.7 changelog section above 1.26.6, and the crate at 1.26.7. The tag stays on the hotfix commit, which is then in main's history.v1.26.7tag. Its commit is in main's history, the crate version matches the tag, and it is a strict descendant of the running 1.26.5. Rollback to 1.26.5 is image-only because the migration sources are identical.Details: TC-3076.