Extracted from #20 (comment)
Needs
For inbrowser.link
The goal is to provide a subdomain gateway for loading websites in web browser.
Lack of isolation is a security bug. Subdomain mode MUST be enforced.
For General Availability
Good security is like water, if things are right, fishes should not even notice it.
For end users:
- We need to protect end user from subdomain misconfigurations, and at least warn them when SW gateway is deployed without proper origin isolation.
- SW code must be smart enough to do the right thing when deployed on third-party domains, without additional configuration.
- No shortcuts, no hardcoding "subdomain hostnames". This has to be automated, and work with any third-party domain.
For gateway Operators:
- Setup complexity should be limited to getting wildcard TLS certs.
- Operators should know what to do/fix by just opening website via SW gateway and reading the same error as end user.
Initial design
- Before SW is handling responses, run smoke-tests for origin isolation setup
- IF subdomain setup is not available
- Instead of loading screen, produce a loud warning to the user
- UI should be similar to TLS or other security errors in browsers or disclaimers at public-gateway-checker or addressing docs,
- Inform user that web features such as _redirects and Origin isolation will be missing
- User can continue with web browsing via path gateway, but they need to explicitly click "i accept the risk" button. Path gateway should always p
- detects when we are on example.com/ipfs or /ipns path while subdomains for subdomain gateway are present (
*.ipfs.example.com works)
- returns HTTP 301 subdomain redirect (example.com/ipfs/cid → cid.ipfs.example.com) to enforce origin isolation.
window.location.replace may be even better as it removes path URL from browser history.
Tasks
Before ETH Denver:
For general availability:
Needs
For
inbrowser.linkThe goal is to provide a subdomain gateway for loading websites in web browser.
Lack of isolation is a security bug. Subdomain mode MUST be enforced.
For General Availability
Good security is like water, if things are right, fishes should not even notice it.
For end users:
For gateway Operators:
Initial design
*.ipfs.example.comworks)fetchAPI, as noted in feat: add explicit support for subdomain gateways helia#439 (review)window.location.replacemay be even better as it removes path URL from browser history.Tasks
Before ETH Denver:
inbrowser.link. we have subdomain setup, so we should detect being on path, confirm subdomain works, convert to subdomain, and redirect to that.For general availability:
example.com/ip[nf]sand either redirect to working subdomain at*.ip[nf]s.example.comor produce error page which requires user to accept the risk before they to continue browsing in path gateway modeisSubdomainIsolationSupported(should be executed only once)