Replace shared bearer token with registered Ed25519 client keys.
This commit is contained in:
@@ -16,7 +16,7 @@ Firefox will not let an outside process talk to Places. Editing `places.sqlite`
|
||||
|-------|------|
|
||||
| `extension/` | WebExtension (`bookmarks` + `nativeMessaging`) |
|
||||
| `host/` | Native host: stdio to Firefox, HTTP to scripts |
|
||||
| `tools/client.py` | Stdlib Python caller |
|
||||
| `tools/client.py` | Signed Python caller (`FAB_KEY_FILE`) |
|
||||
| `examples/replace_named_folder.py` | Sample "replace this folder" script |
|
||||
|
||||
## Install (this workstation)
|
||||
@@ -27,9 +27,16 @@ Firefox will not let an outside process talk to Places. Editing `places.sqlite`
|
||||
powershell -NoProfile -File tools\install-native-host.ps1
|
||||
```
|
||||
|
||||
That writes `%LOCALAPPDATA%\firefox-agent-bridge\token` and
|
||||
That registers
|
||||
`HKCU\Software\Mozilla\NativeMessagingHosts\com.easygoingaming.firefox_agent_bridge`.
|
||||
|
||||
Then create a client key **outside** that state directory and give the file to tooling:
|
||||
|
||||
```powershell
|
||||
python tools\register_client.py add --name cursor-agent --write-key $HOME\.fab\cursor-agent.json
|
||||
$env:FAB_KEY_FILE = "$HOME\.fab\cursor-agent.json"
|
||||
```
|
||||
|
||||
2. Load the extension. Firefox Release will not keep an unsigned add-on across restarts:
|
||||
|
||||
- `about:debugging#/runtime/this-firefox`
|
||||
@@ -43,8 +50,8 @@ Firefox will not let an outside process talk to Places. Editing `places.sqlite`
|
||||
## Call it
|
||||
|
||||
```powershell
|
||||
$token = Get-Content $env:LOCALAPPDATA\firefox-agent-bridge\token -Raw
|
||||
curl.exe -s -H "Authorization: Bearer $token" http://127.0.0.1:17634/v1/methods
|
||||
$env:FAB_KEY_FILE = "$HOME\.fab\cursor-agent.json"
|
||||
python tools/client.py meta.methods
|
||||
python tools/client.py bookmarks.search "[{\"title\":\"10.132.x.x\"}]"
|
||||
```
|
||||
|
||||
@@ -53,9 +60,9 @@ See [AGENTS.md](AGENTS.md) for the method list, HTTP surface, and failure modes.
|
||||
## Security
|
||||
|
||||
- Binds **127.0.0.1 only**. Browser `Origin` headers are rejected; `Host` must be loopback.
|
||||
- Every mutating call (and most reads) needs `Authorization: Bearer <token>`.
|
||||
- Calls (except `/health`) must be signed by a **registered Ed25519 client**. The host keeps public keys only.
|
||||
- Only the methods in `extension/background.js` `ALLOWED` run. No history, cookies, tabs, or `onMessageExternal` in v0.1.
|
||||
- Another add-on with `bookmarks` already has Places; this bridge does not give it a new path in. Same-user processes that steal the token do — that is the agent contract.
|
||||
- Another add-on with `bookmarks` already has Places; this bridge does not give it a new path in.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user