Files
Filip Skokan 54c3627474 fix(types): correct key resolver and JWT header types
Match the protected header of each resolver callback to the value
supplied by its operation. Expose the members attached to local and
remote JWKS resolvers through named callable interfaces.

Allow `JWTHeaderParameters.b64` to be boolean. A false value is inert
unless "b64" is listed in "crit", so signing and verification accept it.

Signed-off-by: Filip Skokan <[email protected]>
2026-07-29 18:45:03 +02:00

2.5 KiB

Interface: RemoteJWKSet()

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.

The key resolution function returned by createRemoteJWKSet.

See

jwtVerify and the other consuming functions, all of which accept this directly.

â–¸ RemoteJWKSet(protectedHeader?, token?): Promise<CryptoKey>

The key resolution function returned by createRemoteJWKSet.

Parameters

Parameter Type
protectedHeader? JWSHeaderParameters
token? FlattenedJWSInput

Returns

Promise<CryptoKey>

See

jwtVerify and the other consuming functions, all of which accept this directly.

Properties

coolingDown

• readonly coolingDown: boolean

Whether the cooldown window following the last successful fetch is still in effect.


fresh

• readonly fresh: boolean

Whether the currently cached JSON Web Key Set is within its RemoteJWKSetOptions.cacheMaxAge.


jwks

• jwks: () => JSONWebKeySet | undefined

The currently cached JSON Web Key Set, or undefined when none has been fetched or seeded via jwksCache yet.

Returns

JSONWebKeySet | undefined


reload

• reload: () => Promise<void>

Triggers a JSON Web Key Set fetch, bypassing the cooldown.

Returns

Promise<void>


reloading

• readonly reloading: boolean

Whether a JSON Web Key Set fetch is currently in flight.