Skip to content

resource 2.4.0: clock_skew for a future iat; exp judged with no tolerance - #26

Merged
dickhardt merged 1 commit into
mainfrom
resource/clock-skew
Sep 8, 2026
Merged

resource 2.4.0: clock_skew for a future iat; exp judged with no tolerance#26
dickhardt merged 1 commit into
mainfrom
resource/clock-skew

Conversation

@dickhardt

Copy link
Copy Markdown
Contributor

Implements AAuth -11 §Expiry and the Refresh Margin (dickhardt/AAuth#153) in @aauth/resource:

  • exp is judged against the verifier's clock with no tolerance (jose clockTolerance: 0). The agent refreshes at least five minutes before expiry; the verifier does not allow for skew.
  • clockToleranceSeconds (default 60, the signature created window) now bounds iat alone. An iat beyond it throws AAuthTokenError('clock_skew'), exported as CLOCK_SKEW — the Signature-Error value a resource returns with 401 (Add the revoked_jwt error code dickhardt/signature-key#37). The issuer's clock, not the token, is at fault; the presenter waits rather than refreshes.
  • README documents the code and the change.

137 resource tests, 760 repo-wide, typecheck clean. Release after merge per CLAUDE.md (gh release create); consumers to follow: access (maps AAuthTokenError codes), test-resource.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEeAq61zr1oVg5FAFf3JTH

…ance

AAuth -11 §Expiry and the Refresh Margin: a verifier judges exp against
its own clock with no skew tolerance — the agent refreshes at least five
minutes before expiry — and iat is not a validity check, except that a
verifier MAY refuse an iat further ahead of its clock than the signature
validity window, answering clock_skew.

- jose clockTolerance is 0: `exp` five seconds past is token_expired
- clockToleranceSeconds (default 60) now bounds `iat` alone; beyond it
  verifyToken throws AAuthTokenError('clock_skew'), exported as
  CLOCK_SKEW — the Signature-Error value a resource returns with 401
- README: the new code, and the 2.4.0 change note

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEeAq61zr1oVg5FAFf3JTH
@dickhardt
dickhardt merged commit 3cc2830 into main Sep 8, 2026
1 check passed
@dickhardt
dickhardt deleted the resource/clock-skew branch September 8, 2026 13:13
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