oauth4webapi 2.10.3 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build/index.d.ts +108 -14
- package/build/index.js +46 -16
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ The following features are currently in scope and implemented in this software:
|
|
|
29
29
|
|
|
30
30
|
`oauth4webapi` has no dependencies and it exports tree-shakeable ESM.
|
|
31
31
|
|
|
32
|
-
## [
|
|
32
|
+
## [API Reference](docs/README.md)
|
|
33
33
|
|
|
34
34
|
`oauth4webapi` is distributed via [npmjs.com](https://www.npmjs.com/package/oauth4webapi), [deno.land/x](https://deno.land/x/oauth4webapi), [cdnjs.com](https://cdnjs.com/libraries/oauth4webapi), [jsdelivr.com](https://www.jsdelivr.com/package/npm/oauth4webapi), and [github.com](https://github.com/panva/oauth4webapi).
|
|
35
35
|
|
|
@@ -38,13 +38,13 @@ The following features are currently in scope and implemented in this software:
|
|
|
38
38
|
**`example`** ESM import
|
|
39
39
|
|
|
40
40
|
```js
|
|
41
|
-
import * as
|
|
41
|
+
import * as oauth from 'oauth4webapi'
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
**`example`** Deno import
|
|
45
45
|
|
|
46
46
|
```js
|
|
47
|
-
import * as
|
|
47
|
+
import * as oauth from 'https://deno.land/x/oauth4webapi@v2.11.0/mod.ts'
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
- Authorization Code Flow (OAuth 2.0) - [source](examples/oauth.ts)
|
package/build/index.d.ts
CHANGED
|
@@ -135,11 +135,24 @@ export type ClientAuthenticationMethod = 'client_secret_basic' | 'client_secret_
|
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
137
|
export type JWSAlgorithm = 'PS256' | 'ES256' | 'RS256' | 'EdDSA' | 'ES384' | 'PS384' | 'RS384' | 'ES512' | 'PS512' | 'RS512';
|
|
138
|
+
export interface JWK {
|
|
139
|
+
readonly kty?: string;
|
|
140
|
+
readonly kid?: string;
|
|
141
|
+
readonly alg?: string;
|
|
142
|
+
readonly use?: string;
|
|
143
|
+
readonly key_ops?: string[];
|
|
144
|
+
readonly e?: string;
|
|
145
|
+
readonly n?: string;
|
|
146
|
+
readonly crv?: string;
|
|
147
|
+
readonly x?: string;
|
|
148
|
+
readonly y?: string;
|
|
149
|
+
readonly [parameter: string]: JsonValue | undefined;
|
|
150
|
+
}
|
|
138
151
|
export declare const clockSkew: unique symbol;
|
|
139
152
|
export declare const clockTolerance: unique symbol;
|
|
140
153
|
/**
|
|
141
|
-
* When configured on an interface that extends {@link HttpRequestOptions},
|
|
142
|
-
* parameter for functions that trigger HTTP
|
|
154
|
+
* When configured on an interface that extends {@link HttpRequestOptions}, this applies to `options`
|
|
155
|
+
* parameter for functions that trigger HTTP requests, this replaces the use of global fetch. As a
|
|
143
156
|
* fetch replacement the arguments and expected return are the same as fetch.
|
|
144
157
|
*
|
|
145
158
|
* In theory any module that claims to be compatible with the Fetch API can be used but your mileage
|
|
@@ -221,6 +234,63 @@ export declare const clockTolerance: unique symbol;
|
|
|
221
234
|
* ```
|
|
222
235
|
*/
|
|
223
236
|
export declare const customFetch: unique symbol;
|
|
237
|
+
/**
|
|
238
|
+
* This is an experimental feature, it is not subject to semantic versioning rules. Non-backward
|
|
239
|
+
* compatible changes or removal may occur in any future release.
|
|
240
|
+
*
|
|
241
|
+
* DANGER ZONE - This option has security implications that must be understood, assessed for
|
|
242
|
+
* applicability, and accepted before use. It is critical that the JSON Web Key Set cache only be
|
|
243
|
+
* writable by your own code.
|
|
244
|
+
*
|
|
245
|
+
* This option is intended for cloud computing runtimes that cannot keep an in memory cache between
|
|
246
|
+
* their code's invocations. Use in runtimes where an in memory cache between requests is available
|
|
247
|
+
* is not desirable.
|
|
248
|
+
*
|
|
249
|
+
* When configured on an interface that extends {@link JWKSCacheOptions}, this applies to `options`
|
|
250
|
+
* parameter for functions that trigger HTTP requests for the
|
|
251
|
+
* {@link AuthorizationServer.jwks_uri `as.jwks_uri`}, this allows the passed in object to:
|
|
252
|
+
*
|
|
253
|
+
* - Serve as an initial value for the JSON Web Key Set that the module would otherwise need to
|
|
254
|
+
* trigger an HTTP request for
|
|
255
|
+
* - Have the JSON Web Key Set the function optionally ended up triggering an HTTP request for
|
|
256
|
+
* assigned to it as properties
|
|
257
|
+
*
|
|
258
|
+
* The intended use pattern is:
|
|
259
|
+
*
|
|
260
|
+
* - Before executing a function with {@link JWKSCacheOptions} in its `options` parameter you pull the
|
|
261
|
+
* previously cached object from a low-latency key-value store offered by the cloud computing
|
|
262
|
+
* runtime it is executed on;
|
|
263
|
+
* - Default to an empty object `{}` instead when there's no previously cached value;
|
|
264
|
+
* - Pass it into the options interfaces that extend {@link JWKSCacheOptions};
|
|
265
|
+
* - Afterwards, update the key-value storage if the {@link ExportedJWKSCache.uat `uat`} property of
|
|
266
|
+
* the object has changed.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
*
|
|
270
|
+
* ```ts
|
|
271
|
+
* import * as oauth from 'oauth4webapi'
|
|
272
|
+
*
|
|
273
|
+
* // Prerequisites
|
|
274
|
+
* let as!: oauth.AuthorizationServer
|
|
275
|
+
* let request!: Request
|
|
276
|
+
* let expectedAudience!: string
|
|
277
|
+
*
|
|
278
|
+
* // Load JSON Web Key Set cache
|
|
279
|
+
* const jwksCache: oauth.JWKSCacheInput = (await getPreviouslyCachedJWKS()) || {}
|
|
280
|
+
* const { uat } = jwksCache
|
|
281
|
+
*
|
|
282
|
+
* // Use JSON Web Key Set cache
|
|
283
|
+
* const accessTokenClaims = await validateJwtAccessToken(as, request, expectedAudience, {
|
|
284
|
+
* [oauth.experimental_jwksCache]: jwksCache,
|
|
285
|
+
* })
|
|
286
|
+
*
|
|
287
|
+
* if (uat !== jwksCache.uat) {
|
|
288
|
+
* // Update JSON Web Key Set cache
|
|
289
|
+
* await storeNewJWKScache(jwksCache)
|
|
290
|
+
* }
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
export declare const experimental_jwksCache: unique symbol;
|
|
224
294
|
/**
|
|
225
295
|
* When combined with {@link customFetch} (to use a Fetch API implementation that supports client
|
|
226
296
|
* certificates) this can be used to target FAPI 2.0 profiles that utilize Mutual-TLS for either
|
|
@@ -725,9 +795,15 @@ export declare class OperationProcessingError extends Error {
|
|
|
725
795
|
cause?: unknown;
|
|
726
796
|
});
|
|
727
797
|
}
|
|
798
|
+
export interface JWKSCacheOptions {
|
|
799
|
+
/**
|
|
800
|
+
* See {@link experimental_jwksCache}.
|
|
801
|
+
*/
|
|
802
|
+
[experimental_jwksCache]?: JWKSCacheInput;
|
|
803
|
+
}
|
|
728
804
|
export interface HttpRequestOptions {
|
|
729
805
|
/**
|
|
730
|
-
* An AbortSignal instance, or a factory returning one, to abort the HTTP
|
|
806
|
+
* An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
|
|
731
807
|
* this function's invocation.
|
|
732
808
|
*
|
|
733
809
|
* @example
|
|
@@ -740,7 +816,7 @@ export interface HttpRequestOptions {
|
|
|
740
816
|
*/
|
|
741
817
|
signal?: (() => AbortSignal) | AbortSignal;
|
|
742
818
|
/**
|
|
743
|
-
* Headers to additionally send with the HTTP
|
|
819
|
+
* Headers to additionally send with the HTTP request(s) triggered by this function's invocation.
|
|
744
820
|
*/
|
|
745
821
|
headers?: [string, string][] | Record<string, string> | Headers;
|
|
746
822
|
/**
|
|
@@ -1002,7 +1078,7 @@ export interface ProtectedResourceRequestOptions extends Omit<HttpRequestOptions
|
|
|
1002
1078
|
* @see [RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage](https://www.rfc-editor.org/rfc/rfc6750.html#section-2.1)
|
|
1003
1079
|
* @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html#name-protected-resource-access)
|
|
1004
1080
|
*/
|
|
1005
|
-
export declare function protectedResourceRequest(accessToken: string, method:
|
|
1081
|
+
export declare function protectedResourceRequest(accessToken: string, method: string, url: URL, headers?: Headers, body?: ReadableStream | Blob | ArrayBufferView | ArrayBuffer | FormData | URLSearchParams | string | null, options?: ProtectedResourceRequestOptions): Promise<Response>;
|
|
1006
1082
|
export interface UserInfoRequestOptions extends HttpRequestOptions, DPoPRequestOptions, UseMTLSAliasOptions {
|
|
1007
1083
|
}
|
|
1008
1084
|
/**
|
|
@@ -1053,8 +1129,14 @@ export interface UserInfoResponse {
|
|
|
1053
1129
|
readonly address?: UserInfoAddress;
|
|
1054
1130
|
readonly [claim: string]: JsonValue | undefined;
|
|
1055
1131
|
}
|
|
1132
|
+
export interface ExportedJWKSCache {
|
|
1133
|
+
jwks: JWKS;
|
|
1134
|
+
uat: number;
|
|
1135
|
+
}
|
|
1136
|
+
export type JWKSCacheInput = ExportedJWKSCache | Record<string, never>;
|
|
1056
1137
|
/**
|
|
1057
|
-
* DANGER ZONE
|
|
1138
|
+
* DANGER ZONE - This option has security implications that must be understood, assessed for
|
|
1139
|
+
* applicability, and accepted before use.
|
|
1058
1140
|
*
|
|
1059
1141
|
* Use this as a value to {@link processUserInfoResponse} `expectedSubject` parameter to skip the
|
|
1060
1142
|
* `sub` claim value check.
|
|
@@ -1433,6 +1515,11 @@ export interface IntrospectionResponse {
|
|
|
1433
1515
|
* @see [draft-ietf-oauth-jwt-introspection-response-12 - JWT Response for OAuth Token Introspection](https://www.ietf.org/archive/id/draft-ietf-oauth-jwt-introspection-response-12.html#section-5)
|
|
1434
1516
|
*/
|
|
1435
1517
|
export declare function processIntrospectionResponse(as: AuthorizationServer, client: Client, response: Response): Promise<IntrospectionResponse | OAuth2Error>;
|
|
1518
|
+
export interface JWKS {
|
|
1519
|
+
readonly keys: JWK[];
|
|
1520
|
+
}
|
|
1521
|
+
export interface ValidateJwtAuthResponseOptions extends HttpRequestOptions, JWKSCacheOptions {
|
|
1522
|
+
}
|
|
1436
1523
|
/**
|
|
1437
1524
|
* Same as {@link validateAuthResponse} but for signed JARM responses.
|
|
1438
1525
|
*
|
|
@@ -1449,7 +1536,9 @@ export declare function processIntrospectionResponse(as: AuthorizationServer, cl
|
|
|
1449
1536
|
*
|
|
1450
1537
|
* @see [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/openid-financial-api-jarm.html)
|
|
1451
1538
|
*/
|
|
1452
|
-
export declare function validateJwtAuthResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedState?: string | typeof expectNoState | typeof skipStateCheck, options?:
|
|
1539
|
+
export declare function validateJwtAuthResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedState?: string | typeof expectNoState | typeof skipStateCheck, options?: ValidateJwtAuthResponseOptions): Promise<URLSearchParams | OAuth2Error>;
|
|
1540
|
+
export interface ValidateDetachedSignatureResponseOptions extends HttpRequestOptions, JWKSCacheOptions {
|
|
1541
|
+
}
|
|
1453
1542
|
/**
|
|
1454
1543
|
* Same as {@link validateAuthResponse} but for FAPI 1.0 Advanced Detached Signature authorization
|
|
1455
1544
|
* responses.
|
|
@@ -1472,15 +1561,16 @@ export declare function validateJwtAuthResponse(as: AuthorizationServer, client:
|
|
|
1472
1561
|
*
|
|
1473
1562
|
* @see [Financial-grade API Security Profile 1.0 - Part 2: Advanced](https://openid.net/specs/openid-financial-api-part-2-1_0.html#id-token-as-detached-signature)
|
|
1474
1563
|
*/
|
|
1475
|
-
export declare function validateDetachedSignatureResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?:
|
|
1564
|
+
export declare function validateDetachedSignatureResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?: ValidateDetachedSignatureResponseOptions): Promise<URLSearchParams | OAuth2Error>;
|
|
1476
1565
|
/**
|
|
1477
|
-
* DANGER ZONE
|
|
1566
|
+
* DANGER ZONE - This option has security implications that must be understood, assessed for
|
|
1567
|
+
* applicability, and accepted before use.
|
|
1478
1568
|
*
|
|
1479
1569
|
* Use this as a value to {@link validateAuthResponse} `expectedState` parameter to skip the `state`
|
|
1480
|
-
* value check
|
|
1481
|
-
*
|
|
1570
|
+
* value check when you'll be validating such `state` value yourself instead. This should only be
|
|
1571
|
+
* done if you use a `state` parameter value that is integrity protected and bound to the browsing
|
|
1572
|
+
* session. One such mechanism to do so is described in an I-D
|
|
1482
1573
|
* [draft-bradley-oauth-jwt-encoded-state-09](https://datatracker.ietf.org/doc/html/draft-bradley-oauth-jwt-encoded-state-09).
|
|
1483
|
-
* It is expected you'll validate such `state` value yourself.
|
|
1484
1574
|
*/
|
|
1485
1575
|
export declare const skipStateCheck: unique symbol;
|
|
1486
1576
|
/**
|
|
@@ -1615,7 +1705,7 @@ export interface JWTAccessTokenClaims extends JWTPayload {
|
|
|
1615
1705
|
readonly scope?: string;
|
|
1616
1706
|
readonly [claim: string]: JsonValue | undefined;
|
|
1617
1707
|
}
|
|
1618
|
-
export interface ValidateJWTAccessTokenOptions extends HttpRequestOptions {
|
|
1708
|
+
export interface ValidateJWTAccessTokenOptions extends HttpRequestOptions, JWKSCacheOptions {
|
|
1619
1709
|
/**
|
|
1620
1710
|
* Indicates whether DPoP use is required.
|
|
1621
1711
|
*/
|
|
@@ -1631,7 +1721,10 @@ export interface ValidateJWTAccessTokenOptions extends HttpRequestOptions {
|
|
|
1631
1721
|
}
|
|
1632
1722
|
/**
|
|
1633
1723
|
* Validates use of JSON Web Token (JWT) OAuth 2.0 Access Tokens for a given {@link Request} as per
|
|
1634
|
-
* RFC 9068 and
|
|
1724
|
+
* RFC 6750, RFC 9068, and RFC 9449.
|
|
1725
|
+
*
|
|
1726
|
+
* The only supported means of sending access tokens is via the Authorization Request Header Field
|
|
1727
|
+
* method.
|
|
1635
1728
|
*
|
|
1636
1729
|
* This does validate the presence and type of all required claims as well as the values of the
|
|
1637
1730
|
* {@link JWTAccessTokenClaims.iss `iss`}, {@link JWTAccessTokenClaims.exp `exp`},
|
|
@@ -1655,6 +1748,7 @@ export interface ValidateJWTAccessTokenOptions extends HttpRequestOptions {
|
|
|
1655
1748
|
*
|
|
1656
1749
|
* @group JWT Access Tokens
|
|
1657
1750
|
*
|
|
1751
|
+
* @see [RFC 6750 - OAuth 2.0 Bearer Token Usage](https://www.rfc-editor.org/rfc/rfc6750.html)
|
|
1658
1752
|
* @see [RFC 9068 - JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens](https://www.rfc-editor.org/rfc/rfc9068.html)
|
|
1659
1753
|
* @see [RFC 9449 - OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP)](https://www.rfc-editor.org/rfc/rfc9449.html)
|
|
1660
1754
|
*/
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let USER_AGENT;
|
|
2
2
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
3
3
|
const NAME = 'oauth4webapi';
|
|
4
|
-
const VERSION = 'v2.
|
|
4
|
+
const VERSION = 'v2.11.0';
|
|
5
5
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
6
6
|
}
|
|
7
7
|
function looseInstanceOf(input, expected) {
|
|
@@ -19,6 +19,7 @@ function looseInstanceOf(input, expected) {
|
|
|
19
19
|
export const clockSkew = Symbol();
|
|
20
20
|
export const clockTolerance = Symbol();
|
|
21
21
|
export const customFetch = Symbol();
|
|
22
|
+
export const experimental_jwksCache = Symbol();
|
|
22
23
|
export const useMtlsAlias = Symbol();
|
|
23
24
|
const encoder = new TextEncoder();
|
|
24
25
|
const decoder = new TextDecoder();
|
|
@@ -729,31 +730,60 @@ export async function userInfoRequest(as, client, accessToken, options) {
|
|
|
729
730
|
[clockSkew]: getClockSkew(client),
|
|
730
731
|
});
|
|
731
732
|
}
|
|
732
|
-
let
|
|
733
|
+
let jwksMap;
|
|
734
|
+
function setJwksCache(as, jwks, uat, cache) {
|
|
735
|
+
jwksMap || (jwksMap = new WeakMap());
|
|
736
|
+
jwksMap.set(as, {
|
|
737
|
+
jwks,
|
|
738
|
+
uat,
|
|
739
|
+
get age() {
|
|
740
|
+
return epochTime() - this.uat;
|
|
741
|
+
},
|
|
742
|
+
});
|
|
743
|
+
if (cache) {
|
|
744
|
+
Object.assign(cache, { jwks: structuredClone(jwks), uat });
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function isFreshJwksCache(input) {
|
|
748
|
+
if (typeof input !== 'object' || input === null) {
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
if (!('uat' in input) || typeof input.uat !== 'number' || epochTime() - input.uat >= 300) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
if (!('jwks' in input) ||
|
|
755
|
+
!isJsonObject(input.jwks) ||
|
|
756
|
+
!Array.isArray(input.jwks.keys) ||
|
|
757
|
+
!Array.prototype.every.call(input.jwks.keys, isJsonObject)) {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
return true;
|
|
761
|
+
}
|
|
762
|
+
function clearJwksCache(as, cache) {
|
|
763
|
+
jwksMap?.delete(as);
|
|
764
|
+
delete cache?.jwks;
|
|
765
|
+
delete cache?.uat;
|
|
766
|
+
}
|
|
733
767
|
async function getPublicSigKeyFromIssuerJwksUri(as, options, header) {
|
|
734
768
|
const { alg, kid } = header;
|
|
735
769
|
checkSupportedJwsAlg(alg);
|
|
770
|
+
if (!jwksMap?.has(as) && isFreshJwksCache(options?.[experimental_jwksCache])) {
|
|
771
|
+
setJwksCache(as, options?.[experimental_jwksCache].jwks, options?.[experimental_jwksCache].uat);
|
|
772
|
+
}
|
|
736
773
|
let jwks;
|
|
737
774
|
let age;
|
|
738
|
-
|
|
739
|
-
if (jwksCache.has(as)) {
|
|
775
|
+
if (jwksMap?.has(as)) {
|
|
740
776
|
;
|
|
741
|
-
({ jwks, age } =
|
|
777
|
+
({ jwks, age } = jwksMap.get(as));
|
|
742
778
|
if (age >= 300) {
|
|
743
|
-
|
|
779
|
+
clearJwksCache(as, options?.[experimental_jwksCache]);
|
|
744
780
|
return getPublicSigKeyFromIssuerJwksUri(as, options, header);
|
|
745
781
|
}
|
|
746
782
|
}
|
|
747
783
|
else {
|
|
748
784
|
jwks = await jwksRequest(as, options).then(processJwksResponse);
|
|
749
785
|
age = 0;
|
|
750
|
-
|
|
751
|
-
jwks,
|
|
752
|
-
iat: epochTime(),
|
|
753
|
-
get age() {
|
|
754
|
-
return epochTime() - this.iat;
|
|
755
|
-
},
|
|
756
|
-
});
|
|
786
|
+
setJwksCache(as, jwks, epochTime(), options?.[experimental_jwksCache]);
|
|
757
787
|
}
|
|
758
788
|
let kty;
|
|
759
789
|
switch (alg.slice(0, 2)) {
|
|
@@ -798,7 +828,7 @@ async function getPublicSigKeyFromIssuerJwksUri(as, options, header) {
|
|
|
798
828
|
const { 0: jwk, length } = candidates;
|
|
799
829
|
if (!length) {
|
|
800
830
|
if (age >= 60) {
|
|
801
|
-
|
|
831
|
+
clearJwksCache(as, options?.[experimental_jwksCache]);
|
|
802
832
|
return getPublicSigKeyFromIssuerJwksUri(as, options, header);
|
|
803
833
|
}
|
|
804
834
|
throw new OPE('error when selecting a JWT verification key, no applicable keys found');
|
|
@@ -1073,7 +1103,7 @@ export async function processAuthorizationCodeOpenIDResponse(as, client, respons
|
|
|
1073
1103
|
}
|
|
1074
1104
|
if (maxAge !== skipAuthTimeCheck) {
|
|
1075
1105
|
if (typeof maxAge !== 'number' || maxAge < 0) {
|
|
1076
|
-
throw new TypeError('"
|
|
1106
|
+
throw new TypeError('"maxAge" must be a non-negative number');
|
|
1077
1107
|
}
|
|
1078
1108
|
const now = epochTime() + getClockSkew(client);
|
|
1079
1109
|
const tolerance = getClockTolerance(client);
|
|
@@ -1564,7 +1594,7 @@ export async function validateDetachedSignatureResponse(as, client, parameters,
|
|
|
1564
1594
|
}
|
|
1565
1595
|
if (maxAge !== skipAuthTimeCheck) {
|
|
1566
1596
|
if (typeof maxAge !== 'number' || maxAge < 0) {
|
|
1567
|
-
throw new TypeError('"
|
|
1597
|
+
throw new TypeError('"maxAge" must be a non-negative number');
|
|
1568
1598
|
}
|
|
1569
1599
|
const now = epochTime() + getClockSkew(client);
|
|
1570
1600
|
const tolerance = getClockTolerance(client);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth4webapi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "OAuth 2 / OpenID Connect for JavaScript Runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"access token",
|
|
@@ -67,29 +67,29 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@koa/cors": "^5.0.0",
|
|
69
69
|
"@types/koa__cors": "^5.0.0",
|
|
70
|
-
"@types/node": "^20.
|
|
71
|
-
"@types/oidc-provider": "^8.4.
|
|
70
|
+
"@types/node": "^20.14.5",
|
|
71
|
+
"@types/oidc-provider": "^8.4.4",
|
|
72
72
|
"@types/qunit": "^2.19.10",
|
|
73
|
-
"archiver": "^
|
|
74
|
-
"ava": "^
|
|
75
|
-
"chrome-launcher": "^1.1.
|
|
76
|
-
"edge-runtime": "^2.5.
|
|
77
|
-
"esbuild": "^0.
|
|
78
|
-
"jose": "^5.
|
|
79
|
-
"oidc-provider": "^8.4.
|
|
73
|
+
"archiver": "^7.0.1",
|
|
74
|
+
"ava": "^6.1.3",
|
|
75
|
+
"chrome-launcher": "^1.1.2",
|
|
76
|
+
"edge-runtime": "^2.5.10",
|
|
77
|
+
"esbuild": "^0.21.5",
|
|
78
|
+
"jose": "^5.4.0",
|
|
79
|
+
"oidc-provider": "^8.4.6",
|
|
80
80
|
"patch-package": "^8.0.0",
|
|
81
|
-
"prettier": "^3.2
|
|
81
|
+
"prettier": "^3.3.2",
|
|
82
82
|
"prettier-plugin-jsdoc": "^1.3.0",
|
|
83
|
-
"puppeteer-core": "^22.
|
|
84
|
-
"qunit": "^2.
|
|
83
|
+
"puppeteer-core": "^22.11.1",
|
|
84
|
+
"qunit": "^2.21.0",
|
|
85
85
|
"raw-body": "^2.5.2",
|
|
86
86
|
"selfsigned": "^2.4.1",
|
|
87
87
|
"timekeeper": "^2.3.1",
|
|
88
|
-
"tsx": "^4.
|
|
89
|
-
"typedoc": "^0.25.
|
|
88
|
+
"tsx": "^4.15.6",
|
|
89
|
+
"typedoc": "^0.25.13",
|
|
90
90
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
91
|
-
"typedoc-plugin-mdn-links": "^3.1.
|
|
92
|
-
"typescript": "
|
|
93
|
-
"undici": "^
|
|
91
|
+
"typedoc-plugin-mdn-links": "^3.1.30",
|
|
92
|
+
"typescript": "~5.4.5",
|
|
93
|
+
"undici": "^6.19.2"
|
|
94
94
|
}
|
|
95
95
|
}
|