2 Commits
Author SHA1 Message Date
dsqlandClaude Opus 4.8 a0c9b03015 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]/[all]) 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:49:51 -04:00
dsql aa378887d8 init: tls-fingerprinting backends for aioweb
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 18:49:51 -04:00
2 changed files with 16 additions and 6 deletions
+15 -6
View File
@@ -16,13 +16,15 @@ 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 you Depends on `aioweb`. The TLS clients are **optional extras** — install the backend(s)
want; importing the package never fails because an extra is missing. you want; importing the package never fails because an extra is missing.
`requirements.txt`: `requirements.txt` (pick the extra you need):
``` ```
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:
@@ -30,10 +32,17 @@ 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"
``` ```
Constructing a backend whose client isn't installed raises a clear `RuntimeError` - `[curl]` → curl_cffi backend · `[noble]` → noble_tls backend · `[all]` → both.
naming the extra — the error fires at construction, never at import. - **No extra** (`pip install aioweb_tls`) is also valid: you get `TLSSession` and the
`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,6 +14,7 @@ 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"]