mirror of
https://github.com/quexten/goldwarden.git
synced 2024-11-27 11:02:46 +03:00
Fix: Use pinentry-mac as pinentry binary on macOS for approvals
This commit is contained in:
parent
1317e1e037
commit
ff1ae8316e
@ -9,11 +9,16 @@ import (
|
||||
"github.com/twpayne/go-pinentry"
|
||||
)
|
||||
|
||||
func getPassword(title string, description string) (string, error) {
|
||||
func getBinaryClientOption() (clientOption pinentry.ClientOption) {
|
||||
binaryClientOption := pinentry.WithBinaryNameFromGnuPGAgentConf()
|
||||
if runtime.GOOS == "darwin" {
|
||||
binaryClientOption = pinentry.WithBinaryName("pinentry-mac")
|
||||
}
|
||||
return binaryClientOption
|
||||
}
|
||||
|
||||
func getPassword(title string, description string) (string, error) {
|
||||
binaryClientOption := getBinaryClientOption()
|
||||
|
||||
client, err := pinentry.NewClient(
|
||||
binaryClientOption,
|
||||
@ -49,8 +54,10 @@ func getApproval(title string, description string) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
binaryClientOption := getBinaryClientOption()
|
||||
|
||||
client, err := pinentry.NewClient(
|
||||
pinentry.WithBinaryNameFromGnuPGAgentConf(),
|
||||
binaryClientOption,
|
||||
pinentry.WithGPGTTY(),
|
||||
pinentry.WithTitle(title),
|
||||
pinentry.WithDesc(description),
|
||||
|
Loading…
Reference in New Issue
Block a user