Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples to ADDRESSING.md #148

Merged
merged 2 commits into from
Jun 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion ADDRESSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,28 @@

### Addressing with HTTP

#### Paths

When site isolation does not matter gateway can expose IPFS namespaces as regular URL paths:

https://<gateway-host>.tld/ipfs/<cid>/path/to/resource
https://<gateway-host>.tld/ipns/<keyid_or_fqdn>/path/to/resource

Examples:

https://gateway.ipfs.io/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html
https://gateway.ipfs.io/ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX/wiki/Mars.html
https://gateway.ipfs.io/ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html

#### Subdomains

When origin-based security perimeter is needed, [CIDv1](https://github.com/ipld/cid#cidv1) in Base32 ([RFC4648](https://tools.ietf.org/html/rfc4648#section-6), no padding) should be used in subdomain:
When [origin-based security](https://en.wikipedia.org/wiki/Same-origin_policy) perimeter is needed, [CIDv1](https://github.com/ipld/cid#cidv1) in Base32 ([RFC4648](https://tools.ietf.org/html/rfc4648#section-6), no padding) should be used in subdomain:

https://<cidv1-base32>.ipfs.<gateway-host>.tld/path/to/resource

Example:

https://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq.ipfs.dweb.link/wiki/

Read more: [notes on addressing with HTTP](#notes-on-addressing-with-http).

Expand All @@ -37,6 +50,10 @@ Read more: [notes on addressing with HTTP](#notes-on-addressing-with-http).
In future, subdomain convention will be replaced with native handler that provides the same origin-based guarantees:

ipfs://{cidv1b32}/path/to/resource

Example:

ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html

Read more: [notes on addressing with ipfs://](#notes-on-addressing-with-ipfs).

Expand All @@ -47,6 +64,11 @@ We argue that paths are the better canonical address and that all kinds of thing

dweb:/ipfs/{cidv1b32}/path/to/resource

Example:

dweb://ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html
dweb://ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html

Read more: [notes on addressing with dweb:](#notes-on-addressing-with-dweb).

## References
Expand Down