jose 4.13.0 → 4.13.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 +1 -1
- package/dist/browser/jwks/remote.js +14 -26
- package/dist/node/cjs/jwks/remote.js +14 -26
- package/dist/node/esm/jwks/remote.js +14 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,33 +46,21 @@ class RemoteJWKSet extends LocalJWKSet {
|
|
|
46
46
|
}
|
|
47
47
|
async reload() {
|
|
48
48
|
if (this._pendingFetch && isCloudflareWorkers()) {
|
|
49
|
-
|
|
50
|
-
const isDone = () => {
|
|
51
|
-
if (this._pendingFetch === undefined) {
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
setTimeout(isDone, 5);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
isDone();
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (!this._pendingFetch) {
|
|
62
|
-
this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options)
|
|
63
|
-
.then((json) => {
|
|
64
|
-
if (!isJWKSLike(json)) {
|
|
65
|
-
throw new JWKSInvalid('JSON Web Key Set malformed');
|
|
66
|
-
}
|
|
67
|
-
this._jwks = { keys: json.keys };
|
|
68
|
-
this._jwksTimestamp = Date.now();
|
|
69
|
-
this._pendingFetch = undefined;
|
|
70
|
-
})
|
|
71
|
-
.catch((err) => {
|
|
72
|
-
this._pendingFetch = undefined;
|
|
73
|
-
throw err;
|
|
74
|
-
});
|
|
49
|
+
this._pendingFetch = undefined;
|
|
75
50
|
}
|
|
51
|
+
this._pendingFetch || (this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options)
|
|
52
|
+
.then((json) => {
|
|
53
|
+
if (!isJWKSLike(json)) {
|
|
54
|
+
throw new JWKSInvalid('JSON Web Key Set malformed');
|
|
55
|
+
}
|
|
56
|
+
this._jwks = { keys: json.keys };
|
|
57
|
+
this._jwksTimestamp = Date.now();
|
|
58
|
+
this._pendingFetch = undefined;
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
this._pendingFetch = undefined;
|
|
62
|
+
throw err;
|
|
63
|
+
}));
|
|
76
64
|
await this._pendingFetch;
|
|
77
65
|
}
|
|
78
66
|
}
|
|
@@ -49,33 +49,21 @@ class RemoteJWKSet extends local_js_1.LocalJWKSet {
|
|
|
49
49
|
}
|
|
50
50
|
async reload() {
|
|
51
51
|
if (this._pendingFetch && (0, env_js_1.isCloudflareWorkers)()) {
|
|
52
|
-
|
|
53
|
-
const isDone = () => {
|
|
54
|
-
if (this._pendingFetch === undefined) {
|
|
55
|
-
resolve();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
setTimeout(isDone, 5);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
isDone();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (!this._pendingFetch) {
|
|
65
|
-
this._pendingFetch = (0, fetch_jwks_js_1.default)(this._url, this._timeoutDuration, this._options)
|
|
66
|
-
.then((json) => {
|
|
67
|
-
if (!(0, local_js_1.isJWKSLike)(json)) {
|
|
68
|
-
throw new errors_js_1.JWKSInvalid('JSON Web Key Set malformed');
|
|
69
|
-
}
|
|
70
|
-
this._jwks = { keys: json.keys };
|
|
71
|
-
this._jwksTimestamp = Date.now();
|
|
72
|
-
this._pendingFetch = undefined;
|
|
73
|
-
})
|
|
74
|
-
.catch((err) => {
|
|
75
|
-
this._pendingFetch = undefined;
|
|
76
|
-
throw err;
|
|
77
|
-
});
|
|
52
|
+
this._pendingFetch = undefined;
|
|
78
53
|
}
|
|
54
|
+
this._pendingFetch || (this._pendingFetch = (0, fetch_jwks_js_1.default)(this._url, this._timeoutDuration, this._options)
|
|
55
|
+
.then((json) => {
|
|
56
|
+
if (!(0, local_js_1.isJWKSLike)(json)) {
|
|
57
|
+
throw new errors_js_1.JWKSInvalid('JSON Web Key Set malformed');
|
|
58
|
+
}
|
|
59
|
+
this._jwks = { keys: json.keys };
|
|
60
|
+
this._jwksTimestamp = Date.now();
|
|
61
|
+
this._pendingFetch = undefined;
|
|
62
|
+
})
|
|
63
|
+
.catch((err) => {
|
|
64
|
+
this._pendingFetch = undefined;
|
|
65
|
+
throw err;
|
|
66
|
+
}));
|
|
79
67
|
await this._pendingFetch;
|
|
80
68
|
}
|
|
81
69
|
}
|
|
@@ -46,33 +46,21 @@ class RemoteJWKSet extends LocalJWKSet {
|
|
|
46
46
|
}
|
|
47
47
|
async reload() {
|
|
48
48
|
if (this._pendingFetch && isCloudflareWorkers()) {
|
|
49
|
-
|
|
50
|
-
const isDone = () => {
|
|
51
|
-
if (this._pendingFetch === undefined) {
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
setTimeout(isDone, 5);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
isDone();
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (!this._pendingFetch) {
|
|
62
|
-
this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options)
|
|
63
|
-
.then((json) => {
|
|
64
|
-
if (!isJWKSLike(json)) {
|
|
65
|
-
throw new JWKSInvalid('JSON Web Key Set malformed');
|
|
66
|
-
}
|
|
67
|
-
this._jwks = { keys: json.keys };
|
|
68
|
-
this._jwksTimestamp = Date.now();
|
|
69
|
-
this._pendingFetch = undefined;
|
|
70
|
-
})
|
|
71
|
-
.catch((err) => {
|
|
72
|
-
this._pendingFetch = undefined;
|
|
73
|
-
throw err;
|
|
74
|
-
});
|
|
49
|
+
this._pendingFetch = undefined;
|
|
75
50
|
}
|
|
51
|
+
this._pendingFetch || (this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options)
|
|
52
|
+
.then((json) => {
|
|
53
|
+
if (!isJWKSLike(json)) {
|
|
54
|
+
throw new JWKSInvalid('JSON Web Key Set malformed');
|
|
55
|
+
}
|
|
56
|
+
this._jwks = { keys: json.keys };
|
|
57
|
+
this._jwksTimestamp = Date.now();
|
|
58
|
+
this._pendingFetch = undefined;
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
this._pendingFetch = undefined;
|
|
62
|
+
throw err;
|
|
63
|
+
}));
|
|
76
64
|
await this._pendingFetch;
|
|
77
65
|
}
|
|
78
66
|
}
|
package/package.json
CHANGED