Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Prefix is the string prefix for all enrollment tokens. Prefix = "mren_" // SecretBytes is the number of random bytes in an enrollment secret. SecretBytes = 32 )
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode parses an enrollment token and returns the coordinator address and secret it contains.
func Encode ¶
Encode produces an enrollment token string from a coordinator address and secret. The token has the form mren_<base64url(json)>.
func GenerateSecret ¶
GenerateSecret produces a cryptographically random hex-encoded secret suitable for use in an enrollment token.
func Hash ¶
Hash returns the SHA-256 hash of a secret, using the same scheme as invite code hashing for consistency.
func IsHexSecret ¶
IsHexSecret reports whether s is a valid hex-encoded enrollment secret (64 lowercase hex characters = 32 bytes).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.