Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNewSecretsFile ¶
GenerateNewSecretsFile creates a new file with a checksum
Types ¶
type Secret ¶
type Secret struct {
Name string `json:"name,omitempty"`
Secret []byte `json:"secret,omitempty"`
Access []string `json:"access,omitempty"`
}
Secret name/encrypted bytes/access list to this secret
type SecretsFile ¶
type SecretsFile struct {
// TODO change to camel case for json as this is used in an API now.
Secrets []*Secret `json:"secrets,omitempty"`
Checksum []byte `json:"checksum,omitempty"`
Services []*Service `json:"services,omitempty"`
// contains filtered or unexported fields
}
SecretsFile holder of secrets
func LoadOrCreateSecretsFile ¶
func LoadOrCreateSecretsFile(file string, passphrase string) (*SecretsFile, error)
LoadOrCreateSecretsFile loads secrets from disk and decrypts them returns an error if something goes wrong in the loading process
func (*SecretsFile) HasService ¶
func (s *SecretsFile) HasService(name string) (*Service, bool)
HasService returns true if the service name has access to any secret
func (*SecretsFile) IndexOfSecret ¶
func (s *SecretsFile) IndexOfSecret(name string) int
IndexOfSecret find the indef of a secret in the array that matches name
func (*SecretsFile) Save ¶
func (s *SecretsFile) Save(passphrase string) error
Save save this secrets file to disk, encrypted using the passphrase
Click to show internal directories.
Click to hide internal directories.