Documentation
¶
Overview ¶
Package clientconfig writes per-client broker environment files.
Index ¶
- func Path(homeDir string, brokerName string) (string, error)
- func Render(cfg Config) ([]byte, error)
- func SecretFromData(data []byte, client string) (string, error)
- func SecretFromFile(path string, client string) (string, error)
- func SecretsFromData(data []byte) (map[string]string, error)
- func SecretsFromFile(path string) (map[string]string, error)
- func ValidateClientName(value string) error
- func ValidateURL(value string) error
- func Write(cfg Config) (string, error)
- func WriteForHomeOwner(cfg Config) (string, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecretFromData ¶
SecretFromData parses `name = secret` data and returns client's secret.
func SecretFromFile ¶
SecretFromFile reads path and returns the configured secret for client.
func SecretsFromData ¶
SecretsFromData parses `name = secret` data and returns all configured client secrets.
func SecretsFromFile ¶
SecretsFromFile reads path and returns all configured client secrets.
func ValidateClientName ¶
ValidateClientName validates an identifier used as a client secret-file key.
func ValidateURL ¶
ValidateURL validates a broker client URL and rejects embedded credentials.
func WriteForHomeOwner ¶
WriteForHomeOwner writes cfg and, when running as root, makes the generated client config paths owned by the owner of cfg.HomeDir.