@broberg/sso 0.19.0 → 0.19.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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkMZE4TPFU_cjs = require('./chunk-MZE4TPFU.cjs');
3
+ var chunk2F3RPYJV_cjs = require('./chunk-2F3RPYJV.cjs');
4
4
  var fs = require('fs');
5
5
  var http = require('http');
6
6
  var jose = require('jose');
@@ -48,37 +48,37 @@ async function verifyDpopProof(proof, o) {
48
48
  try {
49
49
  header = jose.decodeProtectedHeader(proof);
50
50
  } catch {
51
- throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof is not a JWS");
51
+ throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof is not a JWS");
52
52
  }
53
- if (header.typ !== "dpop+jwt") throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof has typ ${JSON.stringify(header.typ)}, not "dpop+jwt"`);
54
- if (!header.alg || !ASYMMETRIC.has(header.alg)) throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof alg ${JSON.stringify(header.alg)} is not an accepted asymmetric algorithm`);
53
+ if (header.typ !== "dpop+jwt") throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof has typ ${JSON.stringify(header.typ)}, not "dpop+jwt"`);
54
+ if (!header.alg || !ASYMMETRIC.has(header.alg)) throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof alg ${JSON.stringify(header.alg)} is not an accepted asymmetric algorithm`);
55
55
  const jwk = header.jwk;
56
- if (!jwk || typeof jwk !== "object") throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof carries no jwk");
57
- if ("d" in jwk) throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof jwk contains a private key");
56
+ if (!jwk || typeof jwk !== "object") throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof carries no jwk");
57
+ if ("d" in jwk) throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof jwk contains a private key");
58
58
  let payload;
59
59
  try {
60
60
  const key = await jose.importJWK(jwk, header.alg);
61
61
  ({ payload } = await jose.jwtVerify(proof, key, { typ: "dpop+jwt", algorithms: [header.alg] }));
62
62
  } catch (e) {
63
- throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof signature rejected: ${e instanceof Error ? e.message : String(e)}`);
63
+ throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof signature rejected: ${e instanceof Error ? e.message : String(e)}`);
64
64
  }
65
- if (await jose.calculateJwkThumbprint(jwk) !== o.jkt) throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof key does not match the ticket's cnf.jkt");
66
- if (payload.htm !== o.method.toUpperCase()) throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof is for ${JSON.stringify(payload.htm)}, the request is ${o.method.toUpperCase()}`);
65
+ if (await jose.calculateJwkThumbprint(jwk) !== o.jkt) throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof key does not match the ticket's cnf.jkt");
66
+ if (payload.htm !== o.method.toUpperCase()) throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof is for ${JSON.stringify(payload.htm)}, the request is ${o.method.toUpperCase()}`);
67
67
  let htu;
68
68
  try {
69
69
  htu = normalizeHtu(String(payload.htu));
70
70
  } catch {
71
- throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof htu is not a URL");
71
+ throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof htu is not a URL");
72
72
  }
73
- if (htu !== normalizeHtu(o.url)) throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof is for ${htu}, the request is ${normalizeHtu(o.url)}`);
73
+ if (htu !== normalizeHtu(o.url)) throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof is for ${htu}, the request is ${normalizeHtu(o.url)}`);
74
74
  const nowSec = Math.floor(o.now() / 1e3);
75
75
  if (typeof payload.iat !== "number" || Math.abs(nowSec - payload.iat) > o.iatWindowSec) {
76
- throw new chunkMZE4TPFU_cjs.SsoError(`DPoP proof iat is outside \xB1${o.iatWindowSec}s`);
76
+ throw new chunk2F3RPYJV_cjs.SsoError(`DPoP proof iat is outside \xB1${o.iatWindowSec}s`);
77
77
  }
78
- if (payload.ath !== await accessTokenHash(o.ticket)) throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof ath does not match this ticket");
79
- if (typeof payload.jti !== "string" || payload.jti === "") throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof has no jti");
78
+ if (payload.ath !== await accessTokenHash(o.ticket)) throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof ath does not match this ticket");
79
+ if (typeof payload.jti !== "string" || payload.jti === "") throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof has no jti");
80
80
  if (await o.replay.seen(`${o.jkt}:${payload.jti}`, o.iatWindowSec * 2 * 1e3)) {
81
- throw new chunkMZE4TPFU_cjs.SsoError("DPoP proof was already used (jti replay)");
81
+ throw new chunk2F3RPYJV_cjs.SsoError("DPoP proof was already used (jti replay)");
82
82
  }
