Document in-app pairing in AGENTS.md
This commit is contained in:
1 file changed
+25
@@ -159,6 +159,27 @@ data/ desktop, metainfo, gschema, icons, resources (ui/*.blp, sty
|
||||
- Errors are loud: `--headless`/`--pair` print a message and exit non-zero for a
|
||||
bad URI, no keyring, no identity key, or a relay that refused the connect
|
||||
response.
|
||||
- **In-app pairing** (Signer page → "Pair with a client…"): paste the
|
||||
`nostrconnect://` string, then the *same* approval dialog used for responder
|
||||
questions (`ui::approval::present_question`). On allow, the client's relays are
|
||||
added to the running signer and `signer::pair_client` registers + answers. If
|
||||
the signer is stopped, it is started with the client's relays first. The signer
|
||||
has a `Stopped | Starting | Running` state so a second start cannot put two
|
||||
responders on one device key.
|
||||
- `Signer::add_client_relays` mirrors `start`: add with
|
||||
`verify_subscriptions`, **wait until connected**, then subscribe an explicit
|
||||
`(RelayUrl, Vec<Filter>)` target. Subscribing before the connection lands is
|
||||
trap #2 again, and it looks fine because the pairing itself publishes
|
||||
explicitly — only later requests silently never arrive. Requests and responses
|
||||
both use the shared, growable response-target set.
|
||||
- `pair_client` (shared by the GUI and `--pair`) approves **before** publishing:
|
||||
the client validates the secret and usually sends `connect` immediately, which
|
||||
a new client cannot do without the bunker secret.
|
||||
- **Known limitation:** a manual stop/start drops the client's relays
|
||||
(`extra_relays` are per-run). Spec-compliant clients recover via
|
||||
`switch_relays`; others need re-pairing. Persisting per-app relays in
|
||||
`apps.json` is the clean follow-up.
|
||||
- **Still deferred:** D-Bus activation (a `.service` file + `DBusActivatable`).
|
||||
|
||||
## Keys
|
||||
|
||||
@@ -291,6 +312,10 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
|
||||
The audit has its own tests: a content canary never reaches the log,
|
||||
unapproved requests are not logged, names are bounded, and `record` trims an
|
||||
oversized file while keeping it 0600. All run on a plain `cargo test`.
|
||||
- `a_request_on_an_added_relay_is_answered_there` (ignored, needs `nak`) starts
|
||||
the signer on one relay, adds a second, and drives a request/response through
|
||||
the added one — the check that a dynamically added client relay carries both
|
||||
directions. It uses a local second relay even when `REGENT_TEST_RELAY` is set.
|
||||
- End to end (keyring → responder → app), in a throwaway HOME:
|
||||
```sh
|
||||
dbus-run-session -- build-aux/acceptance.sh
|
||||
|
||||
Reference in new issue
Block a user