mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
chore: added pre-condition guards for secrets
This commit is contained in:
parent
a1276360fe
commit
c3a7ebf975
2 changed files with 8 additions and 1 deletions
|
|
@ -104,6 +104,10 @@ func (l *LocalSecretStore) ListSecrets() (map[string]string, error) {
|
|||
// openStore tries to create or open the LocalSecretStore based on the environment
|
||||
// variable MASTER_KEY. If not found, it prints an error.
|
||||
func OpenStore(filename string) (SecretStore, error) {
|
||||
if filename == "" {
|
||||
return nil, fmt.Errorf("no path to secret store provided")
|
||||
}
|
||||
|
||||
masterKey := os.Getenv("MASTER_KEY")
|
||||
if masterKey == "" {
|
||||
return nil, fmt.Errorf("MASTER_KEY environment variable not set")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue