mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
BREAKING CHANGE: createRemoteJWKSet now uses fetch, because of that its Node.js only options.agent property has been removed and new fetch-related options were added
24 lines
660 B
TypeScript
24 lines
660 B
TypeScript
export function setters(now) {
|
|
const timeSetters = [
|
|
[0],
|
|
[new Date(now * 1000), now],
|
|
['10s', now + 10],
|
|
['+10s', now + 10],
|
|
['-10s', now - 10],
|
|
['+ 10s', now + 10],
|
|
['- 10s', now - 10],
|
|
['10s from now', now + 10],
|
|
['10s ago', now - 10],
|
|
]
|
|
|
|
return [
|
|
['setIssuer', 'iss', [['urn:example:issuer']]],
|
|
['setSubject', 'sub', [['urn:example:subject']]],
|
|
['setAudience', 'aud', [['urn:example:audience']]],
|
|
['setJti', 'jti', [['urn:example:jti']]],
|
|
['setIssuedAt', 'iat', [[undefined, now], ...timeSetters]],
|
|
['setExpirationTime', 'exp', timeSetters],
|
|
['setNotBefore', 'nbf', timeSetters],
|
|
]
|
|
}
|