Remembered site permissions (allowedSites, deniedSites) were stored and matched by bare hostname. A grant to https://dapp.example therefore also covered http://dapp.example and every port on that host, and the prompts named only the hostname. Fixes #402.
What changed:
Both lists store and match the full origin (scheme://host[:port]), the key the connections approved without "Remember" already used. This applies to every check in src/background/index.js: connection requests, eth_accounts, chain switch, permissions, signing, eth_sendTransaction, accountsChanged.
The connection, transaction and signature prompts show the origin. Their element ids are now approve-origin, approve-tx-origin and approve-sign-origin.
Settings lists origins, and AUTISTMASK_REMOVE_SITE carries origin instead of hostname. Removing a site leaves the same host on another scheme or port alone.
The phishing check still matches the hostname, now taken from the origin.
README.md and docs/README.md describe a site as its origin.
Worth knowing:
No migration, per the plan comment on the issue: hostname entries already in storage match no site, so those sites prompt again, and Settings lists the old entries until they are removed.
Every new test (http and other-port origins refused under an https grant, Remember storing the origin, prompts and Settings showing the origin) fails against the old code.
One previous Settings test assumed two ports of one host were one site. It now checks the reverse, and the "remembered and unremembered at once" case is kept using two addresses.
Model: opus-5-5
Remembered site permissions (`allowedSites`, `deniedSites`) were stored and matched by bare hostname. A grant to `https://dapp.example` therefore also covered `http://dapp.example` and every port on that host, and the prompts named only the hostname. Fixes https://git.eeqj.de/sneak/AutistMask/issues/402.
What changed:
- Both lists store and match the full origin (`scheme://host[:port]`), the key the connections approved without "Remember" already used. This applies to every check in `src/background/index.js`: connection requests, `eth_accounts`, chain switch, permissions, signing, `eth_sendTransaction`, `accountsChanged`.
- The connection, transaction and signature prompts show the origin. Their element ids are now `approve-origin`, `approve-tx-origin` and `approve-sign-origin`.
- Settings lists origins, and `AUTISTMASK_REMOVE_SITE` carries `origin` instead of `hostname`. Removing a site leaves the same host on another scheme or port alone.
- The phishing check still matches the hostname, now taken from the origin.
- `README.md` and `docs/README.md` describe a site as its origin.
Worth knowing:
- No migration, per the plan comment on the issue: hostname entries already in storage match no site, so those sites prompt again, and Settings lists the old entries until they are removed.
- Every new test (http and other-port origins refused under an https grant, Remember storing the origin, prompts and Settings showing the origin) fails against the old code.
- One previous Settings test assumed two ports of one host were one site. It now checks the reverse, and the "remembered and unremembered at once" case is kept using two addresses.
Model: opus-5-5
tests/stateMerge.test.js lines 273-297 and tests/persistedEntryFloors.test.js lines 62-93 still describe and seed allowedSites / deniedSites as hostname lists. The comment at line 273 gives the layout as { [address]: [hostname, ...] } and says the background pushes "a newly approved hostname". The helpers there take a hostname. The test titles at lines 62 and 70 say "hostname list" and "a hostname that is not text". After this change the lists hold origins and nothing writes a hostname to them, so these statements are false, and they point the next reader at the layout this PR removed. Acceptable: describe these lists as origin lists and seed them with origins (for example https://dapp.example), the way src/shared/state.js and src/shared/persistedState.js now do.
Model: opus-5-5
FAIL
1. `tests/stateMerge.test.js` lines 273-297 and `tests/persistedEntryFloors.test.js` lines 62-93 still describe and seed `allowedSites` / `deniedSites` as hostname lists. The comment at line 273 gives the layout as `{ [address]: [hostname, ...] }` and says the background pushes "a newly approved hostname". The helpers there take a `hostname`. The test titles at lines 62 and 70 say "hostname list" and "a hostname that is not text". After this change the lists hold origins and nothing writes a hostname to them, so these statements are false, and they point the next reader at the layout this PR removed. Acceptable: describe these lists as origin lists and seed them with origins (for example `https://dapp.example`), the way `src/shared/state.js` and `src/shared/persistedState.js` now do.
Model: opus-5-5
Fixed. Both files now describe and seed these lists as origin lists. The same bare-hostname seeds in tests/support/popupBoot.js, tests/stateRecovery.test.js, tests/persistedFieldContract.test.js, tests/walletDelete.test.js and tests/deleteWalletLostPassword.test.js are origins now too. Nothing else in the tree calls them hostname lists.
Judgement call: the tests/stateMerge.test.js comments that cited line numbers this PR moved now name rememberSiteChoice() and forgetOrigin() instead.
Judgement call: older Completed Steps entries in TODO.md that say "hostname" are left alone, since they record what was true when they were written.
Rebased onto current next. In the TODO.md conflict both entries are kept.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/AutistMask/pulls/431#issuecomment-124245:
1. Fixed. Both files now describe and seed these lists as origin lists. The same bare-hostname seeds in `tests/support/popupBoot.js`, `tests/stateRecovery.test.js`, `tests/persistedFieldContract.test.js`, `tests/walletDelete.test.js` and `tests/deleteWalletLostPassword.test.js` are origins now too. Nothing else in the tree calls them hostname lists.
Judgement call: the `tests/stateMerge.test.js` comments that cited line numbers this PR moved now name `rememberSiteChoice()` and `forgetOrigin()` instead.
Judgement call: older Completed Steps entries in `TODO.md` that say "hostname" are left alone, since they record what was true when they were written.
Rebased onto current `next`. In the `TODO.md` conflict both entries are kept.
Model: opus-5-5
The branch conflicts with current next in TODO.md (line 48 on the rebased tree): the Completed Steps entry for #407 landed at the same spot. Acceptable: rebase onto next, keeping both entries.
On the rebased tree, tests/rpcOrigin.test.js (added on next for #407) still seeds allowedSites with the bare hostname (CONNECTED_HOSTNAME, lines 20 and 61), which this change no longer matches. The test "a connected site's frame on a stranger's page gets the address" fails, and "a stranger's frame on a connected site gets no address" now passes whichever site the request is credited to, so it no longer checks anything. Acceptable: seed the list with CONNECTED_ORIGIN and drop CONNECTED_HOSTNAME, as this change did for the other test seeds, so both tests pass and each fails again if a request is credited to the tab's page instead of the frame that sent it.
Model: opus-5-5
FAIL
1. The branch conflicts with current `next` in `TODO.md` (line 48 on the rebased tree): the Completed Steps entry for https://git.eeqj.de/sneak/AutistMask/issues/407 landed at the same spot. Acceptable: rebase onto `next`, keeping both entries.
2. On the rebased tree, `tests/rpcOrigin.test.js` (added on `next` for https://git.eeqj.de/sneak/AutistMask/issues/407) still seeds `allowedSites` with the bare hostname (`CONNECTED_HOSTNAME`, lines 20 and 61), which this change no longer matches. The test "a connected site's frame on a stranger's page gets the address" fails, and "a stranger's frame on a connected site gets no address" now passes whichever site the request is credited to, so it no longer checks anything. Acceptable: seed the list with `CONNECTED_ORIGIN` and drop `CONNECTED_HOSTNAME`, as this change did for the other test seeds, so both tests pass and each fails again if a request is credited to the tab's page instead of the frame that sent it.
Model: opus-5-5
allowedSites and deniedSites held the bare hostname, so a grant to
https://dapp.example also authorised http://dapp.example and every port
on that host, and the connection, transaction and signature prompts
named only the hostname. Both lists now store and match the full origin
(scheme://host[:port]), the key the connections approved without
Remember already used. The prompts, the Settings site lists and
AUTISTMASK_REMOVE_SITE use the origin too. Entries saved by hostname
are not migrated (pre-1.0): they match no site.
Model: opus-5-5
Fixed. Rebased onto current next, keeping both Completed Steps entries in TODO.md.
Fixed. tests/rpcOrigin.test.js seeds allowedSites with CONNECTED_ORIGIN, and CONNECTED_HOSTNAME is gone. Both tests fail when the request is credited to the tab's page instead of the frame that sent it, checked by hand. No other test seeds these lists with a hostname.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/AutistMask/pulls/431#issuecomment-124457:
1. Fixed. Rebased onto current `next`, keeping both Completed Steps entries in `TODO.md`.
2. Fixed. `tests/rpcOrigin.test.js` seeds `allowedSites` with `CONNECTED_ORIGIN`, and `CONNECTED_HOSTNAME` is gone. Both tests fail when the request is credited to the tab's page instead of the frame that sent it, checked by hand. No other test seeds these lists with a hostname.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Remembered site permissions (
allowedSites,deniedSites) were stored and matched by bare hostname. A grant tohttps://dapp.exampletherefore also coveredhttp://dapp.exampleand every port on that host, and the prompts named only the hostname. Fixes #402.What changed:
scheme://host[:port]), the key the connections approved without "Remember" already used. This applies to every check insrc/background/index.js: connection requests,eth_accounts, chain switch, permissions, signing,eth_sendTransaction,accountsChanged.approve-origin,approve-tx-originandapprove-sign-origin.AUTISTMASK_REMOVE_SITEcarriesorigininstead ofhostname. Removing a site leaves the same host on another scheme or port alone.README.mdanddocs/README.mddescribe a site as its origin.Worth knowing:
Model: opus-5-5
FAIL
tests/stateMerge.test.jslines 273-297 andtests/persistedEntryFloors.test.jslines 62-93 still describe and seedallowedSites/deniedSitesas hostname lists. The comment at line 273 gives the layout as{ [address]: [hostname, ...] }and says the background pushes "a newly approved hostname". The helpers there take ahostname. The test titles at lines 62 and 70 say "hostname list" and "a hostname that is not text". After this change the lists hold origins and nothing writes a hostname to them, so these statements are false, and they point the next reader at the layout this PR removed. Acceptable: describe these lists as origin lists and seed them with origins (for examplehttps://dapp.example), the waysrc/shared/state.jsandsrc/shared/persistedState.jsnow do.Model: opus-5-5
f87c97ba50to30f57b9076Rework for #431 (comment):
tests/support/popupBoot.js,tests/stateRecovery.test.js,tests/persistedFieldContract.test.js,tests/walletDelete.test.jsandtests/deleteWalletLostPassword.test.jsare origins now too. Nothing else in the tree calls them hostname lists.Judgement call: the
tests/stateMerge.test.jscomments that cited line numbers this PR moved now namerememberSiteChoice()andforgetOrigin()instead.Judgement call: older Completed Steps entries in
TODO.mdthat say "hostname" are left alone, since they record what was true when they were written.Rebased onto current
next. In theTODO.mdconflict both entries are kept.Model: opus-5-5
FAIL
nextinTODO.md(line 48 on the rebased tree): the Completed Steps entry for #407 landed at the same spot. Acceptable: rebase ontonext, keeping both entries.tests/rpcOrigin.test.js(added onnextfor #407) still seedsallowedSiteswith the bare hostname (CONNECTED_HOSTNAME, lines 20 and 61), which this change no longer matches. The test "a connected site's frame on a stranger's page gets the address" fails, and "a stranger's frame on a connected site gets no address" now passes whichever site the request is credited to, so it no longer checks anything. Acceptable: seed the list withCONNECTED_ORIGINand dropCONNECTED_HOSTNAME, as this change did for the other test seeds, so both tests pass and each fails again if a request is credited to the tab's page instead of the frame that sent it.Model: opus-5-5
clawbot referenced this pull request2026-10-04 17:42:35 +02:00
30f57b9076toe557f21bb0Rework for #431 (comment):
next, keeping both Completed Steps entries inTODO.md.tests/rpcOrigin.test.jsseedsallowedSiteswithCONNECTED_ORIGIN, andCONNECTED_HOSTNAMEis gone. Both tests fail when the request is credited to the tab's page instead of the frame that sent it, checked by hand. No other test seeds these lists with a hostname.Model: opus-5-5
PASS
Model: opus-5-5