mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
refactor: export function to save JSON secrets
This commit is contained in:
parent
01a88beb97
commit
6c5fc993b0
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ func (l *LocalSecretStore) StoreSecretByID(secretID, secret string) error {
|
|||
|
||||
l.mu.Lock()
|
||||
l.Secrets[secretID] = encryptedSecret
|
||||
err = saveSecrets(l.filename, l.Secrets)
|
||||
err = SaveSecrets(l.filename, l.Secrets)
|
||||
l.mu.Unlock()
|
||||
return err
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ func OpenStore(filename string) (SecretStore, error) {
|
|||
}
|
||||
|
||||
// Saves secrets back to the JSON file
|
||||
func saveSecrets(jsonFile string, store map[string]string) error {
|
||||
func SaveSecrets(jsonFile string, store map[string]string) error {
|
||||
file, err := os.OpenFile(jsonFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue