@peac/protocol 0.13.2 → 0.13.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/dist/index.mjs CHANGED
@@ -594,6 +594,14 @@ function pruneStale() {
594
594
  while (SHADOW_LOG.length > 0 && SHADOW_LOG[0].timestamp < cutoffIso) SHADOW_LOG.shift();
595
595
  }
596
596
 
597
+ // src/_internal/legacy-path.ts
598
+ function readLegacyPathFlag(options) {
599
+ if (options?._internal?.legacyPath === true) return true;
600
+ if (typeof process === "undefined" || process === null) return false;
601
+ const env = process.env;
602
+ return env?.PEAC_INTERNAL_LEGACY_PATH === "1";
603
+ }
604
+
597
605
  // src/_internal/shadow-observe.ts
598
606
  function realObservationForIssue() {
599
607
  return EMPTY_ACCEPTED;
@@ -804,6 +812,7 @@ async function issue(options) {
804
812
  return issueWire02(options);
805
813
  }
806
814
  async function issueWire02(options) {
815
+ void readLegacyPathFlag(options);
807
816
  if (!isCanonicalIss(options.iss)) {
808
817
  throw new IssueError({
809
818
  code: "E_ISS_NOT_CANONICAL",
@@ -1918,6 +1927,8 @@ function jwkToPublicKey(jwk) {
1918
1927
  return new Uint8Array(xBytes);
1919
1928
  }
1920
1929
  async function verifyReceipt(optionsOrJws) {
1930
+ const legacyPathOptions = typeof optionsOrJws === "string" ? void 0 : optionsOrJws;
1931
+ void readLegacyPathFlag(legacyPathOptions);
1921
1932
  const receiptJws = typeof optionsOrJws === "string" ? optionsOrJws : optionsOrJws.receiptJws;
1922
1933
  const inputSnapshot = typeof optionsOrJws === "string" ? void 0 : optionsOrJws.subject_snapshot;
1923
1934
  const telemetry = typeof optionsOrJws === "string" ? void 0 : optionsOrJws.telemetry;
@@ -2109,6 +2120,7 @@ function sanitizeParseIssues(issues) {
2109
2120
  }));
2110
2121
  }
2111
2122
  async function verifyLocal(jws, publicKey, options = {}) {
2123
+ void readLegacyPathFlag(options);
2112
2124
  const {
2113
2125
  issuer,
2114
2126
  subjectUri,