Skip to content

Commit

Permalink
exposed passdir for customers to set dir where pass is stored
Browse files Browse the repository at this point in the history
  • Loading branch information
VigneshSelvaraj96 committed Sep 23, 2024
1 parent b114bb5 commit 20d60a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ type KeyringConfig struct {
KeychainName *string `toml:",omitempty"`
FileDir *string `toml:",omitempty"`
LibSecretCollectionName *string `toml:",omitempty"`
PassDir *string `toml:",omitempty"` // PassDir is the pass password-store directory, ~/ is resolved to the users' home dir
}

type Registry struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/granted/settings/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var SetConfigCommand = cli.Command{
fieldMap["Keyring.KeychainName"] = keyringFields{&cfg.Keyring.KeychainName}
fieldMap["Keyring.FileDir"] = keyringFields{&cfg.Keyring.FileDir}
fieldMap["Keyring.LibSecretCollectionName"] = keyringFields{&cfg.Keyring.LibSecretCollectionName}
fieldMap["Keyring.PassDir"] = keyringFields{&cfg.Keyring.PassDir}

fields := make([]string, 0, len(fieldMap))
for k := range fieldMap {
Expand Down
3 changes: 3 additions & 0 deletions pkg/securestorage/securestorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func (s *SecureStorage) openKeyring() (keyring.Keyring, error) {
if cfg.Keyring.LibSecretCollectionName != nil {
c.LibSecretCollectionName = *cfg.Keyring.LibSecretCollectionName
}
if cfg.Keyring.PassDir != nil {
c.PassDir = *cfg.Keyring.PassDir
}
}

k, err := keyring.Open(c)
Expand Down

0 comments on commit 20d60a8

Please sign in to comment.