-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
help wantedkind/questionA question or request for supportA question or request for supportstatus/in-progressIn progressIn progresstopic/originIssues related to Origin-based securityIssues related to Origin-based securityux
Description
Motivation
- At some point in the future we may have native protocol handler (libdweb+[PoC] libdweb experiment: protocol handler API ipfs-companion#533 or similar), but for now the URL in address bar remains
fuglyless than pretty - The latest Companion extension supports DNSLink-based redirects from URLs like
http://docs.ipfs.ioto a local go-ipfs gateway athttp://127.0.0.1:8080/ipns/docs.ipfs.io/ - Our public gateways start to support cidv1b32 in Subdomains (CID as a Subdomain #89), which restores Origin-based isolation between websites. This also means we don't want to redirect such URLs to local gateway as it would remove this isolation.
Requirements
I wonder if there is a way of generating vanity hostnames pointing at localhost that:
- does not require lookups to an external DNS server
- keeps HTML content in secure context
- works out-of-the box on windows, mac and linux
- alternatively we can add heuristics to pick method based on user's platform
- lets us introduce subdomain-driven Origin isolation for locally running gateway
- (nice to have, but we can work around this for embedds) does not trigger mixed-content warnings when IPFS resource from localhost is embedded on HTTPS website
- it is what happens when
/ipfs/{cid}is redirected from public gateway running on https to a custom one running on http this may be the blocker: AFAIK only127.0.0.1and::1are whitelisted by browser vendors (eg. firefox #903966) butlocalhostis not (that is why Companion uses raw IP)- as of 2019-10
localhostis a secure context in both Firefox and Chrome. Firefox does not support subdomains (foo.bar.localhostis not a secure context)
- it is what happens when
If anyone has unconventional ideas, feel free to comment.
Candidates
*.localhost
Current status
🔒 – window.isSecureContext === true
💢 – window.isSecureContext === false
| Status | Firefox | Chrome |
|---|---|---|
127.0.0.1 |
🔒 | 🔒 |
localhost |
🔒 | 🔒 |
foo.bar.localhost |
💢 | 🔒 |
References
- https://w3c.github.io/webappsec-secure-contexts/#localhost:
Section 6.3 of [RFC6761] lays out the resolution of localhost. and names falling within .localhost. as special, and suggests that local resolvers SHOULD/MAY treat them specially. For better or worse, resolvers often ignore these suggestions, and will send localhost to the network for resolution in a number of circumstances.
- Let 'localhost' be localhost
- bugzilla:
- chromium
- go-ipfs
agentofuser
Metadata
Metadata
Assignees
Labels
help wantedkind/questionA question or request for supportA question or request for supportstatus/in-progressIn progressIn progresstopic/originIssues related to Origin-based securityIssues related to Origin-based securityux