83
83
  }
84
84
 
@@ -241,10 +241,10 @@ function createTicketVerifier(options) {
241
241
  now = () => Date.now()
242
242
  } = options;
243
243
  const replayStore = options.replayStore ?? createMemoryReplayStore(now);
244
- if (!issuer) throw new chunkMZE4TPFU_cjs.SsoError("createTicketVerifier needs an issuer");
245
- if (!audience) throw new chunkMZE4TPFU_cjs.SsoError("createTicketVerifier needs this receiver's audience");
244
+ if (!issuer) throw new chunk2F3RPYJV_cjs.SsoError("createTicketVerifier needs an issuer");
245
+ if (!audience) throw new chunk2F3RPYJV_cjs.SsoError("createTicketVerifier needs this receiver's audience");
246
246
  let cachePromise = null;
247
- const cacheFor = (jwksUri) => chunkMZE4TPFU_cjs.createJwksCache({
247
+ const cacheFor = (jwksUri) => chunk2F3RPYJV_cjs.createJwksCache({
248
248
  jwksUri,
249
249
  fetchImpl,
250
250
  ...options.warmUp ? { warmUp: true } : {},
@@ -260,12 +260,12 @@ function createTicketVerifier(options) {
260
260
  if (!res.ok) throw new Error(`answered ${res.status}`);
261
261
  doc = await res.json();
262
262
  } catch (cause) {
263
- throw new chunkMZE4TPFU_cjs.JwksUnavailableError(`${url}: ${cause instanceof Error ? cause.message : String(cause)}`);
263
+ throw new chunk2F3RPYJV_cjs.JwksUnavailableError(`${url}: ${cause instanceof Error ? cause.message : String(cause)}`);
264
264
  }
265
265
  if (doc.issuer !== issuer) {
266
- throw new chunkMZE4TPFU_cjs.SsoError(`issuer is ${issuer} but ${url} says ${doc.issuer} \u2014 they must match exactly`);
266
+ throw new chunk2F3RPYJV_cjs.SsoError(`issuer is ${issuer} but ${url} says ${doc.issuer} \u2014 they must match exactly`);
267
267
  }
268
- if (!doc.jwks_uri) throw new chunkMZE4TPFU_cjs.SsoError(`${url} names no jwks_uri`);
268
+ if (!doc.jwks_uri) throw new chunk2F3RPYJV_cjs.SsoError(`${url} names no jwks_uri`);
269
269
  return cacheFor(doc.jwks_uri);
270
270
  })().catch((err) => {
271
271
  cachePromise = null;
@@ -281,51 +281,51 @@ function createTicketVerifier(options) {
281
281
  try {
282
282
  header = jose.decodeProtectedHeader(token);
283
283
  } catch {
284
- throw new chunkMZE4TPFU_cjs.SsoError("ticket is not a JWS");
284
+ throw new chunk2F3RPYJV_cjs.SsoError("ticket is not a JWS");
285
285
  }
286
- if (!header.kid) throw new chunkMZE4TPFU_cjs.SsoError("ticket has no kid \u2014 cannot pick a signing key");
287
- if (header.typ === "logout+jwt") throw new chunkMZE4TPFU_cjs.SsoError("a logout token is not a ticket");
286
+ if (!header.kid) throw new chunk2F3RPYJV_cjs.SsoError("ticket has no kid \u2014 cannot pick a signing key");
287
+ if (header.typ === "logout+jwt") throw new chunk2F3RPYJV_cjs.SsoError("a logout token is not a ticket");
288
288
  const cache = await keys();
289
289
  let payload;
290
290
  try {
291
291
  ({ payload } = await jose.jwtVerify(token, async () => cache.getKey(header.kid, header.alg ?? "EdDSA"), {
292
292
  issuer,
293
293
  audience,
294
- algorithms: chunkMZE4TPFU_cjs.ALLOWED_ALGS,
294
+ algorithms: chunk2F3RPYJV_cjs.ALLOWED_ALGS,
295
295
  clockTolerance: clockToleranceSec,
296
296
  requiredClaims: ["exp", "iat", "jti", "sub"]
297
297
  }));
298
298
  } catch (e) {
299
- if (e instanceof chunkMZE4TPFU_cjs.JwksUnavailableError) throw e;
300
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket rejected: ${e instanceof Error ? e.message : String(e)}`);
299
+ if (e instanceof chunk2F3RPYJV_cjs.JwksUnavailableError) throw e;
300
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket rejected: ${e instanceof Error ? e.message : String(e)}`);
301
301
  }
302
- if ("events" in payload) throw new chunkMZE4TPFU_cjs.SsoError("a logout token is not a ticket");
303
- if ("nonce" in payload) throw new chunkMZE4TPFU_cjs.SsoError("an ID token is not a ticket");
302
+ if ("events" in payload) throw new chunk2F3RPYJV_cjs.SsoError("a logout token is not a ticket");
303
+ if ("nonce" in payload) throw new chunk2F3RPYJV_cjs.SsoError("an ID token is not a ticket");
304
304
  const type = payload.principal_type;
305
305
  if (typeof type !== "string" || !PRINCIPAL_TYPES.includes(type)) {
306
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket has no valid principal_type (got ${JSON.stringify(type)})`);
306
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket has no valid principal_type (got ${JSON.stringify(type)})`);
307
307
  }
308
308
  const lifetime = payload.exp - payload.iat;
309
309
  if (lifetime > maxLifetimeSec) {
310
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket claims a ${lifetime}s lifetime; at most ${maxLifetimeSec}s is accepted`);
310
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket claims a ${lifetime}s lifetime; at most ${maxLifetimeSec}s is accepted`);
311
311
  }
312
- if (typeof payload.sub !== "string" || payload.sub === "") throw new chunkMZE4TPFU_cjs.SsoError("ticket has no sub");
312
+ if (typeof payload.sub !== "string" || payload.sub === "") throw new chunk2F3RPYJV_cjs.SsoError("ticket has no sub");
313
313
  const scopes = typeof payload.scope === "string" ? payload.scope.split(" ").filter(Boolean) : [];
314
314
  const required = opts.scope === void 0 ? [] : Array.isArray(opts.scope) ? opts.scope : [opts.scope];
315
315
  const missing = required.filter((s) => !scopes.includes(s));
316
- if (missing.length) throw new chunkMZE4TPFU_cjs.SsoError(`ticket lacks scope ${missing.join(", ")}`);
316
+ if (missing.length) throw new chunk2F3RPYJV_cjs.SsoError(`ticket lacks scope ${missing.join(", ")}`);
317
317
  const ver = payload.ver === void 0 ? 0 : payload.ver;
318
318
  if (typeof ver !== "number" || !Number.isInteger(ver) || ver < 0) {
319
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket has an invalid ver (got ${JSON.stringify(payload.ver)})`);
319
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket has an invalid ver (got ${JSON.stringify(payload.ver)})`);
320
320
  }
321
321
  if (ver > TICKET_FORMAT_VERSION) {
322
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket format version ${ver} is newer than this @broberg/sso understands (${TICKET_FORMAT_VERSION}) \u2014 upgrade @broberg/sso`);
322
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket format version ${ver} is newer than this @broberg/sso understands (${TICKET_FORMAT_VERSION}) \u2014 upgrade @broberg/sso`);
323
323
  }
