paritytech / paritytech/host-rust-core
iOS TrUAPI container blocks every cross-origin fetch, even after a Remote domain grant
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 10
- Forks
- 3
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 148
Description
TLDR
A product requests Remote permission for a domain. The host prompts, the user allows, and requestRemotePermission returns granted. The host settings screen shows the domain as allowed. The next fetch to that domain still fails with TypeError: Network access is not allowed.
Cause
The TrUAPI lockdown script js/container/src/index.ts (built into ios/truapi-host as truapi-container.js) allows same-origin fetch only (lines 56-67) and deletes XMLHttpRequest. It never reads the stored Remote grants.
Reproduction
Use 3rd-party-fetch.paseo. It queries a public API endpoint before and after a Remote grant and prints every result.
- Open
3rd-party-fetch.paseoin a testnet iOS build with "TrUAPI Runtime" ON. - Tap "Request permission" and allow the prompt. The log shows
Remotegranted. - Tap "Fetch". The log shows FAILED:
TypeError: Network access is not allowed. - Set "TrUAPI Runtime" OFF, restart, repeat. The fetch returns 200 OK.
Contributor guide
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.
Research direction
Start in js/container/src/index.ts, especially the lockdown logic around lines 56-67, and compare it with the built truapi-container.js in ios/truapi-host. Use 3rd-party-fetch.paseo in a testnet iOS build to reproduce the failure before and after a Remote grant. Done means an allowed domain fetch succeeds while the TrUAPI Runtime remains enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- api, mobile, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100