Skip to content

feat(server): gate external navigation on a per-host remote grant - #434

Merged
filvecchiato merged 7 commits into
mainfrom
feat/gate-external-navigation
Aug 19, 2026
Merged

feat(server): gate external navigation on a per-host remote grant#434
filvecchiato merged 7 commits into
mainfrom
feat/gate-external-navigation

Conversation

@filvecchiato

@filvecchiato filvecchiato commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

An http(s) navigate_to needs RemotePermission::Remote { domains: [host] } and returns HostNavigateToError::PermissionDenied without it.

  • Grants persist per domain pattern; a multi-domain denial persists against that set only, so the narrower per-host question stays askable.
  • Matching lives in the core (remote_domain_candidates): exact host, single-level parent wildcard, *; most specific stored decision wins. One normalization rule (normalize_remote_domain, IDNA ASCII) keys both ends of the lookup.
  • dotNS, localhost and the handoff schemes (mailto:, tel:, polkadot:, dot:) consume no grant.

No wire change. iOS generateDomainCandidates walks every parent and needs a follow-up.

@filvecchiato
filvecchiato requested review from a team and TarikGul August 18, 2026 07:29
Remote grants persist per domain pattern so a bundle grant is visible to the single-host lookup enforcement makes.
@filvecchiato
filvecchiato force-pushed the feat/gate-external-navigation branch from 362003f to 4382538 Compare August 18, 2026 10:47

@Imod7 Imod7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In rust/crates/truapi/src/api/system.rs, the navigate_to doc still says only "Request the host to open a URL.", and that text reaches product authors through codegen. It would be good to say there that an external http or https URL now needs a RemotePermission::Remote grant for the target host, and to widen HostNavigateToError::PermissionDenied in rust/crates/truapi/src/v01/system.rs, which says "User denied the navigation prompt" but is now one of three ways to get it. RFC 0002's implicit-trigger table should also gain host_navigate_to, and note that editing the doc comment means rerunning codegen.

Comment thread rust/crates/truapi-server/src/runtime.rs Outdated
Comment thread rust/crates/truapi-server/src/runtime.rs Outdated
Comment thread rust/crates/truapi-server/src/host_logic/permissions.rs Outdated
Comment thread rust/crates/truapi-platform/src/lib.rs Outdated
Comment thread rust/crates/truapi-platform/src/lib.rs Outdated
@filvecchiato
filvecchiato requested a review from a team August 18, 2026 17:57
@filvecchiato

Copy link
Copy Markdown
Collaborator Author

Docs from the review body, all in 7be515e9:

  • System::navigate_to says an external http/https URL needs a RemotePermission::Remote grant for the target host, and which destinations consume none.
  • HostNavigateToError::PermissionDenied now covers all three routes (user said no, stored refusal, no prompt possible); its Display string went with it.
  • RFC 0002: host_navigate_to in the implicit-trigger table, one-grant-covers-both in the domain-matching section, open question 3 settled.
  • ./scripts/codegen.sh rerun; the generated TS is gitignored so there is nothing to commit. cargo +nightly fmt, clippy --all-targets --all-features -D warnings and cargo test --workspace are clean.

@filvecchiato
filvecchiato merged commit df6c283 into main Aug 19, 2026
18 checks passed
@filvecchiato
filvecchiato deleted the feat/gate-external-navigation branch August 19, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants