jose 4.10.4 → 4.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# jose
|
|
2
2
|
|
|
3
|
-
> "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, and other Web-interoperable runtimes.
|
|
3
|
+
> "JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
|
|
4
4
|
|
|
5
5
|
## Implemented specs & features
|
|
6
6
|
|
|
@@ -83,11 +83,11 @@ import * as jose from 'https://deno.land/x/jose/index.ts'
|
|
|
83
83
|
The supported JavaScript runtimes include ones that support the utilized Web API globals and standard built-in objects or are Node.js
|
|
84
84
|
|
|
85
85
|
These are _(this is not an exhaustive list)_:
|
|
86
|
+
- [Bun](https://github.com/panva/jose/issues/471)
|
|
86
87
|
- [Browsers](https://github.com/panva/jose/issues/263)
|
|
87
88
|
- [Cloudflare Workers](https://github.com/panva/jose/issues/265)
|
|
88
89
|
- [Deno](https://github.com/panva/jose/issues/266)
|
|
89
90
|
- [Electron](https://github.com/panva/jose/issues/264)
|
|
90
|
-
- [Netlify Edge](https://github.com/panva/jose/issues/266)
|
|
91
91
|
- [Node.js](https://github.com/panva/jose/issues/262)
|
|
92
92
|
- [Vercel's Edge Runtime](https://github.com/panva/jose/issues/301)
|
|
93
93
|
|
|
@@ -99,6 +99,7 @@ export async function importPKCS8(pkcs8, alg, options) {
|
|
|
99
99
|
return importPrivate(pkcs8, alg, options);
|
|
100
100
|
}
|
|
101
101
|
export async function importJWK(jwk, alg, octAsKeyObject) {
|
|
102
|
+
var _a;
|
|
102
103
|
if (!isObject(jwk)) {
|
|
103
104
|
throw new TypeError('JWK must be an object');
|
|
104
105
|
}
|
|
@@ -113,7 +114,7 @@ export async function importJWK(jwk, alg, octAsKeyObject) {
|
|
|
113
114
|
}
|
|
114
115
|
octAsKeyObject !== null && octAsKeyObject !== void 0 ? octAsKeyObject : (octAsKeyObject = jwk.ext !== true);
|
|
115
116
|
if (octAsKeyObject) {
|
|
116
|
-
return asKeyObject({ ...jwk, alg, ext: false });
|
|
117
|
+
return asKeyObject({ ...jwk, alg, ext: (_a = jwk.ext) !== null && _a !== void 0 ? _a : false });
|
|
117
118
|
}
|
|
118
119
|
return decodeBase64URL(jwk.k);
|
|
119
120
|
case 'RSA':
|
|
@@ -105,6 +105,7 @@ async function importPKCS8(pkcs8, alg, options) {
|
|
|
105
105
|
}
|
|
106
106
|
exports.importPKCS8 = importPKCS8;
|
|
107
107
|
async function importJWK(jwk, alg, octAsKeyObject) {
|
|
108
|
+
var _a;
|
|
108
109
|
if (!(0, is_object_js_1.default)(jwk)) {
|
|
109
110
|
throw new TypeError('JWK must be an object');
|
|
110
111
|
}
|
|
@@ -119,7 +120,7 @@ async function importJWK(jwk, alg, octAsKeyObject) {
|
|
|
119
120
|
}
|
|
120
121
|
octAsKeyObject !== null && octAsKeyObject !== void 0 ? octAsKeyObject : (octAsKeyObject = jwk.ext !== true);
|
|
121
122
|
if (octAsKeyObject) {
|
|
122
|
-
return (0, jwk_to_key_js_1.default)({ ...jwk, alg, ext: false });
|
|
123
|
+
return (0, jwk_to_key_js_1.default)({ ...jwk, alg, ext: (_a = jwk.ext) !== null && _a !== void 0 ? _a : false });
|
|
123
124
|
}
|
|
124
125
|
return (0, base64url_js_1.decode)(jwk.k);
|
|
125
126
|
case 'RSA':
|
|
@@ -99,6 +99,7 @@ export async function importPKCS8(pkcs8, alg, options) {
|
|
|
99
99
|
return importPrivate(pkcs8, alg, options);
|
|
100
100
|
}
|
|
101
101
|
export async function importJWK(jwk, alg, octAsKeyObject) {
|
|
102
|
+
var _a;
|
|
102
103
|
if (!isObject(jwk)) {
|
|
103
104
|
throw new TypeError('JWK must be an object');
|
|
104
105
|
}
|
|
@@ -113,7 +114,7 @@ export async function importJWK(jwk, alg, octAsKeyObject) {
|
|
|
113
114
|
}
|
|
114
115
|
octAsKeyObject !== null && octAsKeyObject !== void 0 ? octAsKeyObject : (octAsKeyObject = jwk.ext !== true);
|
|
115
116
|
if (octAsKeyObject) {
|
|
116
|
-
return asKeyObject({ ...jwk, alg, ext: false });
|
|
117
|
+
return asKeyObject({ ...jwk, alg, ext: (_a = jwk.ext) !== null && _a !== void 0 ? _a : false });
|
|
117
118
|
}
|
|
118
119
|
return decodeBase64URL(jwk.k);
|
|
119
120
|
case 'RSA':
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jose",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, and other Web-interoperable runtimes",
|
|
3
|
+
"version": "4.11.0",
|
|
4
|
+
"description": "'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
7
|
+
"bun",
|
|
7
8
|
"cloudflare",
|
|
8
9
|
"compact",
|
|
9
10
|
"decode",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"exports": {
|
|
62
63
|
".": {
|
|
63
64
|
"types": "./dist/types/index.d.ts",
|
|
65
|
+
"bun": "./dist/browser/index.js",
|
|
64
66
|
"deno": "./dist/browser/index.js",
|
|
65
67
|
"browser": "./dist/browser/index.js",
|
|
66
68
|
"worker": "./dist/browser/index.js",
|