oauth4webapi 1.3.0 → 1.4.1
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 +1 -1
- package/build/index.js +2 -1
- package/package.json +14 -13
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ import * as oauth2 from 'oauth4webapi'
|
|
|
39
39
|
**`example`** Deno import
|
|
40
40
|
|
|
41
41
|
```js
|
|
42
|
-
import * as oauth2 from 'https://deno.land/x/oauth4webapi/
|
|
42
|
+
import * as oauth2 from 'https://deno.land/x/oauth4webapi/mod.ts'
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
- Authorization Code Flow - OpenID Connect [source](examples/code.ts), or plain OAuth 2 [source](examples/oauth.ts)
|
|
@@ -58,10 +58,10 @@ The supported JavaScript runtimes include ones that support the utilized Web API
|
|
|
58
58
|
|
|
59
59
|
These are _(this is not an exhaustive list)_:
|
|
60
60
|
- Browsers
|
|
61
|
+
- Bun
|
|
61
62
|
- Cloudflare Workers
|
|
62
63
|
- Deno
|
|
63
64
|
- Electron
|
|
64
|
-
- Netlify Edge
|
|
65
65
|
- Node.js ([runtime flags may be needed](https://github.com/panva/oauth4webapi/issues/8))
|
|
66
66
|
- Vercel's Edge Runtime
|
|
67
67
|
|
package/build/index.d.ts
CHANGED
|
@@ -1084,7 +1084,7 @@ export declare function processJwksResponse(response: Response): Promise<JsonWeb
|
|
|
1084
1084
|
*
|
|
1085
1085
|
* @returns Validated Authorization Response parameters or Authorization Error Response.
|
|
1086
1086
|
*
|
|
1087
|
-
* @see [
|
|
1087
|
+
* @see [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/openid-financial-api-jarm.html)
|
|
1088
1088
|
*/
|
|
1089
1089
|
export declare function validateJwtAuthResponse(as: AuthorizationServer, client: Client, parameters: URLSearchParams | URL, expectedState?: string | typeof expectNoState | typeof skipStateCheck, options?: HttpRequestOptions): Promise<CallbackParameters | OAuth2Error>;
|
|
1090
1090
|
/**
|
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 = 'v1.
|
|
4
|
+
const VERSION = 'v1.4.1';
|
|
5
5
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
6
6
|
}
|
|
7
7
|
const encoder = new TextEncoder();
|
|
@@ -771,6 +771,7 @@ export async function processUserInfoResponse(as, client, expectedSubject, respo
|
|
|
771
771
|
}
|
|
772
772
|
async function authenticatedRequest(as, client, method, url, body, headers, options) {
|
|
773
773
|
await clientAuthentication(as, client, body, headers, options?.clientPrivateKey);
|
|
774
|
+
headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
774
775
|
return fetch(url.href, {
|
|
775
776
|
body,
|
|
776
777
|
headers,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth4webapi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "OAuth 2 / OpenID Connect for Web Platform API JavaScript runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"authorization",
|
|
9
9
|
"basic",
|
|
10
10
|
"browser",
|
|
11
|
+
"bun",
|
|
11
12
|
"certified",
|
|
12
13
|
"client",
|
|
13
14
|
"cloudflare",
|
|
@@ -45,38 +46,38 @@
|
|
|
45
46
|
"build/index.d.ts"
|
|
46
47
|
],
|
|
47
48
|
"scripts": {
|
|
48
|
-
"_format": "find src test tap examples conformance -type f -name '*.ts' -o -name '*.mjs' | xargs prettier",
|
|
49
|
+
"_format": "find src test tap examples conformance -type f -name '*.ts' -o -name '*.mjs' -name '*.cjs' | xargs prettier",
|
|
49
50
|
"build": "rm -rf build && tsc && tsc --declaration true --emitDeclarationOnly true --removeComments false && tsc -p test && tsc -p examples && tsc -p conformance && tsc -p tap",
|
|
50
|
-
"conformance": "bash -c '
|
|
51
|
+
"conformance": "bash -c 'source .node_flags.sh && ava --config conformance/ava.config.ts'",
|
|
51
52
|
"docs": "patch-package && typedoc",
|
|
52
53
|
"format": "npm run _format -- --write",
|
|
53
54
|
"format-check": "npm run _format -- --check",
|
|
54
55
|
"prepack": "npm run format && npm run docs && ./examples/.update-diffs.sh && git diff --quiet && npm run test && npm run build",
|
|
56
|
+
"tap:browsers": "./tap/.browsers.sh",
|
|
57
|
+
"tap:bun": "./tap/.bun.sh",
|
|
55
58
|
"tap:deno": "./tap/.deno.sh",
|
|
56
59
|
"tap:edge-runtime": "./tap/.edge-runtime.sh",
|
|
60
|
+
"tap:electron": "./tap/.electron.sh",
|
|
57
61
|
"tap:node": "bash -c './tap/.node.sh'",
|
|
58
62
|
"tap:workers": "./tap/.workers.sh",
|
|
59
|
-
"tap:browsers": "./tap/.browsers.sh",
|
|
60
63
|
"test": "bash -c 'source .node_flags.sh && ava'"
|
|
61
64
|
},
|
|
62
65
|
"devDependencies": {
|
|
63
66
|
"@esbuild-kit/esm-loader": "^2.5.0",
|
|
64
|
-
"@types/node": "^18.11.
|
|
67
|
+
"@types/node": "^18.11.9",
|
|
65
68
|
"@types/qunit": "^2.19.3",
|
|
66
|
-
"ava": "^5.0
|
|
67
|
-
"edge-runtime": "^2.0.
|
|
68
|
-
"
|
|
69
|
+
"ava": "^5.1.0",
|
|
70
|
+
"edge-runtime": "^2.0.2",
|
|
71
|
+
"esbuild": "^0.15.14",
|
|
72
|
+
"jose": "^4.11.0",
|
|
69
73
|
"patch-package": "^6.5.0",
|
|
70
74
|
"prettier": "^2.7.1",
|
|
71
75
|
"prettier-plugin-jsdoc": "^0.4.2",
|
|
72
76
|
"qunit": "^2.19.3",
|
|
73
|
-
"testcafe": "^2.0.1",
|
|
74
|
-
"testcafe-browser-provider-browserstack": "^1.14.0",
|
|
75
77
|
"timekeeper": "^2.2.0",
|
|
76
|
-
"typedoc": "^0.23.
|
|
78
|
+
"typedoc": "^0.23.20",
|
|
77
79
|
"typedoc-plugin-markdown": "^3.13.6",
|
|
78
80
|
"typescript": "^4.8.4",
|
|
79
|
-
"undici": "^5.12.0"
|
|
80
|
-
"workerd": "^1.20220926.3"
|
|
81
|
+
"undici": "^5.12.0"
|
|
81
82
|
}
|
|
82
83
|
}
|