Skip to content

fix: keep the registered identity stable and stop init destroying keys - #8

Merged
AmirF194 merged 2 commits into
mainfrom
fix/identity-safety
Jul 23, 2026
Merged

fix: keep the registered identity stable and stop init destroying keys#8
AmirF194 merged 2 commits into
mainfrom
fix/identity-safety

Conversation

@AmirF194

Copy link
Copy Markdown
Owner

Verifier registration records a keyid and a User-Agent that a human reviews. Anything that changes either one silently invalidates a registration that took days to obtain. Three ways that could happen, found while preparing an actual registration:

1. wingfoot init destroyed an existing identity, silently

No check, no prompt — it generated a fresh keypair and overwrote private_key.pem. It reads like a command that is safe to re-run. The day after a verifier approves you, re-running it throws away the registration.

Now refuses unless --force, and the error names the consequence and points at the non-destructive alternative.

2. register --user-agent declared a UA that was never sent

The flag only changed the printed form; outbound requests still carried the default. Anyone declaring a custom UA registered a bot that never appears in the verifier's logs. The same gap affected requests_auth() / httpx_auth(), which let the client send its own python-requests/2.x.

The identity now records the UA and signed_headers() applies it — one chokepoint, so every client path sends what register declares.

3. The default User-Agent embedded the release version

wingfoot/0.1.2 (+...) stopped matching the registered string on the next patch release. Now unversioned; the repo URL is the identifying part. A test fails if a version ever reappears in it.

New: wingfoot identity

Shows the identity, and --agent / --user-agent change those fields in place without touching the key — the only safe way to correct them once a key is registered. No such path existed before.

Compatibility

Identities stored before the UA field remain loadable and are not given one implicitly, so existing setups keep their current behaviour and their keyid.

Verification

58 tests pass (5 new). Verified against a real registered identity: init refused and left the key intact, identity --user-agent updated the config with the keyid unchanged, and demo / doctor still behave as before.

AmirF194 added 2 commits July 22, 2026 17:35
Verifier registration records a keyid and a User-Agent that a human reviews,
so anything that changes either one silently invalidates a registration that
took days to obtain. Three ways that could happen:

- `wingfoot init` overwrote an existing identity with no check or prompt. It
  reads like a safe command to re-run, but it generates a new key and so a new
  keyid. Now refuses unless --force, and points at the non-destructive path.

- `register --user-agent` only affected the printed form; outbound requests
  still carried the default. A custom UA therefore registered a bot that never
  appears in the verifier's logs. The identity now records the UA and
  signed_headers applies it, so requests/httpx/manual clients all send what
  register declares.

- The default User-Agent embedded the release version, so shipping a patch
  stopped it matching the registered string. It is now unversioned; the repo
  URL is what identifies us.

Adds `wingfoot identity` to show the identity and change its agent URL or
User-Agent in place, which is the only safe way to correct those fields once a
key is registered. Identities stored before the UA field remain loadable and
are not given one implicitly.
These are internal marketing notes — a prepared Show HN comment, channel
strategy, and registration packets containing a contact email. They were never
meant to ship in a public repo. Kept on disk, ignored from here on.
@AmirF194
AmirF194 merged commit 5b1cd10 into main Jul 23, 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