eavesdrop-browser 0.2.0__py3-none-any.whl

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.
eavesdrop/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Passive browser data capture."""
2
+
3
+ __version__ = "0.2.0"
eavesdrop/__main__.py ADDED
@@ -0,0 +1,16 @@
1
+ """Command-line entry point."""
2
+
3
+ from eavesdrop.application.runtime import FakeEavesdropRuntime
4
+ from eavesdrop.paths import AppPaths
5
+ from eavesdrop.ui.app import EavesdropApp
6
+
7
+
8
+ def main() -> None:
9
+ """Launch the Textual application."""
10
+ paths = AppPaths.for_user()
11
+ paths.ensure()
12
+ EavesdropApp(FakeEavesdropRuntime()).run()
13
+
14
+
15
+ if __name__ == "__main__":
16
+ main()
@@ -0,0 +1 @@
1
+ """Application boundary."""
@@ -0,0 +1,25 @@
1
+ """Runtime interface consumed by the UI."""
2
+
3
+ from typing import Protocol
4
+
5
+ from eavesdrop.domain.values import ConnectionKind, DashboardSnapshot, SessionId
6
+
7
+
8
+ class EavesdropRuntime(Protocol):
9
+ async def start(self, connection: ConnectionKind) -> SessionId: ...
10
+
11
+ async def dashboard(self) -> DashboardSnapshot: ...
12
+
13
+
14
+ class FakeEavesdropRuntime:
15
+ """Runnable phase-one runtime with no browser or persistence dependencies."""
16
+
17
+ def __init__(self) -> None:
18
+ self._session_id: SessionId | None = None
19
+
20
+ async def start(self, connection: ConnectionKind) -> SessionId:
21
+ self._session_id = SessionId.new()
22
+ return self._session_id
23
+
24
+ async def dashboard(self) -> DashboardSnapshot:
25
+ return DashboardSnapshot(session_id=self._session_id)
@@ -0,0 +1,6 @@
1
+ """Versioned configuration."""
2
+
3
+ from eavesdrop.config.models import CaptureSettings
4
+ from eavesdrop.config.repository import ConfigRepository
5
+
6
+ __all__ = ["CaptureSettings", "ConfigRepository"]
@@ -0,0 +1,44 @@
1
+ """Validated settings models."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import asdict, dataclass
6
+ from typing import Any
7
+
8
+ DEFAULT_AUTHENTICATION_PATH_TERMS = ("login", "signin", "oauth", "token", "auth")
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class CaptureSettings:
13
+ version: int = 1
14
+ maximum_body_mib: int = 10
15
+ authentication_path_terms: tuple[str, ...] = DEFAULT_AUTHENTICATION_PATH_TERMS
16
+
17
+ def __post_init__(self) -> None:
18
+ if self.version != 1:
19
+ raise ValueError("unsupported configuration version")
20
+ if self.maximum_body_mib < 1:
21
+ raise ValueError("maximum_body_mib must be at least 1")
22
+
23
+ @classmethod
24
+ def from_dict(cls, raw: dict[str, Any]) -> CaptureSettings:
25
+ allowed = {"version", "maximum_body_mib", "authentication_path_terms"}
26
+ if raw.keys() - allowed:
27
+ raise ValueError("configuration contains unknown fields")
28
+ terms = raw.get("authentication_path_terms", DEFAULT_AUTHENTICATION_PATH_TERMS)
29
+ if not isinstance(terms, (list, tuple)) or not all(isinstance(x, str) for x in terms):
30
+ raise ValueError("authentication_path_terms must be strings")
31
+ return cls(
32
+ version=int(raw.get("version", 1)),
33
+ maximum_body_mib=int(raw.get("maximum_body_mib", 10)),
34
+ authentication_path_terms=tuple(terms),
35
+ )
36
+
37
+ def to_dict(self) -> dict[str, object]:
38
+ result = asdict(self)
39
+ result["authentication_path_terms"] = list(self.authentication_path_terms)
40
+ return result
41
+
42
+ def excludes_authentication(self, url: str) -> bool:
43
+ lowered = url.lower()
44
+ return any(term.lower() in lowered for term in self.authentication_path_terms)
@@ -0,0 +1,40 @@
1
+ """Atomic last-known-good configuration repository."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ from pathlib import Path
8
+
9
+ from eavesdrop.config.models import CaptureSettings
10
+
11
+
12
+ class ConfigRepository:
13
+ def __init__(self, directory: Path) -> None:
14
+ self._directory = directory
15
+ self._path = directory / "settings.json"
16
+ self._active = CaptureSettings()
17
+
18
+ @property
19
+ def active(self) -> CaptureSettings:
20
+ return self._active
21
+
22
+ def reload(self) -> bool:
23
+ try:
24
+ raw = json.loads(self._path.read_text())
25
+ if not isinstance(raw, dict):
26
+ raise ValueError("configuration root must be an object")
27
+ candidate = CaptureSettings.from_dict(raw)
28
+ except (OSError, ValueError, TypeError, json.JSONDecodeError):
29
+ return False
30
+ self._active = candidate
31
+ return True
32
+
33
+ def save(self, settings: CaptureSettings) -> None:
34
+ self._directory.mkdir(mode=0o700, parents=True, exist_ok=True)
35
+ os.chmod(self._directory, 0o700)
36
+ temporary = self._path.with_suffix(".tmp")
37
+ temporary.write_text(json.dumps(settings.to_dict(), indent=2) + "\n")
38
+ os.chmod(temporary, 0o600)
39
+ temporary.replace(self._path)
40
+ self._active = settings
@@ -0,0 +1 @@
1
+ """Domain values."""
@@ -0,0 +1,25 @@
1
+ """Capture policies that intentionally cannot be serialized."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import re
6
+ from typing import Any
7
+
8
+
9
+ class UnsafeHostBypass:
10
+ __slots__ = ("_hostnames",)
11
+
12
+ def __init__(self) -> None:
13
+ self._hostnames: set[str] = set()
14
+
15
+ def allow_for_session(self, hostname: str) -> None:
16
+ normalized = hostname.strip().lower().rstrip(".")
17
+ if not normalized or not re.fullmatch(r"[a-z0-9.-]+", normalized):
18
+ raise ValueError("a valid hostname is required")
19
+ self._hostnames.add(normalized)
20
+
21
+ def allows(self, hostname: str) -> bool:
22
+ return hostname.strip().lower().rstrip(".") in self._hostnames
23
+
24
+ def __reduce__(self) -> str | tuple[Any, ...]:
25
+ raise TypeError("unsafe bypass is session-only")
@@ -0,0 +1,26 @@
1
+ """Small immutable domain values."""
2
+
3
+ from dataclasses import dataclass
4
+ from enum import StrEnum
5
+ from uuid import UUID, uuid4
6
+
7
+
8
+ @dataclass(frozen=True, slots=True)
9
+ class SessionId:
10
+ value: UUID
11
+
12
+ @classmethod
13
+ def new(cls) -> "SessionId":
14
+ return cls(uuid4())
15
+
16
+
17
+ class ConnectionKind(StrEnum):
18
+ LAUNCH = "launch"
19
+ ATTACH = "attach"
20
+
21
+
22
+ @dataclass(frozen=True, slots=True)
23
+ class DashboardSnapshot:
24
+ session_id: SessionId | None
25
+ saved_captures: int = 0
26
+ discarded_observations: int = 0
eavesdrop/paths.py ADDED
@@ -0,0 +1,40 @@
1
+ """Owner-only application filesystem paths."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from dataclasses import dataclass
7
+ from pathlib import Path
8
+
9
+
10
+ @dataclass(frozen=True, slots=True)
11
+ class AppPaths:
12
+ """All writable paths used by eavesdrop."""
13
+
14
+ root: Path
15
+
16
+ @classmethod
17
+ def for_user(cls) -> AppPaths:
18
+ return cls(Path.home() / ".eavesdrop")
19
+
20
+ @classmethod
21
+ def for_test(cls, root: Path) -> AppPaths:
22
+ return cls(root)
23
+
24
+ @property
25
+ def captures(self) -> Path:
26
+ return self.root / "captures"
27
+
28
+ @property
29
+ def config(self) -> Path:
30
+ return self.root / "config"
31
+
32
+ @property
33
+ def browser_profiles(self) -> Path:
34
+ return self.root / "browser-profiles"
35
+
36
+ def ensure(self) -> None:
37
+ """Create application directories with owner-only permissions."""
38
+ for path in (self.root, self.captures, self.config, self.browser_profiles):
39
+ path.mkdir(mode=0o700, parents=True, exist_ok=True)
40
+ os.chmod(path, 0o700)
eavesdrop/py.typed ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,5 @@
1
+ """Credential-safety boundaries."""
2
+
3
+ from eavesdrop.security.credentials import CredentialRedactor, RedactionResult
4
+
5
+ __all__ = ["CredentialRedactor", "RedactionResult"]
@@ -0,0 +1,74 @@
1
+ """Redact credentials before data crosses a serialization boundary."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import hmac
7
+ import re
8
+ from dataclasses import dataclass
9
+ from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
10
+
11
+ type JsonScalar = str | int | float | bool | None
12
+ type JsonValue = JsonScalar | list[JsonValue] | dict[str, JsonValue]
13
+
14
+ SECRET_KEY_RE = re.compile(
15
+ r"^(?:jwt|token|access_token|refresh_token|id_token|auth_token|bearer|api_key|"
16
+ r"apikey|secret|client_secret|password|passwd|session_id|sessionid|csrf_token|"
17
+ r"xsrf_token|cookie|authorization)$",
18
+ re.IGNORECASE,
19
+ )
20
+ JWT_RE = re.compile(r"^[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}$")
21
+
22
+
23
+ @dataclass(frozen=True, slots=True)
24
+ class RedactionResult:
25
+ value: JsonValue
26
+ count: int
27
+
28
+
29
+ class CredentialRedactor:
30
+ """Replace secrets with installation-stable, non-reversible HMAC markers."""
31
+
32
+ def __init__(self, key: bytes) -> None:
33
+ if len(key) < 32:
34
+ raise ValueError("redaction key must contain at least 32 bytes")
35
+ self._key = key
36
+
37
+ def marker(self, value: object) -> str:
38
+ digest = hmac.new(self._key, str(value).encode(), hashlib.sha256).hexdigest()[:16]
39
+ return f"[REDACTED:{digest}]"
40
+
41
+ def redact(self, value: JsonValue, *, secret_context: bool = False) -> RedactionResult:
42
+ if secret_context:
43
+ return RedactionResult(self.marker(value), 1)
44
+ if isinstance(value, dict):
45
+ output: dict[str, JsonValue] = {}
46
+ count = 0
47
+ for key, child in value.items():
48
+ result = self.redact(child, secret_context=bool(SECRET_KEY_RE.fullmatch(key)))
49
+ output[key] = result.value
50
+ count += result.count
51
+ return RedactionResult(output, count)
52
+ if isinstance(value, list):
53
+ output_list: list[JsonValue] = []
54
+ count = 0
55
+ for child in value:
56
+ result = self.redact(child)
57
+ output_list.append(result.value)
58
+ count += result.count
59
+ return RedactionResult(output_list, count)
60
+ if isinstance(value, str) and JWT_RE.fullmatch(value):
61
+ return RedactionResult(self.marker(value), 1)
62
+ return RedactionResult(value, 0)
63
+
64
+ def sanitize_url(self, url: str) -> tuple[str, int]:
65
+ parts = urlsplit(url)
66
+ query: list[tuple[str, str]] = []
67
+ count = 0
68
+ for key, value in parse_qsl(parts.query, keep_blank_values=True):
69
+ if SECRET_KEY_RE.fullmatch(key) or JWT_RE.fullmatch(value):
70
+ query.append((key, self.marker(value)))
71
+ count += 1
72
+ else:
73
+ query.append((key, value))
74
+ return urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(query), "")), count
@@ -0,0 +1,53 @@
1
+ """Obtain the installation-wide HMAC key from macOS Keychain."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import base64
6
+ import secrets
7
+ import subprocess
8
+ from typing import Protocol
9
+
10
+
11
+ class HmacKeyProvider(Protocol):
12
+ def get_or_create(self) -> bytes: ...
13
+
14
+
15
+ class MacOSKeychainHmacKeyProvider:
16
+ service = "dev.eavesdrop-browser.redaction"
17
+ account = "installation-hmac"
18
+
19
+ def get_or_create(self) -> bytes:
20
+ found = subprocess.run(
21
+ ["security", "find-generic-password", "-s", self.service, "-a", self.account, "-w"],
22
+ check=False,
23
+ capture_output=True,
24
+ text=True,
25
+ )
26
+ if found.returncode == 0:
27
+ return base64.urlsafe_b64decode(found.stdout.strip().encode())
28
+ key = secrets.token_bytes(32)
29
+ encoded = base64.urlsafe_b64encode(key).decode()
30
+ subprocess.run(
31
+ [
32
+ "security",
33
+ "add-generic-password",
34
+ "-U",
35
+ "-s",
36
+ self.service,
37
+ "-a",
38
+ self.account,
39
+ "-w",
40
+ encoded,
41
+ ],
42
+ check=True,
43
+ capture_output=True,
44
+ )
45
+ return key
46
+
47
+
48
+ class MemoryHmacKeyProvider:
49
+ def __init__(self, key: bytes) -> None:
50
+ self._key = key
51
+
52
+ def get_or_create(self) -> bytes:
53
+ return self._key
@@ -0,0 +1 @@
1
+ """Textual user interface."""
eavesdrop/ui/app.py ADDED
@@ -0,0 +1,47 @@
1
+ """Minimal connection-to-dashboard application shell."""
2
+
3
+ from textual.app import App, ComposeResult
4
+ from textual.containers import Center, Vertical
5
+ from textual.screen import Screen
6
+ from textual.widgets import Button, Footer, Header, Label, Static
7
+
8
+ from eavesdrop.application.runtime import EavesdropRuntime
9
+ from eavesdrop.domain.values import ConnectionKind
10
+
11
+
12
+ class DashboardScreen(Screen[None]):
13
+ def compose(self) -> ComposeResult:
14
+ yield Header()
15
+ with Center(), Vertical(id="dashboard"):
16
+ yield Label("Capture dashboard", id="title")
17
+ yield Static("Session ready · 0 captures · 0 discarded")
18
+ yield Footer()
19
+
20
+
21
+ class EavesdropApp(App[None]):
22
+ """Connect to a fake runtime before browser integration is added."""
23
+
24
+ CSS = """
25
+ Center { height: 1fr; }
26
+ Vertical { width: 60; height: auto; padding: 2; border: round $primary; }
27
+ #title { text-style: bold; margin-bottom: 1; }
28
+ Button { width: 100%; margin-top: 1; }
29
+ """
30
+ TITLE = "eavesdrop"
31
+
32
+ def __init__(self, runtime: EavesdropRuntime) -> None:
33
+ super().__init__()
34
+ self.runtime = runtime
35
+
36
+ def compose(self) -> ComposeResult:
37
+ yield Header()
38
+ with Center(), Vertical(id="connection"):
39
+ yield Label("Connect a Chromium browser", id="title")
40
+ yield Static("Phase 1 uses a safe fake runtime. No browser data is read yet.")
41
+ yield Button("Launch placeholder session", id="launch", variant="primary")
42
+ yield Footer()
43
+
44
+ async def on_button_pressed(self, event: Button.Pressed) -> None:
45
+ if event.button.id == "launch":
46
+ await self.runtime.start(ConnectionKind.LAUNCH)
47
+ await self.push_screen(DashboardScreen())
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.5
2
+ Name: eavesdrop-browser
3
+ Version: 0.2.0
4
+ Summary: Passive browser JSON capture with a Textual interface
5
+ Project-URL: Homepage, https://github.com/danlsn/eavesdrop
6
+ Project-URL: Issues, https://github.com/danlsn/eavesdrop/issues
7
+ Project-URL: Repository, https://github.com/danlsn/eavesdrop
8
+ Author: Daniel Nelson
9
+ License: Apache License
10
+ Version 2.0, January 2004
11
+ http://www.apache.org/licenses/
12
+
13
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14
+
15
+ 1. Definitions.
16
+
17
+ "License" shall mean the terms and conditions for use, reproduction,
18
+ and distribution as defined by Sections 1 through 9 of this document.
19
+
20
+ "Licensor" shall mean the copyright owner or entity authorized by
21
+ the copyright owner that is granting the License.
22
+
23
+ "Legal Entity" shall mean the union of the acting entity and all
24
+ other entities that control, are controlled by, or are under common
25
+ control with that entity. For the purposes of this definition,
26
+ "control" means (i) the power, direct or indirect, to cause the
27
+ direction or management of such entity, whether by contract or
28
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
29
+ outstanding shares, or (iii) beneficial ownership of such entity.
30
+
31
+ "You" (or "Your") shall mean an individual or Legal Entity
32
+ exercising permissions granted by this License.
33
+
34
+ "Source" form shall mean the preferred form for making modifications,
35
+ including but not limited to software source code, documentation
36
+ source, and configuration files.
37
+
38
+ "Object" form shall mean any form resulting from mechanical
39
+ transformation or translation of a Source form, including but
40
+ not limited to compiled object code, generated documentation,
41
+ and conversions to other media types.
42
+
43
+ "Work" shall mean the work of authorship, whether in Source or
44
+ Object form, made available under the License, as indicated by a
45
+ copyright notice that is included in or attached to the work
46
+ (an example is provided in the Appendix below).
47
+
48
+ "Derivative Works" shall mean any work, whether in Source or Object
49
+ form, that is based on (or derived from) the Work and for which the
50
+ editorial revisions, annotations, elaborations, or other modifications
51
+ represent, as a whole, an original work of authorship. For the purposes
52
+ of this License, Derivative Works shall not include works that remain
53
+ separable from, or merely link (or bind by name) to the interfaces of,
54
+ the Work and Derivative Works thereof.
55
+
56
+ "Contribution" shall mean any work of authorship, including
57
+ the original version of the Work and any modifications or additions
58
+ to that Work or Derivative Works thereof, that is intentionally
59
+ submitted to Licensor for inclusion in the Work by the copyright owner
60
+ or by an individual or Legal Entity authorized to submit on behalf of
61
+ the copyright owner. For the purposes of this definition, "submitted"
62
+ means any form of electronic, verbal, or written communication sent
63
+ to the Licensor or its representatives, including but not limited to
64
+ communication on electronic mailing lists, source code control systems,
65
+ and issue tracking systems that are managed by, or on behalf of, the
66
+ Licensor for the purpose of discussing and improving the Work, but
67
+ excluding communication that is conspicuously marked or otherwise
68
+ designated in writing by the copyright owner as "Not a Contribution."
69
+
70
+ "Contributor" shall mean Licensor and any individual or Legal Entity
71
+ on behalf of whom a Contribution has been received by Licensor and
72
+ subsequently incorporated within the Work.
73
+
74
+ 2. Grant of Copyright License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ copyright license to reproduce, prepare Derivative Works of,
78
+ publicly display, publicly perform, sublicense, and distribute the
79
+ Work and such Derivative Works in Source or Object form.
80
+
81
+ 3. Grant of Patent License. Subject to the terms and conditions of
82
+ this License, each Contributor hereby grants to You a perpetual,
83
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84
+ (except as stated in this section) patent license to make, have made,
85
+ use, offer to sell, sell, import, and otherwise transfer the Work,
86
+ where such license applies only to those patent claims licensable
87
+ by such Contributor that are necessarily infringed by their
88
+ Contribution(s) alone or by combination of their Contribution(s)
89
+ with the Work to which such Contribution(s) was submitted. If You
90
+ institute patent litigation against any entity (including a
91
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
92
+ or a Contribution incorporated within the Work constitutes direct
93
+ or contributory patent infringement, then any patent licenses
94
+ granted to You under this License for that Work shall terminate
95
+ as of the date such litigation is filed.
96
+
97
+ 4. Redistribution. You may reproduce and distribute copies of the
98
+ Work or Derivative Works thereof in any medium, with or without
99
+ modifications, and in Source or Object form, provided that You
100
+ meet the following conditions:
101
+
102
+ (a) You must give any other recipients of the Work or
103
+ Derivative Works a copy of this License; and
104
+
105
+ (b) You must cause any modified files to carry prominent notices
106
+ stating that You changed the files; and
107
+
108
+ (c) You must retain, in the Source form of any Derivative Works
109
+ that You distribute, all copyright, patent, trademark, and
110
+ attribution notices from the Source form of the Work,
111
+ excluding those notices that do not pertain to any part of
112
+ the Derivative Works; and
113
+
114
+ (d) If the Work includes a "NOTICE" text file as part of its
115
+ distribution, then any Derivative Works that You distribute must
116
+ include a readable copy of the attribution notices contained
117
+ within such NOTICE file, excluding those notices that do not
118
+ pertain to any part of the Derivative Works, in at least one
119
+ of the following places: within a NOTICE text file distributed
120
+ as part of the Derivative Works; within the Source form or
121
+ documentation, if provided along with the Derivative Works; or,
122
+ within a display generated by the Derivative Works, if and
123
+ wherever such third-party notices normally appear. The contents
124
+ of the NOTICE file are for informational purposes only and
125
+ do not modify the License. You may add Your own attribution
126
+ notices within Derivative Works that You distribute, alongside
127
+ or as an addendum to the NOTICE text from the Work, provided
128
+ that such additional attribution notices cannot be construed
129
+ as modifying the License.
130
+
131
+ You may add Your own copyright statement to Your modifications and
132
+ may provide additional or different license terms and conditions
133
+ for use, reproduction, or distribution of Your modifications, or
134
+ for any such Derivative Works as a whole, provided Your use,
135
+ reproduction, and distribution of the Work otherwise complies with
136
+ the conditions stated in this License.
137
+
138
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
139
+ any Contribution intentionally submitted for inclusion in the Work
140
+ by You to the Licensor shall be under the terms and conditions of
141
+ this License, without any additional terms or conditions.
142
+ Notwithstanding the above, nothing herein shall supersede or modify
143
+ the terms of any separate license agreement you may have executed
144
+ with Licensor regarding such Contributions.
145
+
146
+ 6. Trademarks. This License does not grant permission to use the trade
147
+ names, trademarks, service marks, or product names of the Licensor,
148
+ except as required for reasonable and customary use in describing the
149
+ origin of the Work and reproducing the content of the NOTICE file.
150
+
151
+ 7. Disclaimer of Warranty. Unless required by applicable law or
152
+ agreed to in writing, Licensor provides the Work (and each
153
+ Contributor provides its Contributions) on an "AS IS" BASIS,
154
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155
+ implied, including, without limitation, any warranties or conditions
156
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157
+ PARTICULAR PURPOSE. You are solely responsible for determining the
158
+ appropriateness of using or redistributing the Work and assume any
159
+ risks associated with Your exercise of permissions under this License.
160
+
161
+ 8. Limitation of Liability. In no event and under no legal theory,
162
+ whether in tort (including negligence), contract, or otherwise,
163
+ unless required by applicable law (such as deliberate and grossly
164
+ negligent acts) or agreed to in writing, shall any Contributor be
165
+ liable to You for damages, including any direct, indirect, special,
166
+ incidental, or consequential damages of any character arising as a
167
+ result of this License or out of the use or inability to use the
168
+ Work (including but not limited to damages for loss of goodwill,
169
+ work stoppage, computer failure or malfunction, or any and all
170
+ other commercial damages or losses), even if such Contributor
171
+ has been advised of the possibility of such damages.
172
+
173
+ 9. Accepting Warranty or Additional Liability. While redistributing
174
+ the Work or Derivative Works thereof, You may choose to offer,
175
+ and charge a fee for, acceptance of support, warranty, indemnity,
176
+ or other liability obligations and/or rights consistent with this
177
+ License. However, in accepting such obligations, You may act only
178
+ on Your own behalf and on Your sole responsibility, not on behalf
179
+ of any other Contributor, and only if You agree to indemnify,
180
+ defend, and hold each Contributor harmless for any liability
181
+ incurred by, or claims asserted against, such Contributor by reason
182
+ of your accepting any such warranty or additional liability.
183
+
184
+ END OF TERMS AND CONDITIONS
185
+
186
+ APPENDIX: How to apply the Apache License to your work.
187
+
188
+ To apply the Apache License to your work, attach the following
189
+ boilerplate notice, with the fields enclosed by brackets "[]"
190
+ replaced with your own identifying information. (Don't include
191
+ the brackets!) The text should be enclosed in the appropriate
192
+ comment syntax for the file format. We also recommend that a
193
+ file or class name and description of purpose be included on the
194
+ same "printed page" as the copyright notice for easier
195
+ identification within third-party archives.
196
+
197
+ Copyright [yyyy] [name of copyright owner]
198
+
199
+ Licensed under the Apache License, Version 2.0 (the "License");
200
+ you may not use this file except in compliance with the License.
201
+ You may obtain a copy of the License at
202
+
203
+ http://www.apache.org/licenses/LICENSE-2.0
204
+
205
+ Unless required by applicable law or agreed to in writing, software
206
+ distributed under the License is distributed on an "AS IS" BASIS,
207
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
+ See the License for the specific language governing permissions and
209
+ limitations under the License.
210
+ License-File: LICENSE
211
+ Keywords: browser,chromium,developer-tools,json,textual
212
+ Classifier: Development Status :: 2 - Pre-Alpha
213
+ Classifier: Environment :: Console
214
+ Classifier: Intended Audience :: Developers
215
+ Classifier: License :: OSI Approved :: Apache Software License
216
+ Classifier: Operating System :: MacOS
217
+ Classifier: Programming Language :: Python :: 3
218
+ Classifier: Programming Language :: Python :: 3.12
219
+ Classifier: Typing :: Typed
220
+ Requires-Python: >=3.12
221
+ Requires-Dist: platformdirs<5,>=4.3
222
+ Requires-Dist: textual<9,>=6.0
223
+ Description-Content-Type: text/markdown
224
+
225
+ # eavesdrop
226
+
227
+ `eavesdrop` is a passive browser-data capture tool with a Textual interface. It launches or attaches to one Chromium browser, observes JSON loaded over HTTP and WebSockets, redacts credentials, and saves portable JSON files with searchable SQLite metadata.
228
+
229
+ The project is in pre-alpha. The packaged Textual shell and fake runtime exist; browser capture is not implemented yet.
230
+
231
+ ## MVP at a glance
232
+
233
+ - macOS and Python 3.12+
234
+ - Chromium browser discovery, isolated debug profiles, and CDP attachment
235
+ - HTTP and bidirectional WebSocket JSON capture
236
+ - credential redaction before disk, using stable keyed hashes
237
+ - live dashboard, charts, capture table, and pretty JSON preview
238
+ - configurable rules, exclusions, and passive pagination coverage
239
+
240
+ ## Documents
241
+
242
+ - [Product specification](docs/product-spec.md)
243
+ - [Architecture](docs/architecture.md)
244
+ - [Implementation plan](docs/implementation-plan.md)
245
+ - [Roadmap](docs/roadmap.md)
246
+ - [GitHub implementation issues](docs/github-issues.md)
247
+
248
+ ## Install
249
+
250
+ ```bash
251
+ pipx install eavesdrop-browser
252
+ eavesdrop
253
+ ```
254
+
255
+ ## Develop
256
+
257
+ ```bash
258
+ uv sync --all-groups
259
+ uv run pytest
260
+ uv run eavesdrop
261
+ uv build
262
+ ```
@@ -0,0 +1,22 @@
1
+ eavesdrop/__init__.py,sha256=SEedizBLu1UhxpavtrsD53dOPjW1KI9k7F8Aw9iouxM,59
2
+ eavesdrop/__main__.py,sha256=bU9eqGqq5pF2sJYjgpBKvR1tp1cKYlk4nENtzhmMu48,377
3
+ eavesdrop/paths.py,sha256=wRKGGHeb-V46UVjcbL-hJHOc9gT5PKdIE_IQtABrzS4,1015
4
+ eavesdrop/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ eavesdrop/application/__init__.py,sha256=3xqqLXJuJY_chIvRIg42vC_ndGOaA4kT5-pmgOc9-fY,28
6
+ eavesdrop/application/runtime.py,sha256=OXccnR8JN7MhnACZEZYk6ZCn3yuUhlpr0EoigDwQIiQ,774
7
+ eavesdrop/config/__init__.py,sha256=MgMT_Rv0Piquz4TaXjYCTJ91iUwBX13-eCm-UDswPro,192
8
+ eavesdrop/config/models.py,sha256=6o0l31nTzTt3pRLNAfCUXykGAynzPl_xrbVrp2J_sE0,1727
9
+ eavesdrop/config/repository.py,sha256=HZcQxPdzU7rUd-lJwC1M0lWGJSbY8l6K8Qph_ZgvubA,1295
10
+ eavesdrop/domain/__init__.py,sha256=u1ITUtxqGFacgmpo_4KOfGdRV6-Dgq1MPG0rhKtDf-Y,21
11
+ eavesdrop/domain/policies.py,sha256=5X2-aQiPoR6u1UodDmWrJE9godDAxRcttXU4nMCn3bI,784
12
+ eavesdrop/domain/values.py,sha256=6YH62oDUE_Tl-KjttC4htYzKOCYYVQsym7hCjRe32a0,513
13
+ eavesdrop/security/__init__.py,sha256=575zKV7qTYh06TpbLUdDGkVHPQPwnji2HotA1DSu9QE,169
14
+ eavesdrop/security/credentials.py,sha256=zbnU84twFcIPupRLxqUUYSCRh1qNvbCnjYTaQiy10AU,2833
15
+ eavesdrop/security/hmac_key.py,sha256=2A3ivz1JaUFmP7Mu1qi94WNsBUnNOHf8Cg6Aaw0F-UY,1380
16
+ eavesdrop/ui/__init__.py,sha256=BOQ34R6NEQoYQlleI-jN33thmz9j1ZXevEATg2Z-qt8,30
17
+ eavesdrop/ui/app.py,sha256=oAqUbR26ybiJ_j44dXkIxytXVlnlaMW7RcNHogXe6-Y,1739
18
+ eavesdrop_browser-0.2.0.dist-info/METADATA,sha256=qllYuxCv4JN-fP47xkba8zseI2-_C-j6liX16dAaaqQ,15005
19
+ eavesdrop_browser-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
20
+ eavesdrop_browser-0.2.0.dist-info/entry_points.txt,sha256=X9vbjbO43VMAfZu7-78kMLvGeCZp33VCFf5InMc3Ibk,54
21
+ eavesdrop_browser-0.2.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ eavesdrop_browser-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ eavesdrop = eavesdrop.__main__:main
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.