Documentation
¶
Overview ¶
Package links builds and parses Hemmelig secret links.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidLink = errors.New("not a Hemmelig link or secret ID")
ErrInvalidLink means that the value is not a Hemmelig link or ID.
Functions ¶
func NormalizeBaseURL ¶
NormalizeBaseURL removes a trailing slash and checks the scheme.
func SecretLink ¶
SecretLink returns the short link /s/<id>#<key>. Without a key, the link has no fragment, which is the form for password-protected secrets.
Types ¶
type Secret ¶
type Secret struct {
// BaseURL is the scheme and host of the link, or empty for a bare ID.
BaseURL string
ID string
// Key is empty for password-protected secrets and for bare IDs.
Key string
}
Secret is a parsed secret link.
func ParseSecret ¶
ParseSecret accepts these forms:
https://host/s/<id>#<key> https://host/@<org>/s/<id>#<key> (an organization link) https://host/secret/<id>#decryptionKey=<key> https://host/s/<id> or https://host/secret/<id> (no key) <id>