Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
29
plugins/secretstores/os/os_darwin.go
Normal file
29
plugins/secretstores/os/os_darwin.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
//go:build darwin
|
||||
|
||||
package os
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/99designs/keyring"
|
||||
)
|
||||
|
||||
func (o *OS) createKeyringConfig() (keyring.Config, error) {
|
||||
// Create the prompt-function in case we need it
|
||||
promptFunc := keyring.TerminalPrompt
|
||||
if !o.Password.Empty() {
|
||||
passwd, err := o.Password.Get()
|
||||
if err != nil {
|
||||
return keyring.Config{}, fmt.Errorf("getting password failed: %w", err)
|
||||
}
|
||||
promptFunc = keyring.FixedStringPrompt(passwd.String())
|
||||
passwd.Destroy()
|
||||
}
|
||||
|
||||
return keyring.Config{
|
||||
ServiceName: o.Collection,
|
||||
AllowedBackends: []keyring.BackendType{keyring.KeychainBackend},
|
||||
KeychainName: o.Keyring,
|
||||
KeychainPasswordFunc: promptFunc,
|
||||
}, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue