rom-runtime 0.1.0__tar.gz

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.
Files changed (77) hide show
  1. rom_runtime-0.1.0/Cargo.toml +45 -0
  2. rom_runtime-0.1.0/PKG-INFO +74 -0
  3. rom_runtime-0.1.0/README.md +46 -0
  4. rom_runtime-0.1.0/bindings/gom-python/Cargo.lock +1364 -0
  5. rom_runtime-0.1.0/bindings/gom-python/Cargo.toml +20 -0
  6. rom_runtime-0.1.0/bindings/gom-python/README.md +46 -0
  7. rom_runtime-0.1.0/bindings/gom-python/rust/lib.rs +12 -0
  8. rom_runtime-0.1.0/bindings/gom-python/scripts/smoke.py +22 -0
  9. rom_runtime-0.1.0/crates/rom-core/Cargo.toml +13 -0
  10. rom_runtime-0.1.0/crates/rom-core/src/engine.rs +92 -0
  11. rom_runtime-0.1.0/crates/rom-core/src/error.rs +11 -0
  12. rom_runtime-0.1.0/crates/rom-core/src/lib.rs +5 -0
  13. rom_runtime-0.1.0/crates/rom-runtime/Cargo.toml +18 -0
  14. rom_runtime-0.1.0/crates/rom-runtime/examples/fingerprintjs_report.rs +13 -0
  15. rom_runtime-0.1.0/crates/rom-runtime/src/bin/rom_bridge.rs +39 -0
  16. rom_runtime-0.1.0/crates/rom-runtime/src/bridge.rs +111 -0
  17. rom_runtime-0.1.0/crates/rom-runtime/src/compat.rs +214 -0
  18. rom_runtime-0.1.0/crates/rom-runtime/src/config.rs +82 -0
  19. rom_runtime-0.1.0/crates/rom-runtime/src/error.rs +13 -0
  20. rom_runtime-0.1.0/crates/rom-runtime/src/fingerprintjs.rs +188 -0
  21. rom_runtime-0.1.0/crates/rom-runtime/src/lib.rs +560 -0
  22. rom_runtime-0.1.0/crates/rom-runtime/src/runtime.rs +41 -0
  23. rom_runtime-0.1.0/crates/rom-runtime/src/tests_cookies.rs +159 -0
  24. rom_runtime-0.1.0/crates/rom-runtime/src/tests_cors.rs +263 -0
  25. rom_runtime-0.1.0/crates/rom-runtime/src/tests_events.rs +95 -0
  26. rom_runtime-0.1.0/crates/rom-runtime/src/tests_eventsource/parsing.rs +251 -0
  27. rom_runtime-0.1.0/crates/rom-runtime/src/tests_eventsource.rs +571 -0
  28. rom_runtime-0.1.0/crates/rom-runtime/src/tests_fetch_semantics.rs +210 -0
  29. rom_runtime-0.1.0/crates/rom-runtime/src/tests_file_reader.rs +85 -0
  30. rom_runtime-0.1.0/crates/rom-runtime/src/tests_layout_observers.rs +95 -0
  31. rom_runtime-0.1.0/crates/rom-runtime/src/tests_messaging.rs +188 -0
  32. rom_runtime-0.1.0/crates/rom-runtime/src/tests_mutation_observer.rs +105 -0
  33. rom_runtime-0.1.0/crates/rom-runtime/src/tests_navigator.rs +123 -0
  34. rom_runtime-0.1.0/crates/rom-runtime/src/tests_parsing.rs +82 -0
  35. rom_runtime-0.1.0/crates/rom-runtime/src/tests_timers.rs +74 -0
  36. rom_runtime-0.1.0/crates/rom-runtime/src/tests_viewport.rs +84 -0
  37. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto/advanced.rs +446 -0
  38. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto/jwk.rs +117 -0
  39. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto/lengths.rs +336 -0
  40. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto/params.rs +499 -0
  41. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto/wrapping.rs +182 -0
  42. rom_runtime-0.1.0/crates/rom-runtime/src/tests_webcrypto.rs +420 -0
  43. rom_runtime-0.1.0/crates/rom-runtime/src/tests_websocket.rs +426 -0
  44. rom_runtime-0.1.0/crates/rom-runtime/tests/bridge_cli.rs +64 -0
  45. rom_runtime-0.1.0/crates/rom-webapi/Cargo.toml +32 -0
  46. rom_runtime-0.1.0/crates/rom-webapi/src/bootstrap.rs +312 -0
  47. rom_runtime-0.1.0/crates/rom-webapi/src/config.rs +31 -0
  48. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto/aes.rs +387 -0
  49. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto/core.rs +181 -0
  50. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto/gcm.rs +138 -0
  51. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto/ops.rs +276 -0
  52. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto/types.rs +194 -0
  53. rom_runtime-0.1.0/crates/rom-webapi/src/host_crypto.rs +494 -0
  54. rom_runtime-0.1.0/crates/rom-webapi/src/host_fetch.rs +99 -0
  55. rom_runtime-0.1.0/crates/rom-webapi/src/host_url.rs +68 -0
  56. rom_runtime-0.1.0/crates/rom-webapi/src/host_websocket.rs +407 -0
  57. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_body.js +593 -0
  58. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_cookie.js +328 -0
  59. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_crypto.js +457 -0
  60. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_crypto_params.js +491 -0
  61. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_dom.js +404 -0
  62. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_eventsource.js +276 -0
  63. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_fetch.js +486 -0
  64. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_globals.js +342 -0
  65. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_messaging.js +462 -0
  66. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_navigator.js +448 -0
  67. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_observers.js +344 -0
  68. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_parser.js +171 -0
  69. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_prelude.js +299 -0
  70. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_textcodecs.js +316 -0
  71. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_url.js +303 -0
  72. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_urlpattern.js +221 -0
  73. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_viewport.js +130 -0
  74. rom_runtime-0.1.0/crates/rom-webapi/src/js/bootstrap_websocket.js +309 -0
  75. rom_runtime-0.1.0/crates/rom-webapi/src/lib.rs +9 -0
  76. rom_runtime-0.1.0/pyproject.toml +39 -0
  77. rom_runtime-0.1.0/src/rom/__init__.py +92 -0
