From 0ada39be786bd83f775f76ff05fc64eb9f69de30 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 26 Oct 2022 05:13:52 -0700 Subject: [PATCH] process keys of any file extension -- not just `.gpg` --- request/fetch.go | 13 ------------- request/list.go | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/request/fetch.go b/request/fetch.go index 134a3c8..fd8b797 100644 --- a/request/fetch.go +++ b/request/fetch.go @@ -2,7 +2,6 @@ package request import ( "path/filepath" - "strings" "github.com/browserpass/browserpass-native/errors" "github.com/browserpass/browserpass-native/helpers" @@ -13,18 +12,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( diff --git a/request/list.go b/request/list.go index 058109d..2412d41 100644 --- a/request/list.go +++ b/request/list.go @@ -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",