@blamejs/core 0.18.43 → 0.18.45

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/lib/guard-jwt.js CHANGED
@@ -439,9 +439,9 @@ function _detectIssues(input, opts) {
439
439
  * allowedAlgs: string[],
440
440
  * requiredClaims: string[],
441
441
  * knownCrit: string[],
442
- * algNonePolicy: "reject"|"audit"|"allow",
442
+ * algNonePolicy: "reject", // alg=none is always critical
443
443
  * algAllowlistPolicy: "reject"|"audit"|"allow",
444
- * kidTraversalPolicy: "reject"|"audit"|"allow",
444
+ * kidTraversalPolicy: "reject", // kid traversal is always critical
445
445
  * typConfusionPolicy: "reject"|"audit"|"allow",
446
446
  * expSanityPolicy: "reject"|"audit"|"allow",
447
447
  * nbfSanityPolicy: "reject"|"audit"|"allow",
@@ -587,8 +587,13 @@ module.exports = gateContract.defineGuard({
587
587
  integrationFixtures: INTEGRATION_FIXTURES,
588
588
  detect: _detectIssues,
589
589
  sanitizeTransform: _sanitizeTransform,
590
+ // The byte caps only. nbfFutureSlackMs and iatFutureSlackMs are TOLERANCES,
591
+ // not caps: zero means "allow no clock slack", which is a stricter setting an
592
+ // operator may legitimately want, and declaring them here refused it. They
593
+ // are still held to being non-negative integers by the derived check, so a
594
+ // slack given as a string or an Infinity is refused exactly as before.
590
595
  intOpts: ["maxBytes", "maxHeaderBytes", "maxPayloadBytes",
591
- "maxSignatureBytes", "nbfFutureSlackMs", "iatFutureSlackMs"],
596
+ "maxSignatureBytes"],
592
597
  extra: {
593
598
  kidSafe: kidSafe,
594
599
  },