@goodtiming/baton-sdk 0.4.0 → 0.4.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
@@ -37,7 +37,6 @@ __export(index_exports, {
37
37
  DEPTH_LIMIT: () => DEPTH_LIMIT,
38
38
  EventSchema: () => EventSchema,
39
39
  EventTypeSchema: () => EventTypeSchema,
40
- HASH_SCHEME: () => HASH_SCHEME,
41
40
  HttpSink: () => HttpSink,
42
41
  PRINCIPAL_FORM_HASHED: () => PRINCIPAL_FORM_HASHED,
43
42
  PRINCIPAL_FORM_RAW: () => PRINCIPAL_FORM_RAW,
@@ -62,7 +61,7 @@ __export(index_exports, {
62
61
  module.exports = __toCommonJS(index_exports);
63
62
 
64
63
  // src/version.ts
65
- var SDK_VERSION = "ts-0.4.0";
64
+ var SDK_VERSION = "ts-0.4.1";
66
65
 
67
66
  // src/events.ts
68
67
  var import_zod = require("zod");
@@ -533,7 +532,6 @@ function capCodePoints(value, max) {
533
532
  }
534
533
 
535
534
  // src/identity.ts
536
- var HASH_SCHEME = "h1";
537
535
  var PRINCIPAL_SOURCE_ASSERTED = "asserted";
538
536
  var PRINCIPAL_FORM_HASHED = "hashed";
539
537
  var PRINCIPAL_FORM_RAW = "raw";
@@ -557,14 +555,13 @@ function pythonStrip(value) {
557
555
  return value.replace(PYTHON_STRIP, "");
558
556
  }
559
557
  function hashPrincipalId(rawPrincipal, options) {
560
- const { tenantId, key, issuer = null, scheme = HASH_SCHEME } = options;
558
+ const { tenantId, key, issuer = null } = options;
561
559
  let message = `${tenantId}\0${canonicalize(rawPrincipal)}`;
562
560
  if (issuer !== null) {
563
561
  message += `\0${canonicalize(issuer)}`;
564
562
  }
565
563
  const keyBytes = typeof key === "string" ? Buffer.from(key, "utf8") : key;
566
- const digest = (0, import_node_crypto.createHmac)("sha256", keyBytes).update(message, "utf8").digest("hex");
567
- return `${scheme}:${digest}`;
564
+ return (0, import_node_crypto.createHmac)("sha256", keyBytes).update(message, "utf8").digest("hex");
568
565
  }
569
566
  function normalizePrincipal(result) {
570
567
  if (result === null || typeof result !== "object") return null;
@@ -2178,7 +2175,6 @@ function withBaton(server, supplied = {}) {
2178
2175
  DEPTH_LIMIT,
2179
2176
  EventSchema,
2180
2177
  EventTypeSchema,
2181
- HASH_SCHEME,
2182
2178
  HttpSink,
2183
2179
  PRINCIPAL_FORM_HASHED,
2184
2180
  PRINCIPAL_FORM_RAW,