@kya-os/checkpoint-shared 1.5.1 → 1.5.2
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/CHANGELOG.md +120 -0
- package/dist/beacon-nonce/index.d.mts +36 -0
- package/dist/beacon-nonce/index.d.mts.map +1 -0
- package/dist/beacon-nonce/index.d.ts +36 -0
- package/dist/beacon-nonce/index.d.ts.map +1 -0
- package/dist/beacon-nonce/index.js +305 -0
- package/dist/beacon-nonce/index.mjs +294 -0
- package/dist/beacon-nonce/index.mjs.map +1 -0
- package/dist/beacon-types/index.d.mts +29 -0
- package/dist/beacon-types/index.d.mts.map +1 -1
- package/dist/beacon-types/index.d.ts +29 -0
- package/dist/beacon-types/index.d.ts.map +1 -1
- package/dist/beacon-types/index.js +36 -5
- package/dist/beacon-types/index.mjs +33 -6
- package/dist/beacon-types/index.mjs.map +1 -1
- package/dist/browser-posture-D4j2a5gi.d.ts +169 -0
- package/dist/browser-posture-D4j2a5gi.d.ts.map +1 -0
- package/dist/browser-posture-DVoHMHjY.d.mts +169 -0
- package/dist/browser-posture-DVoHMHjY.d.mts.map +1 -0
- package/dist/browser-posture-cookie.d.mts +4 -2
- package/dist/browser-posture-cookie.d.mts.map +1 -0
- package/dist/browser-posture-cookie.d.ts +4 -2
- package/dist/browser-posture-cookie.d.ts.map +1 -0
- package/dist/browser-posture-cookie.mjs.map +1 -1
- package/dist/browser-posture-proof.d.mts +18 -0
- package/dist/browser-posture-proof.d.mts.map +1 -0
- package/dist/browser-posture-proof.d.ts +18 -0
- package/dist/browser-posture-proof.d.ts.map +1 -0
- package/dist/browser-posture-proof.js +66 -0
- package/dist/browser-posture-proof.mjs +63 -0
- package/dist/browser-posture-proof.mjs.map +1 -0
- package/dist/browser-posture-report.d.mts +59 -2
- package/dist/browser-posture-report.d.mts.map +1 -1
- package/dist/browser-posture-report.d.ts +59 -2
- package/dist/browser-posture-report.d.ts.map +1 -1
- package/dist/browser-posture-report.js +1 -1
- package/dist/browser-posture-report.mjs +1 -1
- package/dist/browser-posture-report.mjs.map +1 -1
- package/dist/browser-posture.d.mts +2 -85
- package/dist/browser-posture.d.ts +2 -85
- package/dist/browser-posture.js +205 -43
- package/dist/browser-posture.mjs +194 -44
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/browser.d.mts +0 -8
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.d.ts +0 -8
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/browser.mjs.map +1 -1
- package/dist/clearance.d.mts +1 -1
- package/dist/clearance.d.ts +1 -1
- package/dist/{client-ip-HOfe6ucV.mjs → client-ip-B2Xeo-GK.mjs} +2 -2
- package/dist/{client-ip-HOfe6ucV.mjs.map → client-ip-B2Xeo-GK.mjs.map} +1 -1
- package/dist/{client-ip-1y2iXAYW.js → client-ip-CW6pRyLf.js} +1 -1
- package/dist/consent-handoff.d.mts +41 -0
- package/dist/consent-handoff.d.mts.map +1 -0
- package/dist/consent-handoff.d.ts +41 -0
- package/dist/consent-handoff.d.ts.map +1 -0
- package/dist/consent-handoff.js +1 -0
- package/dist/consent-handoff.mjs +2 -0
- package/dist/consent-handoff.mjs.map +1 -0
- package/dist/errors/index.d.mts +138 -0
- package/dist/errors/index.d.mts.map +1 -1
- package/dist/errors/index.d.ts +138 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +441 -9
- package/dist/errors/index.mjs +441 -10
- package/dist/errors/index.mjs.map +1 -1
- package/dist/{external-jr_S4iSS.d.mts → external-Ct8j_hto.d.mts} +2 -2
- package/dist/{external-jr_S4iSS.d.mts.map → external-Ct8j_hto.d.mts.map} +1 -1
- package/dist/{external-jr_S4iSS.d.ts → external-Ct8j_hto.d.ts} +2 -2
- package/dist/{external-jr_S4iSS.d.ts.map → external-Ct8j_hto.d.ts.map} +1 -1
- package/dist/gateway-client-ip.d.mts +1 -1
- package/dist/gateway-client-ip.d.ts +1 -1
- package/dist/gateway-client-ip.js +1 -1
- package/dist/gateway-client-ip.mjs +1 -1
- package/dist/index.d.mts +5131 -967
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +5131 -967
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3678 -546
- package/dist/index.mjs +3446 -534
- package/dist/index.mjs.map +1 -1
- package/dist/mcpi/approval-grant/index.d.mts +1 -1
- package/dist/mcpi/approval-grant/index.d.mts.map +1 -1
- package/dist/mcpi/approval-grant/index.d.ts +1 -1
- package/dist/mcpi/approval-grant/index.d.ts.map +1 -1
- package/dist/mcpi/approval-grant/index.js +48 -48
- package/dist/mcpi/approval-grant/index.mjs +48 -48
- package/dist/mcpi/approval-grant/index.mjs.map +1 -1
- package/dist/posture-origins/index.d.mts +41 -0
- package/dist/posture-origins/index.d.mts.map +1 -0
- package/dist/posture-origins/index.d.ts +41 -0
- package/dist/posture-origins/index.d.ts.map +1 -0
- package/dist/posture-origins/index.js +441 -0
- package/dist/posture-origins/index.mjs +430 -0
- package/dist/posture-origins/index.mjs.map +1 -0
- package/dist/posture-origins-CEm83u4D.js +621 -0
- package/dist/posture-origins-Dl7i8j93.mjs +533 -0
- package/dist/posture-origins-Dl7i8j93.mjs.map +1 -0
- package/dist/rules.json +0 -1
- package/dist/signals/index.d.mts +75 -55
- package/dist/signals/index.d.mts.map +1 -1
- package/dist/signals/index.d.ts +75 -55
- package/dist/signals/index.d.ts.map +1 -1
- package/dist/signals/index.js +246 -2
- package/dist/signals/index.mjs +236 -3
- package/dist/signals/index.mjs.map +1 -1
- package/fixtures/browser-integrity/captured-java-0.2.1-missing-score.json +10 -0
- package/fixtures/browser-integrity/null-score.json +11 -0
- package/fixtures/browser-integrity/numeric-score.json +11 -0
- package/fixtures/browser-posture-claims.json +168 -0
- package/fixtures/browser-posture-headers.json +6 -0
- package/fixtures/kya-http/README.md +1 -0
- package/fixtures/kya-http/consent-handoff.codes.json +34 -0
- package/fixtures/workbench/a2a-signed-request.v1.json +255 -0
- package/fixtures/workbench/artifact-bindings.v1.json +1003 -0
- package/fixtures/workbench/delegation-management.v1.json +507 -0
- package/fixtures/workbench/didcomm-task-source.v1.json +191 -0
- package/fixtures/workbench/graph-interfaces.v1.json +1887 -0
- package/fixtures/workbench/identity-provisioning.v1.json +643 -0
- package/fixtures/workbench/linear-installation.v1.json +484 -0
- package/fixtures/workbench/management-session.v1.json +716 -0
- package/fixtures/workbench/model-credentials.v1.json +630 -0
- package/fixtures/workbench/source-claim-pooled.v1.json +50 -0
- package/fixtures/workbench/task-grant.v1.json +695 -0
- package/fixtures/workbench/task-status-projection.v1.json +591 -0
- package/fixtures/workbench/workload-enrollment.v1.json +580 -0
- package/package.json +21 -2
- package/src/data/compiled/merged-rules.json +2 -9
- package/src/data/default-rules.json +0 -1
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts +0 -5
- package/dist/browser-posture-cookie-Dmq9Brf_.d.mts.map +0 -1
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts +0 -5
- package/dist/browser-posture-cookie-Dmq9Brf_.d.ts.map +0 -1
- package/dist/browser-posture.d.mts.map +0 -1
- package/dist/browser-posture.d.ts.map +0 -1
- package/dist/patterns-CkRVOdtV.js +0 -243
- package/dist/patterns-DzkGy_qk.mjs +0 -173
- package/dist/patterns-DzkGy_qk.mjs.map +0 -1
package/dist/signals/index.mjs
CHANGED
|
@@ -30,6 +30,8 @@ const REGISTRY_VERSIONS = [
|
|
|
30
30
|
"v3"
|
|
31
31
|
];
|
|
32
32
|
const CURRENT_REGISTRY_VERSION = REGISTRY_VERSIONS[REGISTRY_VERSIONS.length - 1];
|
|
33
|
+
/** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */
|
|
34
|
+
const SENSITIVE_REJECTION_LIST_VERSIONS = ["v1"];
|
|
33
35
|
/** Fields frozen once a signal has shipped (see immutability.ts). */
|
|
34
36
|
const FROZEN_FIELDS = [
|
|
35
37
|
"id",
|
|
@@ -91,8 +93,6 @@ const TIER_LOCKED_FIELDS = ["tier"];
|
|
|
91
93
|
* avoids the bare words "fingerprint"/"biometric" for that reason: using
|
|
92
94
|
* them would false-positive on this entire module.
|
|
93
95
|
*/
|
|
94
|
-
/** Ordered rejection-list versions. Order matters: CURRENT is always the last entry. */
|
|
95
|
-
const SENSITIVE_REJECTION_LIST_VERSIONS = ["v1"];
|
|
96
96
|
const CURRENT_SENSITIVE_REJECTION_LIST_VERSION = SENSITIVE_REJECTION_LIST_VERSIONS[SENSITIVE_REJECTION_LIST_VERSIONS.length - 1];
|
|
97
97
|
const SENSITIVE_ATTRIBUTE_REJECTION_LIST = { v1: [
|
|
98
98
|
{
|
|
@@ -1573,6 +1573,239 @@ function computeSessionFingerprintHash(clientAttributes) {
|
|
|
1573
1573
|
return bytesToHex(sha256(new TextEncoder().encode(json)));
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region src/signals/device-fingerprint.ts
|
|
1578
|
+
const DEVICE_FINGERPRINT_VERSION = 2;
|
|
1579
|
+
const DEVICE_FINGERPRINT_PREFIX = `fp${2}:`;
|
|
1580
|
+
const STABLE_HARDWARE = "Hardware constant for the device (registry tier high): does not move within a visit.";
|
|
1581
|
+
const STABLE_DISPLAY = "Display property fixed for the visit (registry tier medium): moves only on a monitor change.";
|
|
1582
|
+
const STABLE_SETTING = "Browser or OS setting fixed for the visit: moves only on a deliberate user change between visits.";
|
|
1583
|
+
const STABLE_MOBILE = "Mobile SDK device or app field fixed for the install: moves only on an OS or app change.";
|
|
1584
|
+
const LOW_ENTROPY_STABLE = "Low entropy (registry tier low) but fixed for the visit: adds distinctness without adding instability.";
|
|
1585
|
+
const COUNTER = "Event counter that grows through the visit: differs between two page loads of one device.";
|
|
1586
|
+
const PERFORMANCE = "Timing, size or memory reading taken per page load and overwritten by later events in a visit.";
|
|
1587
|
+
const NETWORK_STATE = "Live network state that flips within a visit (wifi to cellular, offline).";
|
|
1588
|
+
const PROBE_VERDICT = "Automation probe outcome, a verdict about the client rather than a device property; it appears or flips as probes finish.";
|
|
1589
|
+
const ACCESSIBILITY = "Accessibility preference (registry tier low, consent mode, weighted near zero for identity): togglable mid-visit and a proxy for an accommodation, so it never feeds a device hash.";
|
|
1590
|
+
const NEVER_MODE = "Registry mode never: collected for contradiction detection only, never identity linkage.";
|
|
1591
|
+
const BUILD_STAMP = "Detector release stamp: moves on every pixel release for every visitor at once, not a device property.";
|
|
1592
|
+
const LAZY_CHUNK_PRESENCE_REASON = "Presence depends on lazy-chunk timing: the value arrives only after a separately fetched chunk loads, so one device shows it on some rounds and not on others.";
|
|
1593
|
+
const VENDORED_PRESENCE_REASON = "Reaches the beacon lane only through a vendored collector that can time out, so it is present on the pixel lane and on only some beacon rounds.";
|
|
1594
|
+
const LANE_ONLY_REASON = "Emitted by only one of the two browser lanes (pixel or beacon), so hashing it would give one browser two fingerprints depending on which lane saw it.";
|
|
1595
|
+
const DAYLIGHT_SAVING = "Moves with daylight saving time between visits, so it differs for one device across the year.";
|
|
1596
|
+
const include = (reason, signalId) => ({
|
|
1597
|
+
role: "include",
|
|
1598
|
+
reason,
|
|
1599
|
+
signalId
|
|
1600
|
+
});
|
|
1601
|
+
const churning = (reason, signalId) => ({
|
|
1602
|
+
role: "exclude-churning",
|
|
1603
|
+
reason,
|
|
1604
|
+
signalId
|
|
1605
|
+
});
|
|
1606
|
+
const presence = (reason, signalId) => ({
|
|
1607
|
+
role: "exclude-churning",
|
|
1608
|
+
reason,
|
|
1609
|
+
signalId,
|
|
1610
|
+
presenceOnly: true
|
|
1611
|
+
});
|
|
1612
|
+
const lazy = (signalId) => presence(LAZY_CHUNK_PRESENCE_REASON, signalId);
|
|
1613
|
+
const laneOnly = (signalId) => presence(LANE_ONLY_REASON, signalId);
|
|
1614
|
+
const vendoredOnly = (signalId) => presence(VENDORED_PRESENCE_REASON, signalId);
|
|
1615
|
+
const counter = churning(COUNTER);
|
|
1616
|
+
const performance = churning(PERFORMANCE);
|
|
1617
|
+
const CLIENT_ATTRIBUTE_CLASSIFICATION = /* @__PURE__ */ new Map([
|
|
1618
|
+
["device.id", include("Persistent per-browser cookie id: it keeps identical hardware apart, so visitor_id and the unattributed lookback stay per browser instead of collapsing.")],
|
|
1619
|
+
["device.platform", include(LOW_ENTROPY_STABLE, "platform.navigatorPlatform")],
|
|
1620
|
+
["device.vendorSub", laneOnly()],
|
|
1621
|
+
["device.doNotTrackResolved", laneOnly()],
|
|
1622
|
+
["device.locale", include(STABLE_SETTING)],
|
|
1623
|
+
["device.timezone", include(STABLE_SETTING)],
|
|
1624
|
+
["client.screenWidthPt", churning("Screen width swaps with height when the device rotates, so it moves within a visit.")],
|
|
1625
|
+
["client.screenHeightPt", churning("Screen height swaps with width when the device rotates, so it moves within a visit.")],
|
|
1626
|
+
["client.screenWidthPx", churning("Screen width swaps with height when the device rotates, so it moves within a visit.")],
|
|
1627
|
+
["client.screenHeightPx", churning("Screen height swaps with width when the device rotates, so it moves within a visit.")],
|
|
1628
|
+
["client.screenScale", include(STABLE_DISPLAY)],
|
|
1629
|
+
["client.screenDensity", include(STABLE_DISPLAY)],
|
|
1630
|
+
["device.manufacturer", include(STABLE_MOBILE)],
|
|
1631
|
+
["device.model", include(STABLE_MOBILE)],
|
|
1632
|
+
["device.osVersion", include(STABLE_MOBILE)],
|
|
1633
|
+
["device.emulator", include(STABLE_MOBILE)],
|
|
1634
|
+
["device.rooted", include(STABLE_MOBILE)],
|
|
1635
|
+
["app.id", include(STABLE_MOBILE)],
|
|
1636
|
+
["app.versionName", churning("Bumped for every install at once by an app release.")],
|
|
1637
|
+
["app.versionCode", churning("Bumped for every install at once by an app release.")],
|
|
1638
|
+
["browser.cookiesEnabled", include(LOW_ENTROPY_STABLE, "platform.cookiesEnabled")],
|
|
1639
|
+
["browser.timezoneOffset", churning(DAYLIGHT_SAVING)],
|
|
1640
|
+
["browser.timezone", include(STABLE_SETTING, "platform.timezone")],
|
|
1641
|
+
["browser.language", include(STABLE_SETTING, "platform.languages")],
|
|
1642
|
+
["browser.onLine", churning(NETWORK_STATE)],
|
|
1643
|
+
["network.connectionType", churning(NETWORK_STATE)],
|
|
1644
|
+
["network.connectionSpeed", churning(NETWORK_STATE)],
|
|
1645
|
+
["network.connectionRtt", churning(NETWORK_STATE)],
|
|
1646
|
+
["network.connectionSaveData", churning(NETWORK_STATE)],
|
|
1647
|
+
["client.networkType", churning(NETWORK_STATE)],
|
|
1648
|
+
["screen.resolution", include(STABLE_DISPLAY, "platform.screenResolution")],
|
|
1649
|
+
["screen.pixelDepth", laneOnly("platform.colorDepth")],
|
|
1650
|
+
["screen.viewport", churning("Window size: changes on resize, rotation and split view.")],
|
|
1651
|
+
["client.hardwareConcurrency", include(STABLE_HARDWARE, "platform.hardwareConcurrency")],
|
|
1652
|
+
["client.deviceMemory", include(STABLE_HARDWARE, "platform.deviceMemory")],
|
|
1653
|
+
["client.maxTouchPoints", include(STABLE_DISPLAY, "platform.touchSupport")],
|
|
1654
|
+
["client.hasTouch", laneOnly("platform.touchSupport")],
|
|
1655
|
+
["client.colorDepth", include(LOW_ENTROPY_STABLE, "platform.colorDepth")],
|
|
1656
|
+
["client.doNotTrack", laneOnly()],
|
|
1657
|
+
["client.pluginsCount", laneOnly()],
|
|
1658
|
+
["client.languages", vendoredOnly("platform.languages")],
|
|
1659
|
+
["client.localStorageEnabled", vendoredOnly("platform.localStorage")],
|
|
1660
|
+
["client.sessionStorageEnabled", vendoredOnly("platform.sessionStorage")],
|
|
1661
|
+
["client.chrome", laneOnly("platform.vendorFlavors")],
|
|
1662
|
+
["client.vendor", include(LOW_ENTROPY_STABLE, "platform.vendor")],
|
|
1663
|
+
["client.pixelRatio", churning("devicePixelRatio moves with page zoom and when a window changes display.")],
|
|
1664
|
+
["client.webrtc", churning("Outcome of a one second STUN race (available, timeout, error): depends on the network at load time.")],
|
|
1665
|
+
["client.automation", churning(PROBE_VERDICT)],
|
|
1666
|
+
["client.automationTag", churning(PROBE_VERDICT)],
|
|
1667
|
+
["client.headless", churning(PROBE_VERDICT)],
|
|
1668
|
+
["client.webdriver", churning(PROBE_VERDICT)],
|
|
1669
|
+
["client.cdpStackAccessed", churning(PROBE_VERDICT)],
|
|
1670
|
+
["client.pluginMimeTypesConsistent", churning(PROBE_VERDICT)],
|
|
1671
|
+
["client.webglUaConsistent", churning(PROBE_VERDICT)],
|
|
1672
|
+
["client.distinctiveProperties", churning(PROBE_VERDICT)],
|
|
1673
|
+
["client.timingVersion", churning(BUILD_STAMP)],
|
|
1674
|
+
["client.kinematicsVersion", churning(BUILD_STAMP)],
|
|
1675
|
+
["client.scrollEvents", counter],
|
|
1676
|
+
["client.keyboardEvents", counter],
|
|
1677
|
+
["client.touchEvents", counter],
|
|
1678
|
+
["client.untrustedEvents", counter],
|
|
1679
|
+
["client.hasInteraction", counter],
|
|
1680
|
+
["client.keyDwellCount", counter],
|
|
1681
|
+
["client.keyDwellUnder5", counter],
|
|
1682
|
+
["client.keyDwellSumMs", counter],
|
|
1683
|
+
["client.keyGapCount", counter],
|
|
1684
|
+
["client.keyGapUnder5", counter],
|
|
1685
|
+
["client.pressCount", counter],
|
|
1686
|
+
["client.pressAdjacencyCount", counter],
|
|
1687
|
+
["client.pressAdjacentUnder5", counter],
|
|
1688
|
+
["client.pressUnder10", counter],
|
|
1689
|
+
["client.pressSumMs", counter],
|
|
1690
|
+
["client.mouseClicks", counter],
|
|
1691
|
+
["client.zeroTrailClicks", counter],
|
|
1692
|
+
["client.pointerMoves", counter],
|
|
1693
|
+
["client.coalescedMoves", counter],
|
|
1694
|
+
["client.stepPairs", counter],
|
|
1695
|
+
["client.equalSteps", counter],
|
|
1696
|
+
["client.straightSteps", counter],
|
|
1697
|
+
["performance.navigation", performance],
|
|
1698
|
+
["performance.navigationType", performance],
|
|
1699
|
+
["performance.pageLoadTime", performance],
|
|
1700
|
+
["performance.domContentLoadedTime", performance],
|
|
1701
|
+
["performance.domInteractiveTime", performance],
|
|
1702
|
+
["performance.dnsLookupTime", performance],
|
|
1703
|
+
["performance.tcpConnectionTime", performance],
|
|
1704
|
+
["performance.serverResponseTime", performance],
|
|
1705
|
+
["performance.transferSize", performance],
|
|
1706
|
+
["performance.encodedBodySize", performance],
|
|
1707
|
+
["performance.decodedBodySize", performance],
|
|
1708
|
+
["performance.redirectCount", performance],
|
|
1709
|
+
["performance.memoryUsedJSHeapSize", performance],
|
|
1710
|
+
["performance.memoryTotalJSHeapSize", performance],
|
|
1711
|
+
["performance.memoryLimitJSHeapSize", performance],
|
|
1712
|
+
["performance.firstPaintTime", performance],
|
|
1713
|
+
["performance.firstContentfulPaintTime", performance],
|
|
1714
|
+
["performance.largestContentfulPaintTime", performance],
|
|
1715
|
+
["canvas.geometry.v2", lazy("canvas.geometry.v2")],
|
|
1716
|
+
["canvas.text", lazy("canvas.text")],
|
|
1717
|
+
["webgl.render", lazy("webgl.render")],
|
|
1718
|
+
["audio.digest", lazy("audio.digest")],
|
|
1719
|
+
["rendering.mathFingerprint", laneOnly("rendering.mathFingerprint")],
|
|
1720
|
+
["rendering.fontPreferences", lazy("rendering.fontPreferences")],
|
|
1721
|
+
["transport.webrtcCodecs", lazy("transport.webrtcCodecs")],
|
|
1722
|
+
["platform.speechVoices", lazy("platform.speechVoices")],
|
|
1723
|
+
["platform.userAgentData", vendoredOnly("platform.userAgentData")],
|
|
1724
|
+
["platform.architecture", laneOnly("platform.architecture")],
|
|
1725
|
+
["platform.hardwareConcurrency", include(STABLE_HARDWARE, "platform.hardwareConcurrency")],
|
|
1726
|
+
["platform.deviceMemory", include(STABLE_HARDWARE, "platform.deviceMemory")],
|
|
1727
|
+
["platform.screenResolution", include(STABLE_DISPLAY, "platform.screenResolution")],
|
|
1728
|
+
["platform.colorGamut", laneOnly("platform.colorGamut")],
|
|
1729
|
+
["platform.hdr", laneOnly("platform.hdr")],
|
|
1730
|
+
["platform.timezone", include(STABLE_SETTING, "platform.timezone")],
|
|
1731
|
+
["platform.languages", vendoredOnly("platform.languages")],
|
|
1732
|
+
["platform.touchSupport", laneOnly("platform.touchSupport")],
|
|
1733
|
+
["platform.colorDepth", include(LOW_ENTROPY_STABLE, "platform.colorDepth")],
|
|
1734
|
+
["platform.monochrome", laneOnly("platform.monochrome")],
|
|
1735
|
+
["platform.navigatorPlatform", include(LOW_ENTROPY_STABLE, "platform.navigatorPlatform")],
|
|
1736
|
+
["platform.vendor", include(LOW_ENTROPY_STABLE, "platform.vendor")],
|
|
1737
|
+
["platform.osCpu", laneOnly("platform.osCpu")],
|
|
1738
|
+
["platform.cookiesEnabled", include(LOW_ENTROPY_STABLE, "platform.cookiesEnabled")],
|
|
1739
|
+
["platform.sessionStorage", vendoredOnly("platform.sessionStorage")],
|
|
1740
|
+
["platform.localStorage", vendoredOnly("platform.localStorage")],
|
|
1741
|
+
["platform.indexedDB", laneOnly("platform.indexedDB")],
|
|
1742
|
+
["platform.pdfViewerEnabled", laneOnly("platform.pdfViewerEnabled")],
|
|
1743
|
+
["platform.permissions", churning("Grant state changes within a session on a trivial user action (registry tier low).", "platform.permissions")],
|
|
1744
|
+
["platform.contrast", churning(ACCESSIBILITY, "platform.contrast")],
|
|
1745
|
+
["platform.forcedColors", churning(ACCESSIBILITY, "platform.forcedColors")],
|
|
1746
|
+
["platform.invertedColors", churning(ACCESSIBILITY, "platform.invertedColors")],
|
|
1747
|
+
["platform.reducedMotion", churning(ACCESSIBILITY, "platform.reducedMotion")],
|
|
1748
|
+
["platform.reducedTransparency", churning(ACCESSIBILITY, "platform.reducedTransparency")],
|
|
1749
|
+
["platform.clientHints.architecture", churning(NEVER_MODE, "platform.clientHints.architecture")],
|
|
1750
|
+
["platform.clientHints.bitness", churning(NEVER_MODE, "platform.clientHints.bitness")],
|
|
1751
|
+
["platform.clientHints.model", churning(NEVER_MODE, "platform.clientHints.model")],
|
|
1752
|
+
["platform.clientHints.platform", churning(NEVER_MODE, "platform.clientHints.platform")],
|
|
1753
|
+
["platform.clientHints.platformVersion", churning(NEVER_MODE, "platform.clientHints.platformVersion")],
|
|
1754
|
+
["platform.clientHints.uaFullVersion", churning(NEVER_MODE, "platform.clientHints.uaFullVersion")],
|
|
1755
|
+
["platform.clientHints.fullVersionList", churning(NEVER_MODE, "platform.clientHints.fullVersionList")],
|
|
1756
|
+
["platform.clientHints.wow64", churning(NEVER_MODE, "platform.clientHints.wow64")],
|
|
1757
|
+
["platform.clientHints.mobile", churning(NEVER_MODE, "platform.clientHints.mobile")]
|
|
1758
|
+
]);
|
|
1759
|
+
function isChurningClientAttribute(name) {
|
|
1760
|
+
const entry = CLIENT_ATTRIBUTE_CLASSIFICATION.get(name);
|
|
1761
|
+
return entry?.role === "exclude-churning" && entry.presenceOnly !== true;
|
|
1762
|
+
}
|
|
1763
|
+
function isStatsRecordableClientAttribute(name) {
|
|
1764
|
+
return CLIENT_ATTRIBUTE_CLASSIFICATION.get(name) !== void 0 && !isChurningClientAttribute(name);
|
|
1765
|
+
}
|
|
1766
|
+
const CANONICAL_NAME = /* @__PURE__ */ new Map([
|
|
1767
|
+
["platform.navigatorPlatform", "device.platform"],
|
|
1768
|
+
["platform.timezone", "browser.timezone"],
|
|
1769
|
+
["platform.screenResolution", "screen.resolution"],
|
|
1770
|
+
["platform.cookiesEnabled", "browser.cookiesEnabled"],
|
|
1771
|
+
["platform.hardwareConcurrency", "client.hardwareConcurrency"],
|
|
1772
|
+
["platform.deviceMemory", "client.deviceMemory"],
|
|
1773
|
+
["platform.colorDepth", "client.colorDepth"],
|
|
1774
|
+
["platform.vendor", "client.vendor"]
|
|
1775
|
+
]);
|
|
1776
|
+
function normalizeResolution(value) {
|
|
1777
|
+
const pair = value.match(/^\[?\s*(\d+)\s*[x,]\s*(\d+)\s*\]?$/i);
|
|
1778
|
+
if (!pair) return value;
|
|
1779
|
+
const width = Number(pair[1]);
|
|
1780
|
+
const height = Number(pair[2]);
|
|
1781
|
+
return `${Math.max(width, height)}x${Math.min(width, height)}`;
|
|
1782
|
+
}
|
|
1783
|
+
const NORMALIZERS = /* @__PURE__ */ new Map([["screen.resolution", normalizeResolution]]);
|
|
1784
|
+
function canonicalizeClientAttributes(attributes) {
|
|
1785
|
+
const source = attributes ?? {};
|
|
1786
|
+
const canonical = {};
|
|
1787
|
+
for (const name of Object.keys(source)) if (!CANONICAL_NAME.has(name)) canonical[name] = source[name];
|
|
1788
|
+
for (const name of Object.keys(source)) {
|
|
1789
|
+
const target = CANONICAL_NAME.get(name);
|
|
1790
|
+
if (target !== void 0 && !(target in canonical)) canonical[target] = source[name];
|
|
1791
|
+
}
|
|
1792
|
+
for (const [name, normalize] of NORMALIZERS) if (name in canonical) canonical[name] = normalize(canonical[name]);
|
|
1793
|
+
return canonical;
|
|
1794
|
+
}
|
|
1795
|
+
function deviceFingerprintComponents(attributes) {
|
|
1796
|
+
const source = canonicalizeClientAttributes(attributes);
|
|
1797
|
+
const components = {};
|
|
1798
|
+
for (const name of Object.keys(source).sort()) if (CLIENT_ATTRIBUTE_CLASSIFICATION.get(name)?.role === "include") components[name] = source[name];
|
|
1799
|
+
return components;
|
|
1800
|
+
}
|
|
1801
|
+
function computeDeviceFingerprint(attributes) {
|
|
1802
|
+
const components = deviceFingerprintComponents(attributes);
|
|
1803
|
+
const names = Object.keys(components);
|
|
1804
|
+
if (names.length === 0) return null;
|
|
1805
|
+
const payload = JSON.stringify([2, names.map((n) => [n, components[n]])]);
|
|
1806
|
+
return bytesToHex(sha256(new TextEncoder().encode(payload)));
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1576
1809
|
//#endregion
|
|
1577
1810
|
//#region src/signals/validate.ts
|
|
1578
1811
|
const VALID_TIERS = [
|
|
@@ -1792,5 +2025,5 @@ function generateRegistryMarkdown(registry) {
|
|
|
1792
2025
|
}
|
|
1793
2026
|
|
|
1794
2027
|
//#endregion
|
|
1795
|
-
export { COMPOSITION_RISK_RULES, CURRENT_REGISTRY_VERSION, CURRENT_SENSITIVE_REJECTION_LIST_VERSION, FROZEN_FIELDS, REGISTRY_VERSIONS, SENSITIVE_ATTRIBUTE_REJECTION_LIST, SENSITIVE_REJECTION_LIST_VERSIONS, SIGNAL_REGISTRY, SensitiveAttributeRejectionError, TIER_LOCKED_FIELDS, buildFingerprintTree, checkCompositionRisk, checkDeclaredCategory, checkDirectMatch, checkReviewRecordIntegrity, checkSensitiveAttributeCompliance, checkSnapshotConsistency, computeImmutableSnapshot, computeSessionFingerprintHash, evaluateSensitiveAttributeCompliance, findSignalsNeedingReevaluation, generateRegistryMarkdown, getSignal, groupSignals, listShippedSignals, recordSnapshot, registerSignal, resolveSignalsAt, validateRegistry };
|
|
2028
|
+
export { CLIENT_ATTRIBUTE_CLASSIFICATION, COMPOSITION_RISK_RULES, CURRENT_REGISTRY_VERSION, CURRENT_SENSITIVE_REJECTION_LIST_VERSION, DEVICE_FINGERPRINT_PREFIX, DEVICE_FINGERPRINT_VERSION, FROZEN_FIELDS, LANE_ONLY_REASON, LAZY_CHUNK_PRESENCE_REASON, REGISTRY_VERSIONS, SENSITIVE_ATTRIBUTE_REJECTION_LIST, SENSITIVE_REJECTION_LIST_VERSIONS, SIGNAL_REGISTRY, SensitiveAttributeRejectionError, TIER_LOCKED_FIELDS, VENDORED_PRESENCE_REASON, buildFingerprintTree, canonicalizeClientAttributes, checkCompositionRisk, checkDeclaredCategory, checkDirectMatch, checkReviewRecordIntegrity, checkSensitiveAttributeCompliance, checkSnapshotConsistency, computeDeviceFingerprint, computeImmutableSnapshot, computeSessionFingerprintHash, deviceFingerprintComponents, evaluateSensitiveAttributeCompliance, findSignalsNeedingReevaluation, generateRegistryMarkdown, getSignal, groupSignals, isChurningClientAttribute, isStatsRecordableClientAttribute, listShippedSignals, recordSnapshot, registerSignal, resolveSignalsAt, validateRegistry };
|
|
1796
2029
|
//# sourceMappingURL=index.mjs.map
|