2 Commits
Author SHA1 Message Date
dsqlandClaude Opus 4.8 99059a0c71 add package: pyproject + src
TLSSession over aioweb's backend seam by composition: one session class
delegates the four seams to an injected backend. ships CurlCffi (curl_cffi
impersonate) and Noble (noble_tls Client) backends plus the TLSBackend
protocol for custom clients. tls clients are optional extras ([curl]/[noble])
with guarded imports; all aioweb features (domain/header/ephemeral/proxy/
retry/preview) inherited unchanged. src/ multi-module layout, hatchling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 18:43:52 -04:00
dsql 1a438640fc init: tls-fingerprinting backends for aioweb
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 18:43:52 -04:00
2 changed files with 6 additions and 16 deletions
+5 -14
View File
@@ -16,15 +16,13 @@ TLSSession(backend=MyBackend(...)) # or one you write — see "Writing your ow
## Install ## Install
Depends on `aioweb`. The TLS clients are **optional extras** — install the backend(s) Depends on `aioweb`. The TLS clients are **optional extras** — install the backend you
you want; importing the package never fails because an extra is missing. want; importing the package never fails because an extra is missing.
`requirements.txt` (pick the extra you need): `requirements.txt`:
``` ```
aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0 aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
aioweb_tls[all] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0
``` ```
Direct: Direct:
@@ -32,17 +30,10 @@ Direct:
```bash ```bash
pip install "aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0" pip install "aioweb_tls[curl] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
pip install "aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0" pip install "aioweb_tls[noble] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
pip install "aioweb_tls[all] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aioweb_tls.git@v0.1.0"
``` ```
- `[curl]` → curl_cffi backend · `[noble]` → noble_tls backend · `[all]` → both. Constructing a backend whose client isn't installed raises a clear `RuntimeError`
- **No extra** (`pip install aioweb_tls`) is also valid: you get `TLSSession` and the naming the extra — the error fires at construction, never at import.
`TLSBackend` protocol — the framework and the bring-your-own-backend path — but no
bundled client. `CurlCffi()` / `Noble()` then raise a clear `RuntimeError` naming the
extra to install. Use a bare install when you only need a custom backend of your own.
Constructing a backend whose client isn't installed raises that `RuntimeError` at
construction, never at import.
## curl_cffi backend ## curl_cffi backend
-1
View File
@@ -14,7 +14,6 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
curl = ["curl_cffi>=0.15"] curl = ["curl_cffi>=0.15"]
noble = ["noble-tls>=0.1.5"] noble = ["noble-tls>=0.1.5"]
all = ["curl_cffi>=0.15", "noble-tls>=0.1.5"]
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["src/aioweb_tls"] packages = ["src/aioweb_tls"]