audit fixes: fail-closed expiry, RFC 8785 alignment, action_ref naive rejection#1
Merged
Conversation
…, action_ref naive ts (audit 2026-07-10) TRACK B (authority + canonical bytes): review before release. Findings #1/#4/#5/#6 plus Python mediums/lows. - Expiry: verify_delegation/is_expired/sub_delegate parsed expiresAt with datetime.fromisoformat, which rejects a trailing Z before Python 3.11 (the declared floor is 3.10), swallowing the error so the check no-opped. New _time.parse_iso_utc (Z-correct on 3.9+); unparseable expiry now fails closed. - Canonical bytes: canonicalize/canonicalize_jcs now serialize floats via _es_number (ECMAScript Number::toString, byte-identical to Node over 20009 values) and sort keys by UTF-16 code units. Verified full Python JCS == TS canonicalizeJCS on floats, astral keys, null preservation. JCS fallback gains ensure_ascii=False. - action_ref rejects naive timestamps (spec 4.1 requires Z/offset; TS parses naive as local, so assuming UTC silently diverged); explicit year zero-padding. - __version__ 2.6.0->2.8.0; CHANGELOG 2.7.0 entry added and 2.6.0 un-marked unreleased; canonicalize docstring corrected; AGENTS python floor aligned to pyproject >=3.10. Full suite 681 passed / 25 skipped / 6 xfailed. No existing test regressed.
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.
Audit fixes: expiry parsing handles Z on 3.9+ and fails closed on malformed timestamps, canonical JSON aligned to the RFC 8785 anchor (ES numbers byte-identical to Node across 20,009 values, UTF-16 key order, matches the TS reference on floats, astral keys, nulls), action_ref rejects naive timestamps per spec 4.1. 681 passed.