@hanzo/event 0.3.40 → 0.3.42
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/core.d.ts.map +1 -1
- package/dist/events.d.ts +1 -1
- package/dist/index.cjs +13 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/dist/org.d.ts +10 -5
- package/dist/org.d.ts.map +1 -1
- package/dist/react.cjs +13 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +13 -7
- package/dist/react.mjs.map +1 -1
- package/dist/scrub.d.ts +5 -0
- package/dist/scrub.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/core.test.ts +19 -0
- package/src/core.ts +7 -4
- package/src/events.ts +1 -1
- package/src/org.ts +13 -8
- package/src/scrub.test.ts +34 -1
- package/src/scrub.ts +20 -0
package/dist/org.d.ts
CHANGED
|
@@ -44,12 +44,17 @@ export type Keyring = Readonly<Record<string, string>>;
|
|
|
44
44
|
*/
|
|
45
45
|
export declare const ORG_DOMAIN: Readonly<Record<string, readonly string[]>>;
|
|
46
46
|
/**
|
|
47
|
-
* Each org's publishable key
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Each org's publishable key, and a copy: the values live in universe at
|
|
48
|
+
* infra/k8s/id/configmap.yaml as SPA_INGEST_KEYRING, which serves them to the
|
|
49
|
+
* identity hosts, and this table is what a statically exported page carries when
|
|
50
|
+
* it cannot ask. The two must say the same thing. Add an org the day its project
|
|
51
|
+
* exists, never before.
|
|
50
52
|
*
|
|
51
|
-
* A key is only as real as the project it names
|
|
52
|
-
*
|
|
53
|
+
* A key is only as real as the project it names, and these had stopped naming
|
|
54
|
+
* one: all three answered `403 ingest_key_unknown` against /v1/event, so every
|
|
55
|
+
* page that fell back to this table reported nowhere while looking fine. The
|
|
56
|
+
* copy drifted silently because nothing compares it to the keyring. If you
|
|
57
|
+
* recreate a project, move BOTH.
|
|
53
58
|
*/
|
|
54
59
|
export declare const ORG_KEY: Keyring;
|
|
55
60
|
/**
|
package/dist/org.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../src/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,mCAAmC;AACnC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA6BjE,CAAA;AAEF
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../src/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,mCAAmC;AACnC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA6BjE,CAAA;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,EAAE,OAIpB,CAAA;AAWF;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CActD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,OAAiB,GAAG,MAAM,GAAG,SAAS,CAOnF;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,OAAO,GAAE,OAAiB,GAAG,MAAM,GAAG,SAAS,CAGzE"}
|
package/dist/react.cjs
CHANGED
|
@@ -118,9 +118,9 @@ var ORG_DOMAIN = Object.freeze({
|
|
|
118
118
|
zoo: Object.freeze(["zoo.ngo", "zoo.network", "zoolabs.id", "zoolabs.io"])
|
|
119
119
|
});
|
|
120
120
|
var ORG_KEY = Object.freeze({
|
|
121
|
-
hanzo: "pk-
|
|
122
|
-
lux: "pk-
|
|
123
|
-
zoo: "pk-
|
|
121
|
+
hanzo: "pk-rM_CdaF2MQckGCrla113SrR1oH4zvqN8xh2I95Z9tY8",
|
|
122
|
+
lux: "pk-gUZp6ZVfhJzSwK-rb4oLbVkpCnMBx5uSCpxf_5yEhQk",
|
|
123
|
+
zoo: "pk-3TKpKnERV9AQSsBUERWkZejC1O1mUxc1jRzsP3MPbs4"
|
|
124
124
|
});
|
|
125
125
|
var PUBLISHABLE = "pk-";
|
|
126
126
|
var normalize = (host) => host.trim().toLowerCase().replace(/\.$/, "").split(":")[0] ?? "";
|
|
@@ -249,11 +249,17 @@ var RE_CREDENTIAL_PARAM = new RegExp(
|
|
|
249
249
|
function redactCredentialParams(s) {
|
|
250
250
|
return s.replace(RE_CREDENTIAL_PARAM, (_m, prefix) => prefix + REDACTED);
|
|
251
251
|
}
|
|
252
|
+
var RE_SECRET43 = /(^|[^A-Za-z0-9_-]|%[0-9A-Fa-f]{2})((?=[A-Za-z0-9_-]{0,42}[a-z])(?=[A-Za-z0-9_-]{0,42}[A-Z])[A-Za-z0-9_-]{43})(?![A-Za-z0-9_-])/g;
|
|
252
253
|
function redactSecrets(s) {
|
|
253
254
|
s = redactCredentialParams(s);
|
|
254
255
|
for (const re of SECRET_PATTERNS) s = s.replace(re, REDACTED);
|
|
256
|
+
s = s.replace(RE_SECRET43, (_m, lead) => lead + REDACTED);
|
|
255
257
|
return redactPAN(s);
|
|
256
258
|
}
|
|
259
|
+
function withoutFragment(url) {
|
|
260
|
+
const at = url.indexOf("#");
|
|
261
|
+
return at < 0 ? url : url.slice(0, at);
|
|
262
|
+
}
|
|
257
263
|
function scrubPII(s) {
|
|
258
264
|
s = s.replace(RE_EMAIL, EMAIL_MARK);
|
|
259
265
|
s = s.replace(RE_IPV6, IP_MARK);
|
|
@@ -382,7 +388,7 @@ function hzAnonId() {
|
|
|
382
388
|
}
|
|
383
389
|
|
|
384
390
|
// package.json
|
|
385
|
-
var version = "0.3.
|
|
391
|
+
var version = "0.3.42";
|
|
386
392
|
|
|
387
393
|
// src/version.ts
|
|
388
394
|
var VERSION = version;
|
|
@@ -1104,9 +1110,9 @@ var Analytics = class {
|
|
|
1104
1110
|
...extra
|
|
1105
1111
|
};
|
|
1106
1112
|
const capturePII = this.cfg.capturePII ?? false;
|
|
1107
|
-
if (wire.url) wire.url = scrubText(wire.url, capturePII);
|
|
1108
|
-
if (wire.path) wire.path = scrubText(wire.path, capturePII);
|
|
1109
|
-
if (wire.referrer) wire.referrer = scrubText(wire.referrer, capturePII);
|
|
1113
|
+
if (wire.url) wire.url = scrubText(withoutFragment(wire.url), capturePII);
|
|
1114
|
+
if (wire.path) wire.path = scrubText(withoutFragment(wire.path), capturePII);
|
|
1115
|
+
if (wire.referrer) wire.referrer = scrubText(withoutFragment(wire.referrer), capturePII);
|
|
1110
1116
|
return wire;
|
|
1111
1117
|
}
|
|
1112
1118
|
schedule() {
|