GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow.
This commit is contained in:
parent
63379001e3
commit
c920c53243
|
@ -53,8 +53,8 @@ the user for a password.
|
|||
|
||||
## Keychain
|
||||
You need to have a keychain in order to run the ProtonMail Bridge. On Mac or
|
||||
Windows, Bridge uses native credential managers. On Linux, use
|
||||
[Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/)
|
||||
Windows, Bridge uses native credential managers. On Linux, use `secret-service` freedesktop.org API
|
||||
(e.g. [Gnome keyring](https://wiki.gnome.org/Projects/GnomeKeyring/))
|
||||
or
|
||||
[pass](https://www.passwordstore.org/).
|
||||
|
||||
|
|
|
@ -101,10 +101,10 @@ func (f *frontendCLI) notifyNeedUpgrade() {
|
|||
f.Println("Please download and install the newest version of application from", version.LandingPage)
|
||||
}
|
||||
|
||||
func (f *frontendCLI) notifyCredentialsError() { // nolint[unused]
|
||||
func (f *frontendCLI) notifyCredentialsError() {
|
||||
// Print in 80-column width.
|
||||
f.Println("ProtonMail Bridge is not able to detect a supported password manager")
|
||||
f.Println("(pass, gnome-keyring). Please install and set up a supported password manager")
|
||||
f.Println("(secret-service or pass). Please install and set up a supported password manager")
|
||||
f.Println("and restart the application.")
|
||||
}
|
||||
|
||||
|
|
|
@ -870,7 +870,7 @@ QtObject {
|
|||
|
||||
property Notification noKeychain: Notification {
|
||||
title: qsTr("No keychain available")
|
||||
description: qsTr("Bridge is not able to detected a supported password manager (pass, gnome-keyring). Please install and setup supported password manager and restart the application.")
|
||||
description: qsTr("Bridge is not able to detected a supported password manager (pass or secret-service). Please install and setup supported password manager and restart the application.")
|
||||
brief: title
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
type: Notification.NotificationType.Danger
|
||||
|
|
|
@ -28,27 +28,25 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
Pass = "pass-app"
|
||||
GnomeKeyring = "gnome-keyring"
|
||||
Pass = "pass-app"
|
||||
SecretService = "secret-service"
|
||||
)
|
||||
|
||||
func init() { // nolint[noinit]
|
||||
Helpers = make(map[string]helperConstructor)
|
||||
|
||||
Helpers[SecretService] = newSecretServiceHelper
|
||||
|
||||
if _, err := exec.LookPath("pass"); err == nil {
|
||||
Helpers[Pass] = newPassHelper
|
||||
}
|
||||
|
||||
if _, err := exec.LookPath("gnome-keyring"); err == nil {
|
||||
Helpers[GnomeKeyring] = newGnomeKeyringHelper
|
||||
}
|
||||
|
||||
// If Pass is available, use it by default.
|
||||
// Otherwise, if GnomeKeyring is available, use it by default.
|
||||
// Otherwise, if SecretService is available, use it by default.
|
||||
if _, ok := Helpers[Pass]; ok && isUsable(newPassHelper("")) {
|
||||
defaultHelper = Pass
|
||||
} else if _, ok := Helpers[GnomeKeyring]; ok && isUsable(newGnomeKeyringHelper("")) {
|
||||
defaultHelper = GnomeKeyring
|
||||
} else if isUsable(newSecretServiceHelper("")) {
|
||||
defaultHelper = SecretService
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +54,7 @@ func newPassHelper(string) (credentials.Helper, error) {
|
|||
return &pass.Pass{}, nil
|
||||
}
|
||||
|
||||
func newGnomeKeyringHelper(string) (credentials.Helper, error) {
|
||||
func newSecretServiceHelper(string) (credentials.Helper, error) {
|
||||
return &secretservice.Secretservice{}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue