Skip to main content

Module uri

Module uri 

Source
Expand description

CMN URI parsing and URL policy utilities.

The cmn:// scheme follows the generic URI syntax defined in RFC 3986:

cmn://domain
cmn://domain/hash
cmn://domain/mycelium/hash
cmn://domain/taste/hash

Four forms:

  • cmn://example.com — domain root
  • cmn://example.com/b3.3yMR7vZQ9hL... — content-addressed spore
  • cmn://example.com/mycelium/b3.7tRk... — content-addressed mycelium
  • cmn://example.com/taste/b3.7tRk... — content-addressed taste report

Structs§

CmnUri
Parsed CMN URI

Enums§

CmnUriKind
The kind of entity a CMN URI identifies.

Functions§

build_domain_uri
Build a domain root URI
build_mycelium_uri
Build a mycelium URI
build_spore_uri
Build a spore URI
build_taste_uri
Build a taste report URI
cmn_entry_url
Build the well-known cmn.json entry URL for a domain
is_public_ip
Check whether an IP address is routable on the public internet.
normalize_and_validate_url
Normalize and validate an HTTP(S) URL against SSRF and scheme injection.
normalize_taste_target_uri
Normalize and validate a taste target URI.
parse_uri
Parse a CMN URI into its components
validate_domain
Validate a domain name per CMN spec (RFC 1123, lowercase only).