Documentation
¶
Overview ¶
Package peername validates peer identities. A peer id has to work as a DNS label, because the hub's proxy can route to a peer by hostname (<peer>.<proxy-domain>): a name that cannot be a label is a peer that some deployments simply cannot reach. Enforcing it at mint time (and at attach) keeps every name routable by every strategy, whatever the hub is configured with today.
Index ¶
Constants ¶
const MaxLen = 63
MaxLen is the DNS label limit (RFC 1123).
const Rules = "lowercase letters, digits and dashes, starting and ending with a letter or digit, at most 63 characters"
Rules is the human-readable constraint, reused in errors and help text so the CLI, the API, and the console all say the same thing.
Variables ¶
This section is empty.
Functions ¶
func Random ¶
Random returns a name like "cosy-eddy-aec23e". It is always a valid peer name, and unique in practice without consulting the hub.
func Validate ¶
Validate reports whether name is usable as a peer id, which means usable as a DNS label: 1..63 characters of [a-z0-9-], starting and ending alphanumeric. Uppercase is rejected rather than folded, because hostnames are case-insensitive while peer ids are not: a peer enrolled as "Alice" could never be reached at alice.<domain>.
Types ¶
This section is empty.