324
324
  const act = payload.act === void 0 ? null : readActor(payload.act, 1);
325
325
  const cnfRaw = payload.cnf;
326
326
  const cnf = cnfRaw && typeof cnfRaw.jkt === "string" && cnfRaw.jkt ? { jkt: cnfRaw.jkt } : null;
327
327
  if (cnf) {
328
- if (!opts.dpop?.proof) throw new chunkMZE4TPFU_cjs.SsoError("ticket is DPoP-bound (cnf.jkt) but no DPoP proof was presented");
328
+ if (!opts.dpop?.proof) throw new chunk2F3RPYJV_cjs.SsoError("ticket is DPoP-bound (cnf.jkt) but no DPoP proof was presented");
329
329
  await verifyDpopProof(opts.dpop.proof, {
330
330
  method: opts.dpop.method,
331
331
  url: opts.dpop.url,
@@ -336,11 +336,11 @@ function createTicketVerifier(options) {
336
336
  now
337
337
  });
338
338
  } else if (requireDpop) {
339
- throw new chunkMZE4TPFU_cjs.SsoError(cnfRaw !== void 0 ? "ticket has a cnf without a string jkt \u2014 DPoP is required here" : "this receiver requires DPoP; the ticket is not bound (no cnf.jkt)");
339
+ throw new chunk2F3RPYJV_cjs.SsoError(cnfRaw !== void 0 ? "ticket has a cnf without a string jkt \u2014 DPoP is required here" : "this receiver requires DPoP; the ticket is not bound (no cnf.jkt)");
340
340
  }
341
341
  const named = (v) => typeof v === "string" && v ? v : null;
342
342
  const clientId = type === "user" ? named(payload.client_id) ?? named(payload.azp) : named(payload.client_id) ?? payload.sub;
343
- if (clientId === null) throw new chunkMZE4TPFU_cjs.SsoError("a user ticket names no app (no client_id or azp)");
343
+ if (clientId === null) throw new chunk2F3RPYJV_cjs.SsoError("a user ticket names no app (no client_id or azp)");
344
344
  return {
345
345
  principal: payload.sub,
346
346
  type,
@@ -357,125 +357,125 @@ function createTicketVerifier(options) {
357
357
  };
358
358
  }
359
359
  function readActor(raw, depth) {
360
- if (depth > MAX_ACT_DEPTH) throw new chunkMZE4TPFU_cjs.SsoError(`ticket's delegation chain is deeper than ${MAX_ACT_DEPTH}`);
360
+ if (depth > MAX_ACT_DEPTH) throw new chunk2F3RPYJV_cjs.SsoError(`ticket's delegation chain is deeper than ${MAX_ACT_DEPTH}`);
361
361
  const link = raw;
362
362
  if (!link || typeof link !== "object" || typeof link.sub !== "string" || link.sub === "") {
363
- throw new chunkMZE4TPFU_cjs.SsoError(`ticket's act (link ${depth}) has no string sub`);
363
+ throw new chunk2F3RPYJV_cjs.SsoError(`ticket's act (link ${depth}) has no string sub`);
364
364
  }
365
365
  return link.act === void 0 ? { sub: link.sub } : { sub: link.sub, act: readActor(link.act, depth + 1) };
366
366
  }
367
367
 
368
368
  Object.defineProperty(exports, "AVATAR_TYPES", {
369
369
  enumerable: true,
370
- get: function () { return chunkMZE4TPFU_cjs.AVATAR_TYPES; }
370
+ get: function () { return chunk2F3RPYJV_cjs.AVATAR_TYPES; }
371
371
  });
372
372
  Object.defineProperty(exports, "DEFAULT_SESSION_MAX_AGE", {
373
373
  enumerable: true,
374
- get: function () { return chunkMZE4TPFU_cjs.DEFAULT_SESSION_MAX_AGE; }
374
+ get: function () { return chunk2F3RPYJV_cjs.DEFAULT_SESSION_MAX_AGE; }
375
375
  });
376
376
  Object.defineProperty(exports, "EMBEDDED_FLOW_MAX_AGE", {
377
377
  enumerable: true,
378
- get: function () { return chunkMZE4TPFU_cjs.EMBEDDED_FLOW_MAX_AGE; }
378
+ get: function () { return chunk2F3RPYJV_cjs.EMBEDDED_FLOW_MAX_AGE; }
379
379
  });
380
380
  Object.defineProperty(exports, "JwksError", {
381
381
  enumerable: true,
382
- get: function () { return chunkMZE4TPFU_cjs.JwksError; }
382
+ get: function () { return chunk2F3RPYJV_cjs.JwksError; }
383
383
  });
384
384
  Object.defineProperty(exports, "JwksUnavailableError", {
385
385
  enumerable: true,
386
- get: function () { return chunkMZE4TPFU_cjs.JwksUnavailableError; }
386
+ get: function () { return chunk2F3RPYJV_cjs.JwksUnavailableError; }
387
387
  });
388
388
  Object.defineProperty(exports, "JwksUnknownKeyError", {
389
389
  enumerable: true,
390
- get: function () { return chunkMZE4TPFU_cjs.JwksUnknownKeyError; }
390
+ get: function () { return chunk2F3RPYJV_cjs.JwksUnknownKeyError; }
391
391
  });
392
392
  Object.defineProperty(exports, "MAX_AVATAR_BYTES", {
393
393
  enumerable: true,
394
- get: function () { return chunkMZE4TPFU_cjs.MAX_AVATAR_BYTES; }
394
+ get: function () { return chunk2F3RPYJV_cjs.MAX_AVATAR_BYTES; }
395
395
  });
396
396
  Object.defineProperty(exports, "MAX_INVITATIONS", {
397
397
  enumerable: true,
398
- get: function () { return chunkMZE4TPFU_cjs.MAX_INVITATIONS; }
398
+ get: function () { return chunk2F3RPYJV_cjs.MAX_INVITATIONS; }
399
399
  });
400
400
  Object.defineProperty(exports, "SsoAppApiError", {
401
401
  enumerable: true,
402
- get: function () { return chunkMZE4TPFU_cjs.SsoAppApiError; }
402
+ get: function () { return chunk2F3RPYJV_cjs.SsoAppApiError; }
403
403
  });
404
404
  Object.defineProperty(exports, "SsoAvatarRejectedError", {
405
405
  enumerable: true,
406
- get: function () { return chunkMZE4TPFU_cjs.SsoAvatarRejectedError; }
406
+ get: function () { return chunk2F3RPYJV_cjs.SsoAvatarRejectedError; }
407
407
  });
408
408
  Object.defineProperty(exports, "SsoConfigError", {
409
409
  enumerable: true,
410
- get: function () { return chunkMZE4TPFU_cjs.SsoConfigError; }
410
+ get: function () { return chunk2F3RPYJV_cjs.SsoConfigError; }
411
411
  });
412
412
  Object.defineProperty(exports, "SsoError", {
413
413
  enumerable: true,
414
- get: function () { return chunkMZE4TPFU_cjs.SsoError; }
414
+ get: function () { return chunk2F3RPYJV_cjs.SsoError; }
415
415
  });
416
416
  Object.defineProperty(exports, "SsoInsufficientScopeError", {
417
417
  enumerable: true,
418
- get: function () { return chunkMZE4TPFU_cjs.SsoInsufficientScopeError; }
418
+ get: function () { return chunk2F3RPYJV_cjs.SsoInsufficientScopeError; }
419
419
  });
420
420
  Object.defineProperty(exports, "SsoIntrospectionUnavailableError", {
421
421
  enumerable: true,
422
- get: function () { return chunkMZE4TPFU_cjs.SsoIntrospectionUnavailableError; }
422
+ get: function () { return chunk2F3RPYJV_cjs.SsoIntrospectionUnavailableError; }
423
423
  });
424
424
  Object.defineProperty(exports, "SsoReauthError", {
425
425
  enumerable: true,
426
- get: function () { return chunkMZE4TPFU_cjs.SsoReauthError; }
426
+ get: function () { return chunk2F3RPYJV_cjs.SsoReauthError; }
427
427
  });
428
428
  Object.defineProperty(exports, "SsoTokenInactiveError", {
429
429
  enumerable: true,
430
- get: function () { return chunkMZE4TPFU_cjs.SsoTokenInactiveError; }
430
+ get: function () { return chunk2F3RPYJV_cjs.SsoTokenInactiveError; }
431
431
  });
432
432
  Object.defineProperty(exports, "cookieHeader", {
433
433
  enumerable: true,
434
- get: function () { return chunkMZE4TPFU_cjs.cookieHeader; }
434
+ get: function () { return chunk2F3RPYJV_cjs.cookieHeader; }
435
435
  });
436
436
  Object.defineProperty(exports, "createJwksCache", {
437
437
  enumerable: true,
438
- get: function () { return chunkMZE4TPFU_cjs.createJwksCache; }
438
+ get: function () { return chunk2F3RPYJV_cjs.createJwksCache; }
439
439
  });
440
440
  Object.defineProperty(exports, "createSsoClient", {
441
441
  enumerable: true,
442
- get: function () { return chunkMZE4TPFU_cjs.createSsoClient; }
442
+ get: function () { return chunk2F3RPYJV_cjs.createSsoClient; }
443
443
  });
444
444
  Object.defineProperty(exports, "loadSsoConfig", {
445
445
  enumerable: true,
446
- get: function () { return chunkMZE4TPFU_cjs.loadSsoConfig; }
446
+ get: function () { return chunk2F3RPYJV_cjs.loadSsoConfig; }
447
447
  });
448
448
  Object.defineProperty(exports, "memoryTokenStore", {
449
449
  enumerable: true,
450
- get: function () { return chunkMZE4TPFU_cjs.memoryTokenStore; }
450
+ get: function () { return chunk2F3RPYJV_cjs.memoryTokenStore; }
451
451
  });
452
452
  Object.defineProperty(exports, "openEmbeddedFlow", {
453
453
  enumerable: true,
454
- get: function () { return chunkMZE4TPFU_cjs.openEmbeddedFlow; }
454
+ get: function () { return chunk2F3RPYJV_cjs.openEmbeddedFlow; }
455
455
  });
456
456
  Object.defineProperty(exports, "readCookie", {
457
457
  enumerable: true,
458
- get: function () { return chunkMZE4TPFU_cjs.readCookie; }
458
+ get: function () { return chunk2F3RPYJV_cjs.readCookie; }
459
459
  });
460
460
  Object.defineProperty(exports, "sealEmbeddedFlow", {
461
461
  enumerable: true,
462
- get: function () { return chunkMZE4TPFU_cjs.sealEmbeddedFlow; }
462
+ get: function () { return chunk2F3RPYJV_cjs.sealEmbeddedFlow; }
463
463
  });
464
464
  Object.defineProperty(exports, "signSession", {
465
465
  enumerable: true,
466
- get: function () { return chunkMZE4TPFU_cjs.signSession; }
466
+ get: function () { return chunk2F3RPYJV_cjs.signSession; }
467
467
  });
468
468
  Object.defineProperty(exports, "signValue", {
469
469
  enumerable: true,
470
- get: function () { return chunkMZE4TPFU_cjs.signValue; }
470
+ get: function () { return chunk2F3RPYJV_cjs.signValue; }
471
471
  });
472
472
  Object.defineProperty(exports, "verifySession", {
473
473
  enumerable: true,
474
- get: function () { return chunkMZE4TPFU_cjs.verifySession; }
474
+ get: function () { return chunk2F3RPYJV_cjs.verifySession; }
475
475
  });
476
476
  Object.defineProperty(exports, "verifyValue", {
477
477
  enumerable: true,
478
- get: function () { return chunkMZE4TPFU_cjs.verifyValue; }
478
+ get: function () { return chunk2F3RPYJV_cjs.verifyValue; }
479
479
  });
480
480
  exports.DEFAULT_ISSUER = DEFAULT_ISSUER;
481
481
  exports.MAX_ACT_DEPTH = MAX_ACT_DEPTH;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { SsoError, ALLOWED_ALGS, JwksUnavailableError, createJwksCache } from './chunk-PQTT74BA.js';
2
- export { AVATAR_TYPES, DEFAULT_SESSION_MAX_AGE, EMBEDDED_FLOW_MAX_AGE, JwksError, JwksUnavailableError, JwksUnknownKeyError, MAX_AVATAR_BYTES, MAX_INVITATIONS, SsoAppApiError, SsoAvatarRejectedError, SsoConfigError, SsoError, SsoInsufficientScopeError, SsoIntrospectionUnavailableError, SsoReauthError, SsoTokenInactiveError, cookieHeader, createJwksCache, createSsoClient, loadSsoConfig, memoryTokenStore, openEmbeddedFlow, readCookie, sealEmbeddedFlow, signSession, signValue, verifySession, verifyValue } from './chunk-PQTT74BA.js';
1
+ import { SsoError, ALLOWED_ALGS, JwksUnavailableError, createJwksCache } from './chunk-CCDRB6NJ.js';
2
+ export { AVATAR_TYPES, DEFAULT_SESSION_MAX_AGE, EMBEDDED_FLOW_MAX_AGE, JwksError, JwksUnavailableError, JwksUnknownKeyError, MAX_AVATAR_BYTES, MAX_INVITATIONS, SsoAppApiError, SsoAvatarRejectedError, SsoConfigError, SsoError, SsoInsufficientScopeError, SsoIntrospectionUnavailableError, SsoReauthError, SsoTokenInactiveError, cookieHeader, createJwksCache, createSsoClient, loadSsoConfig, memoryTokenStore, openEmbeddedFlow, readCookie, sealEmbeddedFlow, signSession, signValue, verifySession, verifyValue } from './chunk-CCDRB6NJ.js';
3
3
  import { existsSync } from 'fs';
4
4
  import { request } from 'http';
5
5
  import { generateKeyPair, exportJWK, calculateJwkThumbprint, SignJWT, decodeProtectedHeader, importJWK, jwtVerify } from 'jose';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@broberg/sso",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "The thin client for BrobergID — send a user to central login, verify the ID token against JWKS, keep a local session. Public client + PKCE only: no passwords, no passkeys, no client secret can live in an app.",
5
5
  "type": "module",
6
6
  "license": "MIT",