Skip to content

Cast f64 NumericDate to i64#60

Open
georgeboot wants to merge 3 commits into
cduvray:mainfrom
georgeboot:numeric-date-f64
Open

Cast f64 NumericDate to i64#60
georgeboot wants to merge 3 commits into
cduvray:mainfrom
georgeboot:numeric-date-f64

Conversation

@georgeboot

Copy link
Copy Markdown

The JWT spec states the following definition for NumericDate:

NumericDate
A JSON numeric value representing the number of seconds from
1970-01-01T00:00:00Z UTC until the specified UTC date/time,
ignoring leap seconds. This is equivalent to the IEEE Std 1003.1,
2013 Edition [POSIX.1] definition "Seconds Since the Epoch", in
which each day is accounted for by exactly 86400 seconds, other
than that non-integer values can be represented. See RFC 3339
[RFC3339] for details regarding date/times in general and UTC in
particular.

This means that numeric dates can be a f64 as well.

This PR casts the f64 to an i64 internally in the deserialisation, so support both.

georgeboot and others added 3 commits November 12, 2024 11:21
Mirrors jsonwebtoken's own validate_aud toggle. When set to false the aud
claim is ignored even if present, so callers don't need to maintain an
allowlist of client IDs when the issuer is the only thing they care about.
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.

2 participants