process keys of any file extension -- not just .gpg

This commit is contained in:
2022-10-26 05:13:52 -07:00
parent 99185164fb
commit 85bdb08379
2 changed files with 1 additions and 14 deletions

View File

@@ -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(

View File

@@ -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",