oliver-zehentleitner / maity
contract: the request signature covers the hub's origin (a new, versioned signing scheme)
tsk-t03pp2ftd1f3 Open
Today the canonical string of a signed request (docs/api.md §2.2, cli/src/maity/sign.py) binds method, path, query, timestamp, nonce and the body hash, but not the origin of the hub it is meant for. Follow-up of tsk-h1kcv3bd82gg, which fixes a clone's hub on the CLI side; this card is the defence on the hub side.
Proposal for the contract request:
- a new scheme version whose canonical string adds the hub's origin (scheme, normalized host, port), as the hub knows its own public origin;
- the hub accepts the old scheme only for a stated transition, then refuses it; the CLI that signs the new one ships first;
- how proxies and a hub behind a load balancer state their public origin (an existing setting or a new one);
- tests: a request signed for another origin is refused with the same answer as a bad signature.
Contract first (a contract request to lotse as arbiter), then hub and CLI PRs. Security leg on each. Keep the Why entry on the scheme change.