oauth4webapi 2.6.0 → 2.7.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 +2 -2
- package/build/index.d.ts +3 -2
- package/build/index.js +7 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ The following features are currently in scope and implemented in this software:
|
|
|
20
20
|
|
|
21
21
|
[<img width="96" height="50" align="right" src="https://user-images.githubusercontent.com/241506/166977513-7cd710a9-7f60-4944-aebe-a658e9f36375.png" alt="OpenID Certification">](#certification)
|
|
22
22
|
|
|
23
|
-
[Filip Skokan](https://github.com/panva) has certified that [this software](https://github.com/panva/oauth4webapi) conforms to the Basic
|
|
23
|
+
[Filip Skokan](https://github.com/panva) has certified that [this software](https://github.com/panva/oauth4webapi) conforms to the Basic, FAPI 1.0 Advanced, FAPI 2.0 Security Profile, and FAPI 2.0 Message Signing Relying Party Conformance Profiles of the OpenID Connect™ protocol.
|
|
24
24
|
|
|
25
25
|
## [💗 Help the project](https://github.com/sponsors/panva)
|
|
26
26
|
|
|
@@ -43,7 +43,7 @@ import * as oauth2 from 'oauth4webapi'
|
|
|
43
43
|
**`example`** Deno import
|
|
44
44
|
|
|
45
45
|
```js
|
|
46
|
-
import * as oauth2 from 'https://deno.land/x/oauth4webapi@v2.
|
|
46
|
+
import * as oauth2 from 'https://deno.land/x/oauth4webapi@v2.7.0/mod.ts'
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
- Authorization Code Flow - OpenID Connect [source](examples/code.ts), or plain OAuth 2 [source](examples/oauth.ts)
|
package/build/index.d.ts
CHANGED
|
@@ -1370,7 +1370,8 @@ export declare function validateJwtAuthResponse(as: AuthorizationServer, client:
|
|
|
1370
1370
|
*
|
|
1371
1371
|
* @param as Authorization Server Metadata.
|
|
1372
1372
|
* @param client Client Metadata.
|
|
1373
|
-
* @param parameters Authorization Response
|
|
1373
|
+
* @param parameters Authorization Response parameters as URLSearchParams or an instance of URL with
|
|
1374
|
+
* parameters in a fragment/hash.
|
|
1374
1375
|
* @param expectedNonce Expected ID Token `nonce` claim value.
|
|
1375
1376
|
* @param expectedState Expected `state` parameter value. Default is {@link expectNoState}.
|
|
1376
1377
|
* @param maxAge ID Token {@link IDToken.auth_time `auth_time`} claim value will be checked to be
|
|
@@ -1386,7 +1387,7 @@ export declare function validateJwtAuthResponse(as: AuthorizationServer, client:
|
|
|
1386
1387
|
*
|
|
1387
1388
|
* @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)
|
|
1388
1389
|
*/
|
|
1389
|
-
export declare function experimental_validateDetachedSignatureResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?: HttpRequestOptions): Promise<URLSearchParams | OAuth2Error>;
|
|
1390
|
+
export declare function experimental_validateDetachedSignatureResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedNonce: string, expectedState?: string | typeof expectNoState, maxAge?: number | typeof skipAuthTimeCheck, options?: HttpRequestOptions): Promise<URLSearchParams | OAuth2Error>;
|
|
1390
1391
|
/**
|
|
1391
1392
|
* DANGER ZONE
|
|
1392
1393
|
*
|
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.7.0';
|
|
5
5
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
6
6
|
}
|
|
7
7
|
function looseInstanceOf(input, expected) {
|
|
@@ -1465,6 +1465,12 @@ async function idTokenHashMatches(data, actual, alg, key) {
|
|
|
1465
1465
|
export async function experimental_validateDetachedSignatureResponse(as, client, parameters, expectedNonce, expectedState, maxAge, options) {
|
|
1466
1466
|
assertAs(as);
|
|
1467
1467
|
assertClient(client);
|
|
1468
|
+
if (parameters instanceof URL) {
|
|
1469
|
+
if (!parameters.hash.length) {
|
|
1470
|
+
throw new TypeError('"parameters" as an instance of URL must contain a hash (fragment) with the Authorization Response parameters');
|
|
1471
|
+
}
|
|
1472
|
+
parameters = new URLSearchParams(parameters.hash.slice(1));
|
|
1473
|
+
}
|
|
1468
1474
|
if (!(parameters instanceof URLSearchParams)) {
|
|
1469
1475
|
throw new TypeError('"parameters" must be an instance of URLSearchParams');
|
|
1470
1476
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth4webapi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "OAuth 2 / OpenID Connect for JavaScript Runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -65,18 +65,18 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@koa/cors": "^5.0.0",
|
|
67
67
|
"@types/koa__cors": "^5.0.0",
|
|
68
|
-
"@types/node": "^20.
|
|
68
|
+
"@types/node": "^20.11.5",
|
|
69
69
|
"@types/oidc-provider": "^8.4.3",
|
|
70
|
-
"@types/qunit": "^2.19.
|
|
70
|
+
"@types/qunit": "^2.19.10",
|
|
71
71
|
"archiver": "^6.0.1",
|
|
72
72
|
"ava": "^5.3.1",
|
|
73
73
|
"chrome-launcher": "^1.1.0",
|
|
74
74
|
"edge-runtime": "^2.5.7",
|
|
75
75
|
"esbuild": "^0.19.11",
|
|
76
76
|
"jose": "^5.2.0",
|
|
77
|
-
"oidc-provider": "^8.4.
|
|
77
|
+
"oidc-provider": "^8.4.5",
|
|
78
78
|
"patch-package": "^8.0.0",
|
|
79
|
-
"prettier": "^3.
|
|
79
|
+
"prettier": "^3.2.4",
|
|
80
80
|
"prettier-plugin-jsdoc": "^1.3.0",
|
|
81
81
|
"puppeteer-core": "^21.7.0",
|
|
82
82
|
"qunit": "^2.20.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"tsx": "^4.7.0",
|
|
87
87
|
"typedoc": "^0.25.7",
|
|
88
88
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
89
|
-
"typedoc-plugin-mdn-links": "^3.1.
|
|
89
|
+
"typedoc-plugin-mdn-links": "^3.1.12",
|
|
90
90
|
"typescript": "^5.3.3",
|
|
91
91
|
"undici": "^5.28.2"
|
|
92
92
|
}
|