fiftyone.devicedetection.shared 4.5.0-alpha.8 → 4.5.0-alpha.80

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.
@@ -48,7 +48,62 @@ module.exports = {
48
48
  '"Google Chrome";v="98"'],
49
49
  ['header.sec-ch-ua-platform', '"Windows"'],
50
50
  ['header.sec-ch-ua-platform-version', '"14.0.0"']
51
- ])
51
+ ]),
52
+
53
+ // A note on User-Agent Client Hint representations:
54
+ // There are 3 common ways to represent UACH:
55
+ // - [HTTP header map](https:#wicg.github.io/ua-client-hints/)
56
+ // - getHighEntropyValues() JS API call result in JSON format
57
+ // - Structured User Agent Object from OpenRTB 2.6
58
+
59
+ // Links:
60
+ // - [getHighEntropyValues()](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues)
61
+ // - [device.sua](https://51degrees.com/blog/openrtb-structured-user-agent-and-user-agent-client-hints)
62
+ // - [OpenRTB 2.6 spec](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectuseragent)
63
+
64
+ // 51Degrees historically used HTTP header map to represent User-Agent Client Hints and expected the evidence to
65
+ // be provided as HTTP headers (or same name query parameters).
66
+
67
+ // However in version 4.5 we introduced the ability to perform device detection using the 2 other User-Agent
68
+ // Client Hints representations as evidence (internally it is done through conversion to the HTTP-header
69
+ // representation, but it's an implementation detail). The 2 evidence parameter names in question are:
70
+ // `51D_gethighentropyvalues` and `51D_structureduseragent` - the engine consumes them as either
71
+ // query or cookie params.
72
+
73
+ // `query.51D_gethighentropyvalues` or `cookie.51D_gethighentropyvalues` is a base64-encoded JSON-string result of
74
+ // calling a getHighEntropyValues() API, that normally would return a value similar to the below:
75
+ //
76
+ // {"architecture":"arm","brands":[{"brand":"Google Chrome","version":"131"},{"brand":"Chromium","version":"131"}
77
+ // ,{"brand":"Not_A Brand","version":"24"}],"fullVersionList":[{"brand":"Google Chrome","version":"131.0.6778.140"}
78
+ // ,{"brand":"Chromium","version":"131.0.6778.140"},{"brand":"Not_A Brand","version":"24.0.0.0"}],
79
+ // "mobile":false,"model":"","platform":"macOS","platformVersion":"15.1.1"}
80
+ //
81
+ // to obtain the below evidence we called this JavaScript snippet in the Chrome browser dev console:
82
+ // `btoa(JSON.stringify(await navigator.userAgentData.getHighEntropyValues(
83
+ // ['bitness', 'architecture','fullVersionList','model', 'platformVersion'])))`
84
+ new Map([
85
+ [
86
+ 'query.51d_gethighentropyvalues',
87
+ 'eyJhcmNoaXRlY3R1cmUiOiJhcm0iLCJicmFuZHMiOlt7ImJyYW5kIjoiR29vZ2xlIENocm9tZSIsInZlcnNpb24iOiIxMzEifSx7ImJyY' +
88
+ 'W5kIjoiQ2hyb21pdW0iLCJ2ZXJzaW9uIjoiMTMxIn0seyJicmFuZCI6Ik5vdF9BIEJyYW5kIiwidmVyc2lvbiI6IjI0In1dLCJmdWxsVmV' +
89
+ 'yc2lvbkxpc3QiOlt7ImJyYW5kIjoiR29vZ2xlIENocm9tZSIsInZlcnNpb24iOiIxMzEuMC42Nzc4LjE0MCJ9LHsiYnJhbmQiOiJDaHJv' +
90
+ 'bWl1bSIsInZlcnNpb24iOiIxMzEuMC42Nzc4LjE0MCJ9LHsiYnJhbmQiOiJOb3RfQSBCcmFuZCIsInZlcnNpb24iOiIyNC4wLjAuMCJ9X' +
91
+ 'SwibW9iaWxlIjpmYWxzZSwibW9kZWwiOiIiLCJwbGF0Zm9ybSI6Im1hY09TIiwicGxhdGZvcm1WZXJzaW9uIjoiMTUuMS4xIn0='
92
+ ]
93
+ ]),
94
+
95
+ // `query.51D_structureduseragent` or `cookie.51D_structureduseragent` is a JSON-string representation of
96
+ // User-Agent Client Hints used in the
97
+ // [OpenRTB 2.6](https://github.com/InteractiveAdvertisingBureau/openrtb2.x/blob/main/2.6.md#objectuseragent)
98
+ new Map([
99
+ [
100
+ 'query.51D_structureduseragent',
101
+ '{"browsers":[{"brand":"Chromium","version":["124","0","6367","91"]},{"brand":' +
102
+ '"Google Chrome","version":["124","0","6367","91"]},{"brand":"Not-A.Brand","version"' +
103
+ ':["99","0","0","0"]}],"platform":{"brand":"Windows","version":["14","0","0"]},' +
104
+ '"mobile":0,"architecture":"x86","source":2}'
105
+ ]
106
+ ]),
52
107
  ],
53
108
  fileNames: {
54
109
  enterpriseDataFileName: 'Enterprise-HashV41.hash',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.devicedetection.shared",
3
- "version": "4.5.0-alpha.8",
3
+ "version": "4.5.0-alpha.80",
4
4
  "description": "Shared functionality for implementing device detection engine for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",