@orangecheck/me-client 0.53.2 → 0.53.4
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/CHANGELOG.md +15 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/server.js +4 -4
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +4 -4
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -330,11 +330,11 @@ async function fetchEnvelopeJwks(issuer, ttlMs, maxStaleMs = DEFAULT_MAX_STALE_M
|
|
|
330
330
|
if (!json || !Array.isArray(json.keys)) {
|
|
331
331
|
throw new Error(`envelope JWKS at ${url} did not return {keys:[\u2026]}`);
|
|
332
332
|
}
|
|
333
|
-
const keys =
|
|
333
|
+
const keys = /* @__PURE__ */ new Map();
|
|
334
334
|
for (const k of json.keys) {
|
|
335
335
|
if (typeof k.kid !== "string") continue;
|
|
336
336
|
try {
|
|
337
|
-
keys
|
|
337
|
+
keys.set(k.kid, await importJWK(k, "EdDSA"));
|
|
338
338
|
} catch {
|
|
339
339
|
}
|
|
340
340
|
}
|
|
@@ -512,11 +512,11 @@ async function verifyActivityAttestation(bundle, options = {}) {
|
|
|
512
512
|
const maxStale = options.jwksMaxStaleMs ?? DEFAULT_MAX_STALE_MS;
|
|
513
513
|
try {
|
|
514
514
|
let entry = await fetchEnvelopeJwks(issuer, ttl, maxStale);
|
|
515
|
-
key = entry.keys
|
|
515
|
+
key = entry.keys.get(bundle.kid) ?? null;
|
|
516
516
|
if (!key && Date.now() - (lastForcedRefresh.get(issuer) ?? 0) >= FORCED_REFRESH_MIN_INTERVAL_MS) {
|
|
517
517
|
lastForcedRefresh.set(issuer, Date.now());
|
|
518
518
|
entry = await fetchEnvelopeJwks(issuer, 0, maxStale);
|
|
519
|
-
key = entry.keys
|
|
519
|
+
key = entry.keys.get(bundle.kid) ?? null;
|
|
520
520
|
}
|
|
521
521
|
checks.push({
|
|
522
522
|
ok: !!key,
|