process keys of any file extension -- not just .gpg
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/browserpass/browserpass-native/errors"
|
||||
"github.com/browserpass/browserpass-native/response"
|
||||
@@ -16,18 +15,6 @@ import (
|
||||
func fetchDecryptedContents(request *request) {
|
||||
responseData := response.MakeFetchResponse()
|
||||
|
||||
if !strings.HasSuffix(request.File, ".gpg") {
|
||||
log.Errorf("The requested password file '%v' does not have the expected '.gpg' extension", request.File)
|
||||
response.SendErrorAndExit(
|
||||
errors.CodeInvalidPasswordFileExtension,
|
||||
&map[errors.Field]string{
|
||||
errors.FieldMessage: "The requested password file does not have the expected '.gpg' extension",
|
||||
errors.FieldAction: "fetch",
|
||||
errors.FieldFile: request.File,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
store, ok := request.Settings.Stores[request.StoreID]
|
||||
if !ok {
|
||||
log.Errorf(
|
||||
|
@@ -36,7 +36,7 @@ func listFiles(request *request) {
|
||||
|
||||
store.Path = normalizedStorePath
|
||||
|
||||
files, err := zglob.GlobFollowSymlinks(filepath.Join(store.Path, "/**/*.gpg"))
|
||||
files, err := zglob.GlobFollowSymlinks(filepath.Join(store.Path, "/**/*"))
|
||||
if err != nil {
|
||||
log.Errorf(
|
||||
"Unable to list the files in the password store '%+v' at its location: %+v",
|
||||
|
Reference in New Issue
Block a user