Skip to content

feat: signed key directory, wingfoot register, and PyPI publishing - #1

Merged
AmirF194 merged 4 commits into
mainfrom
feat/web-bot-auth-registration
Jul 7, 2026
Merged

feat: signed key directory, wingfoot register, and PyPI publishing#1
AmirF194 merged 4 commits into
mainfrom
feat/web-bot-auth-registration

Conversation

@AmirF194

@AmirF194 AmirF194 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What's in here

  • Signed key directory responses (RFC 9421 directory draft §5.2): sign_directory/verify_directory, wingfoot directory --sign. Profile verified byte-exact against Cloudflare's live reference directory.
  • wingfoot register — no verifier offers automated registration yet (each runs a human-reviewed form), so this command preflights your hosted directory the way a reviewer would, then prints a ready-to-paste registration packet for Cloudflare and DataDome. Supports --email, --user-agent, --open, --no-check.
  • fix(http): send a real User-Agent instead of urllib's CDN-blocked default.
  • CI: publish to PyPI on GitHub Release via Trusted Publishing (OIDC, no stored tokens). Pending publisher is already registered on PyPI.

Test plan

  • 33 passed, 2 skipped locally; new tests/test_register.py covers the packet fields, provider registry, and every preflight failure mode without network.
  • Built wheel installed into a fresh venv: wingfoot --version and wingfoot demo (403 -> 200) both pass.
  • Live run of wingfoot register against the real fastinfer.org directory: all preflight checks green.

AmirF194 added 4 commits July 3, 2026 19:37
wingfoot's HTTP client went out as "Python-urllib/x.y", which Cloudflare and
Akamai block outright as an unidentified bot. That made `wingfoot doctor` (and
directory fetches) fail with 403 against real CDN-fronted sites before the tool
could even prove its identity. Send "wingfoot/<version> (+repo)" by default,
overridable via the headers argument. Covered by tests/test_http.py.
Cloudflare's verified-bot submission (Request Signature method) requires the
key directory RESPONSE to carry its own signature so nobody can mirror the
directory and register on your behalf (RFC 9421 directory draft §5.2).

Add:
- rfc9421.sign_directory / verify_directory: signature over ("@authority";req)
  with tag="http-message-signatures-directory", alg="ed25519", label binding0.
  Body-independent, so it can be pre-signed OFFLINE with a long expiry and served
  as static headers, keeping the private key off the directory host.
- `wingfoot directory --sign`: emit the Signature-Input / Signature headers to host.
- doctor: new check that the served directory carries a valid signature.

Verified byte-exact against Cloudflare's live reference directory: a regression
test in test_directory_signing.py checks wingfoot verifies Cloudflare's own
signed directory with their published key.
…packets

No verifier (Cloudflare, DataDome, ...) offers automated registration yet;
each runs its own human-reviewed web form. `wingfoot register` shrinks that
step to copy/paste: it preflights the hosted directory the way a reviewer
would (reachable, publishes the key, response signed), then prints every
answer the forms ask for, per provider. Supports --email, --user-agent,
--open (launch the form), --no-check, and an optional provider filter.

doctor now points at `wingfoot register` when a valid signature is still
rejected because the target hasn't allow-listed the key.
Build sdist+wheel, then upload via OIDC — no API tokens stored in the
repo. Requires the one-time pending-publisher setup on pypi.org
(project wingfoot, workflow publish.yml, environment pypi).
@AmirF194
AmirF194 merged commit 4d36cd5 into main Jul 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant