Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(secret data.SecretStored) (string, error)
Parse takes a data.SecretStored type as input and returns the parsed string or an error.
If the Meta.Template field is empty, it tries to parse secret.Value; otherwise it transforms secret.Value using the Go template transformation defined by Meta.Template.
If the Meta.Format field is None, it returns the parsed string.
If the Meta.Format field is Json, it returns the parsed string if it’s a valid JSON or the original string otherwise.
If the Meta.Format field is Yaml, it tries its best to transform the data into Yaml. If it fails, it tries to return a valid JSON at least. If that fails too, returns the original secret value.
If the Meta.Format field is not recognized, it returns an empty string.
func ParseForK8sSecret ¶
func ParseForK8sSecret(secret data.SecretStored) (map[string]string, error)
ParseForK8sSecret parses the provided `SecretStored` and applies a template if one is defined.
Args:
secret: A SecretStored struct containing the secret data and metadata.
Returns:
A map of string keys to string values, containing the parsed secret data. If there is an error during parsing or applying the template, an error will be returned.
Types ¶
This section is empty.