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