jwtdate

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package jwtdate converts JWT NumericDates (RFC 7519 §2) to times, refusing the values time.Unix and Duration arithmetic can't hold: a date near int64's maximum wraps into the far past, and the age of one far in the future saturates, so an iat or nbf there would pass a freshness check.

Index

Constants

View Source
const Max = 253402300799

Max is the latest NumericDate accepted: 9999-12-31T23:59:59Z.

Variables

View Source
var ErrOutOfRange = errors.New("jwtdate: NumericDate out of range")

ErrOutOfRange is returned for a NumericDate before 1970 or after Max, or not a finite number.

Functions

func FromFloat

func FromFloat(v float64) (time.Time, error)

FromFloat is FromUnix for a JSON number, its fraction dropped.

func FromUnix

func FromUnix(sec int64) (time.Time, error)

FromUnix is the time sec seconds after 1970, in range.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL