Extension pairing / code exchange for browser-watcher origins
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend-api-design, security
Research direction
The issue describes a pairing flow for browser extensions. Start by reading the existing CORS handling in aw-server-rust and the api_key fairing in aw-server/src/endpoints/apikey.rs. Also examine the Python server's aw_server/server.py for the same wildcard. Understand the aw-watcher-web extension's communication endpoints. Implementing this requires coordinated changes across repos, so first get familiar with the authentication flow and the existing code structure.
Written by the indexing model from the issue text.
Description
Follow-up to #637, which narrows the blanket moz-extension://.* CORS trust to the three endpoints aw-watcher-web needs. That closes the read/exfiltration half of the problem with no client change, but the underlying design issue remains: any installed Firefox extension can still write into its own bucket, because extension origins are random per install and cannot be allowlisted up front.
Background and the negative result that makes this necessary are in #637 — briefly: deleting the wildcard does not work, because host permissions do not exempt a Firefox background script from CORS (verified in Firefox 152; the server's ACAO header is the sole gate). So consent has to be captured at runtime instead.
Proposed design
- Extension
POSTs its origin to/api/0/pair/request(reachable under the wildcard). - Server mints a short code and surfaces a pending-pairing prompt in aw-webui (same-origin, trusted) and/or the tray.
- User approves. Server persists
{origin, token}. - Extension polls
/api/0/pair/status, receives the token, and sendsAuthorization: Bearer <token>from then on. The server reflects ACAO for that origin only once paired, and enforces the token.
Reuses the existing api_key fairing (aw-server/src/endpoints/apikey.rs, #585) rather than adding a second auth path. Ship behind [auth] require_extension_pairing, default false for one release with a loud warning, then flip.
Needs matching aw-watcher-web work, so it is a coordinated change across repos rather than a server-only fix.
Also outstanding
aw-server(Python) has the same wildcard (aw_server/server.py,cors_origins.append("moz-extension://*")) and needs the endpoint scoping from #637, and later the pairing flow.
Credit
Original report by pal0x, privately to @ErikBjare, disclosed publicly with @ErikBjare's approval.
Related: #585 (api_key support), #588 / #636 (api_key bypasses), ActivityWatch/activitywatch#1199 (authentication generally).
- Dominant language
- Rust
- Stars
- 322
- Forks
- 105
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ActivityWatch/aw-server-rust
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ActivityWatch/aw-server-rust#798 · 1 comment ·
Maintainers usually reply within 1 day
-
Allow configuring sync dir in the `aw-sync/config.toml` filePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
ActivityWatch/aw-server-rust#853 · 1 comment ·
Maintainers usually reply within 1 day
-
Correctness bugs: heartbeat cache, query cache invalidation, commit rollback statePossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ActivityWatch/aw-server-rust#825 · 2 comments ·
Maintainers usually reply within 1 day
-
aw-sync: rowid upgrade bootstrap does not recover backfills lost under the old timestamp cursorOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
ActivityWatch/aw-server-rust#793 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
ActivityWatch/aw-server-rust#790 ·
Maintainers usually reply within 1 day
All issues in ActivityWatch/aw-server-rust
Similar issues
-
CI/CD ignore-for-release
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
eclipse-ankaios/ankaios#844 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
symposium-dev/symposium#530 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day