@@ -0,0 +1,45 @@
1
+ [workspace]
2
+ members = [
3
+ "crates/rom-core",
4
+ "crates/rom-webapi",
5
+ "crates/rom-runtime",
6
+ ]
7
+ default-members = [
8
+ "crates/rom-core",
9
+ "crates/rom-webapi",
10
+ "crates/rom-runtime",
11
+ ]
12
+ resolver = "2"
13
+
14
+ [workspace.package]
15
+ edition = "2024"
16
+ homepage = "https://github.com/Rxflex/rom"
17
+ license = "MIT"
18
+ repository = "https://github.com/Rxflex/rom"
19
+ version = "0.1.0"
20
+
21
+ [workspace.dependencies]
22
+ aes = "0.8.4"
23
+ aes-kw = "0.2.1"
24
+ aes-gcm = "0.10.3"
25
+ base64 = "0.22.1"
26
+ cbc = "0.1.2"
27
+ hkdf = "0.12.4"
28
+ hmac = "0.12.1"
29
+ getrandom = "0.3.3"
30
+ pbkdf2 = "0.12.2"
31
+ rcgen = "0.14.7"
32
+ rom-core = { path = "crates/rom-core" }
33
+ rom-runtime = { path = "crates/rom-runtime" }
34
+ rom-webapi = { path = "crates/rom-webapi" }
35
+ rquickjs = "0.11.0"
36
+ rustls = "0.23.37"
37
+ serde = { version = "1.0.228", features = ["derive"] }
38
+ serde_json = "1.0.145"
39
+ sha1 = "0.10.6"
40
+ sha2 = "0.10.9"
41
+ thiserror = "2.0.17"
42
+ tungstenite = { version = "0.28.0", features = ["rustls-tls-native-roots"] }
43
+ typenum = "1.19.0"
44
+ ureq = "3.2.0"
45
+ url = "2.5.7"
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 2.4
2
+ Name: rom-runtime
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Rust
15
+ Classifier: Topic :: Internet
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Summary: Python wrapper for the ROM browser-like runtime
18
+ Keywords: rom,runtime,browser,web-api,fingerprint
19
+ Home-Page: https://github.com/Rxflex/rom
20
+ Author: Rxflex
21
+ License: MIT
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Project-URL: Homepage, https://github.com/Rxflex/rom
25
+ Project-URL: Issues, https://github.com/Rxflex/rom/issues
26
+ Project-URL: Repository, https://github.com/Rxflex/rom
27
+
28
+ # `rom-runtime`
29
+
30
+ Python bindings for the ROM browser-like runtime.
31
+
32
+ This package exposes a thin Python API on top of ROM:
33
+
34
+ - `eval()`
35
+ - `eval_async()`
36
+ - `eval_json()`
37
+ - `surface_snapshot()`
38
+ - `fingerprint_probe()`
39
+ - `run_fingerprintjs_harness()`
40
+ - `fingerprintjs_version()`
41
+
42
+ It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
43
+
44
+ ## Install
45
+
46
+ ```bash
47
+ pip install rom-runtime
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ ```python
53
+ from rom import RomRuntime, has_native_binding
54
+
55
+ runtime = RomRuntime({"href": "https://example.test/"})
56
+ href = runtime.eval_async("(async () => location.href)()")
57
+
58
+ print("native:", has_native_binding())
59
+ print(href)
60
+ ```
61
+
62
+ ## Optional native build from source
63
+
64
+ ```bash
65
+ python -m pip install maturin
66
+ python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
67
+ ```
68
+
69
+ ## Environment
70
+
71
+ - `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
72
+ - `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
73
+ - `ROM_BRIDGE_CWD`: working directory used by the CLI fallback
74
+
@@ -0,0 +1,46 @@
1
+ # `rom-runtime`
2
+
3
+ Python bindings for the ROM browser-like runtime.
4
+
5
+ This package exposes a thin Python API on top of ROM:
6
+
7
+ - `eval()`
8
+ - `eval_async()`
9
+ - `eval_json()`
10
+ - `surface_snapshot()`
11
+ - `fingerprint_probe()`
12
+ - `run_fingerprintjs_harness()`
13
+ - `fingerprintjs_version()`
14
+
15
+ It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ pip install rom-runtime
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ from rom import RomRuntime, has_native_binding
27
+
28
+ runtime = RomRuntime({"href": "https://example.test/"})
29
+ href = runtime.eval_async("(async () => location.href)()")
30
+
31
+ print("native:", has_native_binding())
32
+ print(href)
33
+ ```
34
+
35
+ ## Optional native build from source
36
+
37
+ ```bash
38
+ python -m pip install maturin
39
+ python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
40
+ ```
41
+
42
+ ## Environment
43
+
44
+ - `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
45
+ - `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
46
+ - `ROM_BRIDGE_CWD`: working directory used by the CLI fallback