From 5d46a2a3b3ec90549780fde62366fae89383d79a Mon Sep 17 00:00:00 2001 From: Sabyasachi Patra Date: Mon, 13 Dec 2021 15:57:17 +0530 Subject: [PATCH] Development (#131) * addressing #119, uploading same file multiple times * addressing #122, file delete Matadata unmarshal * addressing #123, fix response for non-existing pod * addressing #127, server requires postageBlockId to run * addressing #116, non-existing dir response * addressing #119, backup old file in case same name * code cleanup * code cleanup * code cleanup * code cleanup * addressing #117 and #118, issues related to pod deletion (#1) * addressing #117 and #118, issues related to pod deletion * fix reploading deleted file * fix #132, #133 * fixes #141, rmdir updates feed with magicword * fixes #134 * fixes #135 & #136 * fixing #139 * fix #140, accept mutable bool in request * minor typo * #97 handle query param for doc-ls * #102 handle exception for invalid json * #106 handled panic * related to #100, doc new podname missing * fix #124, handle removed root directory * handle #96 * handle #24, use shlex to parse prompt args * fixed #19, pod deletion requires password * check for root dir presence in mkdir * mod tidy (#146) * mod tidy * manually restore vendor * manually restore vendor * upload err fix * fix #86, shared pod removed from list * minor changes * fix #147, check read only feed before access time update in download * fix #148, close response body in bee client * minor file deletion test added * #92, table name added in count response * fix w/ deepsource recommendation * fix w/ deepsource recommendation * #102, add test for invalid json * 404 on file not present * add get endpoint for download * fix #158 * resolve anti-pattern * bump version --- README.md | 2 +- cmd/common/request.go | 2 +- cmd/dfs-cli/cmd/doc.go | 13 +- cmd/dfs-cli/cmd/prompt.go | 22 +- cmd/dfs/cmd/server.go | 9 +- go.mod | 6 +- go.sum | 110 +------ pkg/account/account.go | 4 +- pkg/account/encrypt.go | 2 +- pkg/account/wallet.go | 4 +- pkg/api/dir_ls.go | 5 + pkg/api/doc_loadjson.go | 4 +- pkg/api/doc_ls.go | 22 +- pkg/api/doc_new.go | 13 +- pkg/api/file_delete.go | 12 +- pkg/api/file_download.go | 10 +- pkg/api/file_upload.go | 4 +- pkg/api/kv_count.go | 4 +- pkg/api/kv_loadcsv.go | 9 +- pkg/api/pod_delete.go | 9 +- pkg/api/pod_open.go | 2 +- pkg/api/pod_share.go | 8 +- pkg/api/user_logout.go | 2 +- pkg/api/user_stat.go | 4 +- pkg/blockstore/bee/client.go | 64 ++-- pkg/blockstore/bee/mock/client.go | 4 +- pkg/collection/document.go | 331 ++++++++++--------- pkg/collection/document_test.go | 64 ++-- pkg/collection/errors.go | 1 + pkg/collection/index.go | 13 +- pkg/collection/index_api.go | 20 +- pkg/collection/iterator.go | 3 +- pkg/collection/kv.go | 33 +- pkg/dfs/fs_api.go | 28 ++ pkg/dfs/kv_api.go | 8 +- pkg/dfs/pod_api.go | 53 ++- pkg/dir/dir_present.go | 5 +- pkg/dir/inode.go | 22 ++ pkg/dir/ls.go | 2 +- pkg/dir/mkdir.go | 46 ++- pkg/dir/mkdir_test.go | 53 +++ pkg/dir/rmdir.go | 92 +++++- pkg/dir/rmdir_test.go | 129 +++++++- pkg/dir/stat.go | 7 +- pkg/dir/sync.go | 12 +- pkg/feed/lookup/epoch.go | 2 +- pkg/feed/timestampprovider.go | 2 +- pkg/file/download.go | 23 +- pkg/file/meta.go | 56 ++++ pkg/file/mock/mock_file.go | 16 +- pkg/file/reader_test.go | 5 +- pkg/file/rm_test.go | 24 ++ pkg/file/upload.go | 13 +- pkg/pod/del.go | 33 +- pkg/pod/del_test.go | 4 +- pkg/pod/errors.go | 3 +- pkg/pod/new.go | 4 +- pkg/pod/open.go | 10 +- pkg/pod/sync.go | 3 +- pkg/pod/utils.go | 4 +- pkg/user/name_address.go | 6 +- pkg/user/present.go | 2 +- pkg/user/stat.go | 2 +- pkg/user/store_mnemonic.go | 6 +- pkg/utils/address.go | 4 +- vendor/github.com/google/shlex/COPYING | 202 ++++++++++++ vendor/github.com/google/shlex/README | 2 + vendor/github.com/google/shlex/go.mod | 3 + vendor/github.com/google/shlex/shlex.go | 416 ++++++++++++++++++++++++ vendor/modules.txt | 13 +- version.go | 2 +- 71 files changed, 1607 insertions(+), 525 deletions(-) create mode 100644 vendor/github.com/google/shlex/COPYING create mode 100644 vendor/github.com/google/shlex/README create mode 100644 vendor/github.com/google/shlex/go.mod create mode 100644 vendor/github.com/google/shlex/shlex.go diff --git a/README.md b/README.md index 9078b389..0bfe2f1b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ dfs can be used for the following use cases ### User The first step in dfs is to create a user. Every user is associated with a 12 -word mnemonic based hd wallet. This wallet is passwod protected and stored in +word mnemonic based hd wallet. This wallet is password protected and stored in the datadir. whenever a user created a pod for himself, a new key pair is created using this mnemonic. A user can use this mnemonic and import their account in any device and instantly see all their pods. diff --git a/cmd/common/request.go b/cmd/common/request.go index ceda7b32..33157f3e 100644 --- a/cmd/common/request.go +++ b/cmd/common/request.go @@ -58,7 +58,7 @@ type DocRequest struct { SimpleIndex string `json:"si,omitempty"` CompoundIndex string `json:"ci,omitempty"` Expression string `json:"expr,omitempty"` - Mutable string `json:"mutable,omitempty"` + Mutable bool `json:"mutable,omitempty"` Limit string `json:"limit,omitempty"` FileName string `json:"file_name,omitempty"` } diff --git a/cmd/dfs-cli/cmd/doc.go b/cmd/dfs-cli/cmd/doc.go index 303ecfb1..057362ff 100644 --- a/cmd/dfs-cli/cmd/doc.go +++ b/cmd/dfs-cli/cmd/doc.go @@ -28,11 +28,22 @@ import ( "github.com/fairdatasociety/fairOS-dfs/pkg/api" ) -func docNew(tableName, simpleIndex, mutable string) { +func docNew(podName, tableName, simpleIndex, mutableStr string) { + mutable := true + if mutableStr != "" { + mut, err := strconv.ParseBool(mutableStr) + if err != nil { + fmt.Println("doc new: error parsing \"mutable\" string") + return + } + mutable = mut + } + docNewReq := common.DocRequest{ TableName: tableName, SimpleIndex: simpleIndex, Mutable: mutable, + PodName: podName, } jsonData, err := json.Marshal(docNewReq) if err != nil { diff --git a/cmd/dfs-cli/cmd/prompt.go b/cmd/dfs-cli/cmd/prompt.go index 3b591a22..1629d42b 100644 --- a/cmd/dfs-cli/cmd/prompt.go +++ b/cmd/dfs-cli/cmd/prompt.go @@ -25,6 +25,7 @@ import ( "github.com/c-bata/go-prompt" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" + "github.com/google/shlex" "golang.org/x/term" ) @@ -195,7 +196,14 @@ func completer(in prompt.Document) []prompt.Suggest { func executor(in string) { in = strings.TrimSpace(in) - blocks := strings.Split(in, " ") + blocks, err := shlex.Split(in) + if err != nil { + fmt.Println("unable to parse command") + return + } + if len(blocks) == 0 { + return + } switch blocks[0] { case "help": help() @@ -224,6 +232,10 @@ func executor(in string) { fmt.Println("invalid command. Missing \"name\" argument ") return } + if len(blocks) == 3 { + fmt.Println("invalid command. Missing \"address\" or \"mnemonic\" argument ") + return + } userName := blocks[2] if len(blocks) == 4 { address := blocks[3] @@ -572,7 +584,7 @@ func executor(in string) { if len(blocks) == 5 { mutable = blocks[4] } - docNew(tableName, si, mutable) + docNew(currentPod, tableName, si, mutable) currentPrompt = getCurrentPrompt() case "ls": docList() @@ -774,6 +786,10 @@ func executor(in string) { compression := "" if len(blocks) >= 5 { compression = blocks[4] + if compression != "snappy" && compression != "gzip" { + fmt.Println("invalid value for \"compression\", should either be \"snappy\" or \"gzip\"") + return + } } uploadFile(fileName, currentPod, blocks[1], podDir, blockSize, compression) currentPrompt = getCurrentPrompt() @@ -945,7 +961,7 @@ func help() { fmt.Println(" - cd ") fmt.Println(" - ls ") fmt.Println(" - download ") - fmt.Println(" - upload , compression true/false") + fmt.Println(" - upload , compression snappy/gzip") fmt.Println(" - share - shares a file with another user") fmt.Println(" - receive - receives a file from another user") fmt.Println(" - receiveinfo - shows the received file info before accepting the receive") diff --git a/cmd/dfs/cmd/server.go b/cmd/dfs/cmd/server.go index f065ec6b..9f2e0eff 100644 --- a/cmd/dfs/cmd/server.go +++ b/cmd/dfs/cmd/server.go @@ -48,6 +48,12 @@ var serverCmd = &cobra.Command{ Long: `Serves all the dfs commands through an HTTP server so that the upper layers can consume it.`, Run: func(cmd *cobra.Command, args []string) { + if postageBlockId == "" { + _ = cmd.Help() + fmt.Println("\npostageBlockId is required to run server") + return + } + var logger logging.Logger switch v := strings.ToLower(verbosity); v { case "0", "silent": @@ -180,7 +186,7 @@ func startHttpService(logger logging.Logger) { userRouter.HandleFunc("/logout", handler.UserLogoutHandler).Methods("POST") userRouter.HandleFunc("/export", handler.ExportUserHandler).Methods("POST") userRouter.HandleFunc("/delete", handler.UserDeleteHandler).Methods("DELETE") - userRouter.HandleFunc("/stat", handler.GetUserStatHandler).Methods("GET") + userRouter.HandleFunc("/stat", handler.UserStatHandler).Methods("GET") // pod related handlers baseRouter.HandleFunc("/pod/receive", handler.PodReceiveHandler).Methods("GET") @@ -208,6 +214,7 @@ func startHttpService(logger logging.Logger) { // file related handlers fileRouter := baseRouter.PathPrefix("/file/").Subrouter() fileRouter.Use(handler.LoginMiddleware) + fileRouter.HandleFunc("/download", handler.FileDownloadHandler).Methods("GET") fileRouter.HandleFunc("/download", handler.FileDownloadHandler).Methods("POST") fileRouter.HandleFunc("/upload", handler.FileUploadHandler).Methods("POST") fileRouter.HandleFunc("/share", handler.FileShareHandler).Methods("POST") diff --git a/go.mod b/go.mod index aeb3c0b3..d43def3f 100644 --- a/go.mod +++ b/go.mod @@ -10,23 +10,19 @@ require ( github.com/ethersphere/bee v0.5.0 github.com/ethersphere/bmt v0.1.4 github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/gorilla/mux v1.7.4 github.com/gorilla/securecookie v1.1.1 github.com/hashicorp/golang-lru v0.5.4 - github.com/klauspost/compress v1.10.1 // indirect github.com/klauspost/pgzip v1.2.5 - github.com/libp2p/go-libp2p-autonat-svc v0.1.0 // indirect - github.com/mattn/go-sqlite3 v1.14.6 github.com/mattn/go-tty v0.0.3 // indirect github.com/miguelmota/go-ethereum-hdwallet v0.0.0-20200123000308-a60dcd172b4c github.com/mitchellh/go-homedir v1.1.0 - github.com/mmcloughlin/avo v0.0.0-20200803215136-443f81d77104 // indirect github.com/pkg/term v0.0.0-20200520122047-c3ffed290a03 // indirect github.com/rs/cors v1.7.0 github.com/sirupsen/logrus v1.6.0 github.com/spf13/cobra v1.0.0 github.com/spf13/viper v1.7.0 - github.com/tidwall/pretty v1.0.2 // indirect github.com/tinygrasshopper/bettercsv v0.0.1 github.com/tyler-smith/go-bip39 v1.0.2 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad diff --git a/go.sum b/go.sum index 8b80408a..66951f0f 100644 --- a/go.sum +++ b/go.sum @@ -61,9 +61,7 @@ github.com/apilayer/freegeoip v3.5.0+incompatible/go.mod h1:CUfFqErhFhXneJendyQ/ github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= github.com/aristanetworks/glog v0.0.0-20180419172825-c15b03b3054f/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= github.com/aristanetworks/glog v0.0.0-20191112221043-67e8567f59f3/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= -github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= -github.com/aristanetworks/goarista v0.0.0-20190912214011-b54698eaaca6 h1:6bZNnQcA2fkzH9AhZXbp2nDqbWa4bBqFeUb70Zq1HBM= github.com/aristanetworks/goarista v0.0.0-20190912214011-b54698eaaca6/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= github.com/aristanetworks/goarista v0.0.0-20200521140103-6c3304613b30 h1:cgk6xsRVshE29qzHDCQ+tqmu7ny8GnjPQhAw/RTk/Co= github.com/aristanetworks/goarista v0.0.0-20200521140103-6c3304613b30/go.mod h1:QZe5Yh80Hp1b6JxQdpfSEEe8X7hTyTEZSosSrFf/oJE= @@ -83,13 +81,11 @@ github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnC github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= @@ -105,6 +101,7 @@ github.com/c-bata/go-prompt v0.2.3 h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2 github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -134,9 +131,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= -github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= -github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= @@ -166,33 +161,21 @@ github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= -github.com/elastic/gosigar v0.10.5 h1:GzPQ+78RaAb4J63unidA/JavQRKrB6s8IOzN6Ib59jo= github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.9.5 h1:4oxsF+/3N/sTgda9XTVG4r+wMVLsveziSMcK83hPbsk= github.com/ethereum/go-ethereum v1.9.5/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY= github.com/ethereum/go-ethereum v1.9.14/go.mod h1:oP8FC5+TbICUyftkTWs+8JryntjIJLJvWvApK3z2AYw= -github.com/ethereum/go-ethereum v1.9.20 h1:kk/J5OIoaoz3DRrCXznz3RGi212mHHXwzXlY/ZQxcj0= github.com/ethereum/go-ethereum v1.9.20/go.mod h1:JSSTypSMTkGZtAdAChH2wP5dZEvPGh3nUTuDpH+hNrg= -github.com/ethereum/go-ethereum v1.9.21 h1:8qRlhzrItnmUGdVlBzZLI2Tb46S0RdSNjFwICo781ws= -github.com/ethereum/go-ethereum v1.9.21/go.mod h1:RXAVzbGrSGmDkDnHymruTAIEjUR3E4TX0EOpaj702sI= -github.com/ethereum/go-ethereum v1.9.22-0.20200911183538-4e2641319be2 h1:5Z8mijFd1j1e8DCNkvxE5COC/6ZUmODVzGW7ktUm/XU= -github.com/ethereum/go-ethereum v1.9.22-0.20200911183538-4e2641319be2/go.mod h1:+RMGXaVZGz/jk/EqNxTp2NifDq2DfzXFYXYuXPxqOsY= github.com/ethereum/go-ethereum v1.9.22 h1:/Fea9n2EWJuNJ9oahMq9luqjRBcbW7QWdThbcJl13ek= github.com/ethereum/go-ethereum v1.9.22/go.mod h1:FQjK3ZwD8C5DYn7ukTmFee36rq1dOMESiUfXr5RUc1w= -github.com/ethersphere/bee v0.2.1-0.20200911202143-349d07968e5b h1:4jToFKp6Wxvw48xm78izZ1T0K6zsftfSJQG5of2dKW8= -github.com/ethersphere/bee v0.2.1-0.20200911202143-349d07968e5b/go.mod h1:n38a2E9w2q0jNNR89Dyz008LwpSaQ6DyRBXQK65521I= github.com/ethersphere/bee v0.5.0 h1:SA5CP2wY2OJ1sDJrDcoWIJqiPWZQSl6MzkR4fMJmM1U= github.com/ethersphere/bee v0.5.0/go.mod h1:n9GTGieTJ1LcVSOhHqxXu4kf80sUSUzyxCb/8UP33DU= -github.com/ethersphere/bmt v0.1.2 h1:FEuvQY9xuK+rDp3VwDVyde8T396Matv/u9PdtKa2r9Q= -github.com/ethersphere/bmt v0.1.2/go.mod h1:fqRBDmYwn3lX2MH4lkImXQgFWeNP8ikLkS/hgi/HRws= github.com/ethersphere/bmt v0.1.4 h1:+rkWYNtMgDx6bkNqGdWu+U9DgGI1rRZplpSW3YhBr1Q= github.com/ethersphere/bmt v0.1.4/go.mod h1:Yd8ft1U69WDuHevZc/rwPxUv1rzPSMpMnS6xbU53aY8= github.com/ethersphere/langos v1.0.0/go.mod h1:dlcN2j4O8sQ+BlCaxeBu43bgr4RQ+inJ+pHwLeZg5Tw= -github.com/ethersphere/manifest v0.2.0/go.mod h1:ygAx0KLhXYmKqsjUab95RCbXf8UcO7yMDjyfP0lY76Y= github.com/ethersphere/manifest v0.3.6/go.mod h1:frSxQFT67hQvmTN5CBtgVuqHzGQpg0V0oIIm/B3Am+U= github.com/ethersphere/sw3-bindings/v2 v2.1.0/go.mod h1:ozMVBZZlAirS/FcUpFwzV60v8gC0nVbA/5ZXtCX3xCc= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -204,7 +187,6 @@ github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -218,8 +200,10 @@ github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclK github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= @@ -259,7 +243,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 h1:lMm2hD9Fy0ynom5+85/pbdkiYcBqM1JWmhpAXLmy0fw= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -269,6 +252,7 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -280,6 +264,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.4 h1:0ecGp3skIrHWPNGPJDaBIghfA6Sp7Ruo2Io8eLKzWm0= @@ -291,7 +277,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -326,7 +311,6 @@ github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= @@ -380,9 +364,7 @@ github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBW github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= -github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= @@ -400,8 +382,6 @@ github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629 h1:1dSBUfGlorLAua2CRx0zFN7kQsTpE2DQSmr7rrTNgY8= -github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629/go.mod h1:mb5nS4uRANwOJSZj8rlCWAfAcGi72GGMIXx+xGOjA7M= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -435,10 +415,10 @@ github.com/klauspost/reedsolomon v1.9.3/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.2/go.mod h1:XoLfkAiA2KeZsYh4DbHxD7h3nR2AZNqVQOa+LJuqPYs= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -458,33 +438,21 @@ github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UG github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= -github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= -github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= -github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= -github.com/libp2p/go-libp2p-autonat v0.3.0/go.mod h1:PVnbdY58UqTb+QApHJAC64ci4nM1WzY+fVyxAvBCGOY= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= -github.com/libp2p/go-libp2p-autonat-svc v0.1.0/go.mod h1:fqi8Obl/z3R4PFVLm8xFtZ6PBL9MlV/xumymRFkKq5A= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= -github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= -github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.3.0/go.mod h1:lqBfTamw6uOW1ExoIcuP9WeZFQkw8oMQW33tKNaIfMY= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= @@ -496,8 +464,6 @@ github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUh github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= @@ -506,10 +472,8 @@ github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= -github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= @@ -518,7 +482,6 @@ github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= -github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= @@ -530,12 +493,8 @@ github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1c github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= -github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= -github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= -github.com/libp2p/go-libp2p-quic-transport v0.8.0/go.mod h1:F2FG/6Bzz0U6essUVxDzE0s9CrY4XGLbl7QEmDNvU7A= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= @@ -544,7 +503,6 @@ github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncH github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= @@ -581,7 +539,6 @@ github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= @@ -591,7 +548,6 @@ github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIY github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.6/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= @@ -607,23 +563,18 @@ github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2 github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= -github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= github.com/libp2p/go-ws-transport v0.4.0/go.mod h1:EcIEKqf/7GDjth6ksuS/6p7R49V4CBY6/E7R/iyhYUA= github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.3.8/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/lucas-clemente/quic-go v0.15.2/go.mod h1:qxmO5Y4ZMhdNkunGfxuZnZXnJwYpW9vjQkyrZ7BsgUI= -github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= -github.com/lucas-clemente/quic-go v0.18.0/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -632,12 +583,9 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.8.0/go.mod h1:Lao6jDqlCfxyLKYFmZXGm2LSHBgVn+P+ROOex6YkT+k= -github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -653,7 +601,6 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= @@ -663,8 +610,6 @@ github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -690,12 +635,9 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mmcloughlin/avo v0.0.0-20200803215136-443f81d77104 h1:ULR/QWMgcgRiZLUjSSJMU+fW+RDMstRdmnDWj9Q+AsA= -github.com/mmcloughlin/avo v0.0.0-20200803215136-443f81d77104/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -753,6 +695,7 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -766,6 +709,7 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -774,11 +718,11 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= @@ -787,7 +731,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= @@ -796,7 +739,6 @@ github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssy github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -845,7 +787,6 @@ github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00 h1:8DPul/X0IT/1TNMIxoKLwdemEOBBHDC/K4EB16Cw5WE= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -901,18 +842,15 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2 github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.3.1 h1:GPTpEAuNr98px18yNQ66JllNil98wfRZ/5Ukny8FeQA= github.com/spf13/afero v1.3.1/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -934,14 +872,12 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v0.0.0-20180621010148-0d5a0ceb10cf/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= @@ -952,20 +888,16 @@ github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYq github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= -github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tinygrasshopper/bettercsv v0.0.1 h1:N96aWjbUBN2q+KotgSI9FMR+1Y4IIBMVMPiL8qASK0k= github.com/tinygrasshopper/bettercsv v0.0.1/go.mod h1:0pXjg6Vm8+zAkvosNH2S0dx8gc7H1hDIV0pMzmq1vRI= github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= github.com/tjfoc/gmsm v1.3.0/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tyler-smith/go-bip39 v0.0.0-20180618194314-52158e4697b8 h1:g3yQGZK+G6dfF/mw/SOwsTMzUVkpT4hB8pHxpbTXkKw= github.com/tyler-smith/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/uber/jaeger-client-go v2.24.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -978,9 +910,7 @@ github.com/wealdtech/go-string2eth v1.0.0/go.mod h1:UZA/snEybGcD6n+Pl+yoDjmexlEJ github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= -github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8= github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= -github.com/whyrusleeping/mdns v0.0.0-20180901202407-ef14215e6b30/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= @@ -1005,7 +935,6 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -1019,7 +948,6 @@ go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/arch v0.0.0-20190909030613-46d78d1859ac/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1050,9 +978,7 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= @@ -1082,7 +1008,6 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1115,7 +1040,6 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200320220750-118fecf932d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U= golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -1137,10 +1061,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1183,16 +1105,12 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kYgpFIzOAfeAAN7m3qQ4= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1205,9 +1123,7 @@ golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1247,8 +1163,6 @@ golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200221224223-e1da425f72fd/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f h1:JcoF/bowzCDI+MXu1yLqQGNO3ibqWsWq+Sk7pOT218w= golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1322,7 +1236,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fatih/set.v0 v0.2.1/go.mod h1:5eLWEndGL4zGGemXWrKuts+wTJR0y+w+auqUJZbmyBg= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -1342,6 +1255,7 @@ gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -1371,11 +1285,9 @@ resenje.org/jsonhttp v0.2.0/go.mod h1:EDyeguyTWj2fU3D3SCE0qNTgthzyEkHYLM1uu0uikH resenje.org/logging v0.1.5/go.mod h1:1IdoCm3+UwYfsplxDGV2pHCkUrLlQzlWwp4r28XfPx4= resenje.org/marshal v0.1.1/go.mod h1:P7Cla6Ju5CFvW4Y8JbRgWX1Hcy4L1w4qcCsyadO7G94= resenje.org/recovery v0.1.1/go.mod h1:3S6aCVKMJEWsSAb61oZTteaiqkIfQPTr1RdiWnRbhME= -resenje.org/web v0.4.3 h1:G9vceKKGvsVg0WpyafJEEMHfstoxSO8rG/1Bo7fOkhw= resenje.org/web v0.4.3/go.mod h1:GZw/Jt7IGIYlytsyGdAV5CytZnaQu7GV2u1LLuViihc= resenje.org/x v0.2.4/go.mod h1:1b2Xpo29FRc3IMvg/u46/IyjySl5IjvtuSjXTA/AOnk= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= diff --git a/pkg/account/account.go b/pkg/account/account.go index 8074e04a..c3a1d7a5 100644 --- a/pkg/account/account.go +++ b/pkg/account/account.go @@ -322,7 +322,7 @@ func (a *Account) GetUserAccountInfo() *Info { return a.userAcount } -func (a *Account) GetEmptyAccountInfo() *Info { +func (*Account) GetEmptyAccountInfo() *Info { return &Info{} } @@ -369,7 +369,7 @@ func (a *Account) encryptMnemonic(mnemonic, passPhrase string) (string, error) { return encryptedMessage, nil } -func (a *Account) getPassword() (password string) { +func (*Account) getPassword() (password string) { // read the pass phrase bytePassword, err := term.ReadPassword(0) if err != nil { diff --git a/pkg/account/encrypt.go b/pkg/account/encrypt.go index ab36bfd1..22bfe2f3 100644 --- a/pkg/account/encrypt.go +++ b/pkg/account/encrypt.go @@ -61,7 +61,7 @@ func decrypt(key []byte, securemess string) (decodedmess string, err error) { } if len(cipherText) < aes.BlockSize { - err = errors.New("Ciphertext block size is too short!") + err = errors.New("ciphertext block size is too short!") return } diff --git a/pkg/account/wallet.go b/pkg/account/wallet.go index 66396c35..f064cfa9 100644 --- a/pkg/account/wallet.go +++ b/pkg/account/wallet.go @@ -77,7 +77,7 @@ func (w *Wallet) LoadMnemonicAndCreateRootAccount(mnemonic string) (accounts.Acc } // CreateAccount is used to create a new hd wallet using the given mnemonic and the walletPath. -func (w *Wallet) CreateAccount(walletPath, plainMnemonic string) (accounts.Account, error) { +func (*Wallet) CreateAccount(walletPath, plainMnemonic string) (accounts.Account, error) { wallet, err := hdwallet.NewFromMnemonic(plainMnemonic) if err != nil { return accounts.Account{}, err @@ -91,7 +91,7 @@ func (w *Wallet) CreateAccount(walletPath, plainMnemonic string) (accounts.Accou } // IsValidMnemonic is used to validate a mnemonic to see if it is valid 12 word bip-0039 compliant. -func (w *Wallet) IsValidMnemonic(mnemonic string) error { +func (*Wallet) IsValidMnemonic(mnemonic string) error { // test the mnemonic for validity words := strings.Split(mnemonic, " ") if len(words) != 12 { diff --git a/pkg/api/dir_ls.go b/pkg/api/dir_ls.go index 208dde4a..3a0ea8ca 100644 --- a/pkg/api/dir_ls.go +++ b/pkg/api/dir_ls.go @@ -75,6 +75,11 @@ func (h *Handler) DirectoryLsHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.BadRequest(w, "ls: "+err.Error()) return } + if err == dir.ErrDirectoryNotPresent { + h.logger.Errorf("ls: %v", err) + jsonhttp.NotFound(w, "ls: "+err.Error()) + return + } h.logger.Errorf("ls: %v", err) jsonhttp.InternalServerError(w, "ls: "+err.Error()) return diff --git a/pkg/api/doc_loadjson.go b/pkg/api/doc_loadjson.go index 6ffec089..2a02ffd0 100644 --- a/pkg/api/doc_loadjson.go +++ b/pkg/api/doc_loadjson.go @@ -122,8 +122,8 @@ func (h *Handler) DocLoadJsonHandler(w http.ResponseWriter, r *http.Request) { } err = h.dfsAPI.DocBatchWrite(sessionId, podName, docBatch) if err != nil { - h.logger.Errorf("doc loadjso: %v", err) - jsonhttp.InternalServerError(w, "doc loadjso: "+err.Error()) + h.logger.Errorf("doc loadjson: %v", err) + jsonhttp.InternalServerError(w, "doc loadjson: "+err.Error()) return } diff --git a/pkg/api/doc_ls.go b/pkg/api/doc_ls.go index 75a5fd03..575ae304 100644 --- a/pkg/api/doc_ls.go +++ b/pkg/api/doc_ls.go @@ -17,10 +17,8 @@ limitations under the License. package api import ( - "encoding/json" "net/http" - "github.com/fairdatasociety/fairOS-dfs/cmd/common" "github.com/fairdatasociety/fairOS-dfs/pkg/collection" "github.com/fairdatasociety/fairOS-dfs/pkg/cookie" "resenje.org/jsonhttp" @@ -38,23 +36,13 @@ type DocumentDB struct { // DocListHandler is the api handler which lists all the document database in a pod // it takes no arguments func (h *Handler) DocListHandler(w http.ResponseWriter, r *http.Request) { - contentType := r.Header.Get("Content-Type") - if contentType != jsonContentType { - h.logger.Errorf("doc ls: invalid request body type") - jsonhttp.BadRequest(w, "doc ls: invalid request body type") - return - } - - decoder := json.NewDecoder(r.Body) - var docReq common.DocRequest - err := decoder.Decode(&docReq) - if err != nil { - h.logger.Errorf("doc ls: could not decode arguments") - jsonhttp.BadRequest(w, "doc ls: could not decode arguments") + keys, ok := r.URL.Query()["pod_name"] + if !ok || len(keys[0]) < 1 { + h.logger.Errorf("doc ls: \"pod_name\" argument missing") + jsonhttp.BadRequest(w, "doc ls: \"pod_name\" argument missing") return } - - podName := docReq.PodName + podName := keys[0] if podName == "" { h.logger.Errorf("doc ls: \"pod_name\" argument missing") jsonhttp.BadRequest(w, "doc ls: \"pod_name\" argument missing") diff --git a/pkg/api/doc_new.go b/pkg/api/doc_new.go index 814046fb..b2d1df1e 100644 --- a/pkg/api/doc_new.go +++ b/pkg/api/doc_new.go @@ -19,7 +19,6 @@ package api import ( "encoding/json" "net/http" - "strconv" "strings" "github.com/fairdatasociety/fairOS-dfs/cmd/common" @@ -95,17 +94,7 @@ func (h *Handler) DocCreateHandler(w http.ResponseWriter, r *http.Request) { } } - mutable := true - mutableStr := docReq.Mutable - if mutableStr != "" { - mut, err := strconv.ParseBool(mutableStr) - if err != nil { - h.logger.Errorf("doc create: \"mutable\" argument missing") - jsonhttp.BadRequest(w, "doc create: \"mutable\" argument missing") - return - } - mutable = mut - } + mutable := docReq.Mutable // get values from cookie sessionId, err := cookie.GetSessionIdFromCookie(r) diff --git a/pkg/api/file_delete.go b/pkg/api/file_delete.go index 74c31fd6..3e32e68f 100644 --- a/pkg/api/file_delete.go +++ b/pkg/api/file_delete.go @@ -21,12 +21,10 @@ import ( "net/http" "github.com/fairdatasociety/fairOS-dfs/cmd/common" - + "github.com/fairdatasociety/fairOS-dfs/pkg/cookie" "github.com/fairdatasociety/fairOS-dfs/pkg/dfs" - + "github.com/fairdatasociety/fairOS-dfs/pkg/pod" "resenje.org/jsonhttp" - - "github.com/fairdatasociety/fairOS-dfs/pkg/cookie" ) // FileDeleteHandler is the api handler to delete a file from a given pod @@ -75,7 +73,6 @@ func (h *Handler) FileDeleteHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.BadRequest(w, "file delete: \"cookie-id\" parameter missing in cookie") return } - // delete file err = h.dfsAPI.DeleteFile(podName, podFileWithPath, sessionId) if err != nil { @@ -84,6 +81,11 @@ func (h *Handler) FileDeleteHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.BadRequest(w, "file delete: "+err.Error()) return } + if err == pod.ErrInvalidFile { + h.logger.Errorf("file delete: %v", err) + jsonhttp.NotFound(w, "file delete: "+err.Error()) + return + } h.logger.Errorf("file delete: %v", err) jsonhttp.InternalServerError(w, "file delete: "+err.Error()) return diff --git a/pkg/api/file_download.go b/pkg/api/file_download.go index 7f7611bc..c2e740c4 100644 --- a/pkg/api/file_download.go +++ b/pkg/api/file_download.go @@ -21,11 +21,10 @@ import ( "net/http" "strconv" + "github.com/fairdatasociety/fairOS-dfs/pkg/cookie" "github.com/fairdatasociety/fairOS-dfs/pkg/dfs" - + "github.com/fairdatasociety/fairOS-dfs/pkg/file" "resenje.org/jsonhttp" - - "github.com/fairdatasociety/fairOS-dfs/pkg/cookie" ) // FileDownloadHandler is the api handler to download a file from a given pod @@ -67,6 +66,11 @@ func (h *Handler) FileDownloadHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.BadRequest(w, "download: "+err.Error()) return } + if err == file.ErrFileNotPresent || err == file.ErrFileNotFound { + h.logger.Errorf("download: %v", err) + jsonhttp.NotFound(w, "download: "+err.Error()) + return + } h.logger.Errorf("download: %v", err) jsonhttp.InternalServerError(w, "download: "+err.Error()) return diff --git a/pkg/api/file_upload.go b/pkg/api/file_upload.go index e06f0f1b..3632759b 100644 --- a/pkg/api/file_upload.go +++ b/pkg/api/file_upload.go @@ -43,7 +43,7 @@ const ( // it takes three argument // - dir_path: the directory in the pod where the file should be uploaded // - block_size: the block size of the file -// - files: the argument name iwhere the file to upload is attached n the multipart file upload +// - files: the argument name of the file to upload is attached in the multipart file upload // Header: // - fairOS-dfs-Compression: gzip/snappy func (h *Handler) FileUploadHandler(w http.ResponseWriter, r *http.Request) { @@ -131,7 +131,7 @@ func (h *Handler) FileUploadHandler(w http.ResponseWriter, r *http.Request) { //upload file to bee uploadErr := h.dfsAPI.UploadFile(podName, file.Filename, sessionId, file.Size, fd, podPath, compression, uint32(bs)) if uploadErr != nil { - if err == dfs.ErrPodNotOpen { + if uploadErr == dfs.ErrPodNotOpen { h.logger.Errorf("file upload: %v", uploadErr) jsonhttp.BadRequest(w, "file upload: "+uploadErr.Error()) return diff --git a/pkg/api/kv_count.go b/pkg/api/kv_count.go index 30c4e9b4..9c0f2319 100644 --- a/pkg/api/kv_count.go +++ b/pkg/api/kv_count.go @@ -18,7 +18,6 @@ package api import ( "encoding/json" - "fmt" "net/http" "github.com/fairdatasociety/fairOS-dfs/cmd/common" @@ -81,6 +80,5 @@ func (h *Handler) KVCountHandler(w http.ResponseWriter, r *http.Request) { return } - cntStr := fmt.Sprintf("kv store %s has %d records", name, count) - jsonhttp.OK(w, cntStr) + jsonhttp.OK(w, count) } diff --git a/pkg/api/kv_loadcsv.go b/pkg/api/kv_loadcsv.go index 7474f7d3..c3c20318 100644 --- a/pkg/api/kv_loadcsv.go +++ b/pkg/api/kv_loadcsv.go @@ -87,7 +87,7 @@ func (h *Handler) KVLoadCSVHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.InternalServerError(w, "kv loadcsv: "+err.Error()) return } - + defer fd.Close() reader := bufio.NewReader(fd) readHeader := false rowCount := 0 @@ -146,13 +146,6 @@ func (h *Handler) KVLoadCSVHandler(w http.ResponseWriter, r *http.Request) { return } - err = fd.Close() - if err != nil { - h.logger.Errorf("kv loadcsv: %v", err) - jsonhttp.InternalServerError(w, "kv loadcsv: "+err.Error()) - return - } - sendStr := fmt.Sprintf("csv file loaded in to kv table (%s) with total:%d, success: %d, failure: %d rows", name, rowCount, successCount, failureCount) jsonhttp.OK(w, sendStr) } diff --git a/pkg/api/pod_delete.go b/pkg/api/pod_delete.go index 7adc02ca..e2e45a89 100644 --- a/pkg/api/pod_delete.go +++ b/pkg/api/pod_delete.go @@ -55,6 +55,13 @@ func (h *Handler) PodDeleteHandler(w http.ResponseWriter, r *http.Request) { return } + password := podReq.Password + if password == "" { + h.logger.Errorf("user delete: \"password\" argument missing") + jsonhttp.BadRequest(w, "user delete: \"password\" argument missing") + return + } + // get values from cookie sessionId, err := cookie.GetSessionIdFromCookie(r) if err != nil { @@ -69,7 +76,7 @@ func (h *Handler) PodDeleteHandler(w http.ResponseWriter, r *http.Request) { } // delete pod - err = h.dfsAPI.DeletePod(podName, sessionId) + err = h.dfsAPI.DeletePod(podName, password, sessionId) if err != nil { if err == dfs.ErrUserNotLoggedIn { h.logger.Errorf("delete pod: %v", err) diff --git a/pkg/api/pod_open.go b/pkg/api/pod_open.go index 149016c8..51ca6a48 100644 --- a/pkg/api/pod_open.go +++ b/pkg/api/pod_open.go @@ -78,7 +78,7 @@ func (h *Handler) PodOpenHandler(w http.ResponseWriter, r *http.Request) { if err == dfs.ErrUserNotLoggedIn || err == p.ErrInvalidPodName { h.logger.Errorf("pod open: %v", err) - jsonhttp.BadRequest(w, "pod open: "+err.Error()) + jsonhttp.NotFound(w, "pod open: "+err.Error()) return } h.logger.Errorf("pod open: %v", err) diff --git a/pkg/api/pod_share.go b/pkg/api/pod_share.go index d63f8dd1..9ef91ef8 100644 --- a/pkg/api/pod_share.go +++ b/pkg/api/pod_share.go @@ -105,8 +105,8 @@ func (h *Handler) PodShareHandler(w http.ResponseWriter, r *http.Request) { func (h *Handler) PodReceiveInfoHandler(w http.ResponseWriter, r *http.Request) { keys, ok := r.URL.Query()["sharing_ref"] if !ok || len(keys[0]) < 1 { - h.logger.Errorf("pod receive info: \"pod_name\" argument missing") - jsonhttp.BadRequest(w, "pod receiv infoe: \"pod_name\" argument missing") + h.logger.Errorf("pod receive info: \"sharing_ref\" argument missing") + jsonhttp.BadRequest(w, "pod receive info: \"sharing_ref\" argument missing") return } @@ -151,8 +151,8 @@ func (h *Handler) PodReceiveInfoHandler(w http.ResponseWriter, r *http.Request) func (h *Handler) PodReceiveHandler(w http.ResponseWriter, r *http.Request) { keys, ok := r.URL.Query()["sharing_ref"] if !ok || len(keys[0]) < 1 { - h.logger.Errorf("pod receive: \"pod_name\" argument missing") - jsonhttp.BadRequest(w, "pod receive: \"pod_name\" argument missing") + h.logger.Errorf("pod receive: \"sharing_ref\" argument missing") + jsonhttp.BadRequest(w, "pod receive: \"sharing_ref\" argument missing") return } diff --git a/pkg/api/user_logout.go b/pkg/api/user_logout.go index 52d803ae..e0aa02ff 100644 --- a/pkg/api/user_logout.go +++ b/pkg/api/user_logout.go @@ -52,5 +52,5 @@ func (h *Handler) UserLogoutHandler(w http.ResponseWriter, r *http.Request) { jsonhttp.InternalServerError(w, "user logout: "+err.Error()) return } - jsonhttp.OK(w, "used logged out successfully") + jsonhttp.OK(w, "user logged out successfully") } diff --git a/pkg/api/user_stat.go b/pkg/api/user_stat.go index 2f6106b0..84955aec 100644 --- a/pkg/api/user_stat.go +++ b/pkg/api/user_stat.go @@ -23,9 +23,9 @@ import ( "resenje.org/jsonhttp" ) -// GetUserStatHandler is the api handler to get the information about a user +// UserStatHandler is the api handler to get the information about a user // it takes no arguments -func (h *Handler) GetUserStatHandler(w http.ResponseWriter, r *http.Request) { +func (h *Handler) UserStatHandler(w http.ResponseWriter, r *http.Request) { // get values from cookie sessionId, err := cookie.GetSessionIdFromCookie(r) if err != nil { diff --git a/pkg/blockstore/bee/client.go b/pkg/blockstore/bee/client.go index 3dc7d4d8..3586ef64 100644 --- a/pkg/blockstore/bee/client.go +++ b/pkg/blockstore/bee/client.go @@ -127,6 +127,8 @@ func (s *BeeClient) CheckConnection() bool { if err != nil { return false } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { @@ -137,10 +139,6 @@ func (s *BeeClient) CheckConnection() bool { if err != nil { return false } - err = response.Body.Close() - if err != nil { - return false - } if string(data) != "Ethereum Swarm Bee\n" { return false @@ -149,7 +147,7 @@ func (s *BeeClient) CheckConnection() bool { } // UploadSOC is used construct and send a Single Owner Chunk to the Swarm bee client. -func (s *BeeClient) UploadSOC(owner string, id string, signature string, data []byte) (address []byte, err error) { +func (s *BeeClient) UploadSOC(owner, id, signature string, data []byte) (address []byte, err error) { to := time.Now() socResStr := socResource(owner, id, signature) fullUrl := fmt.Sprintf(s.url + socResStr) @@ -166,6 +164,8 @@ func (s *BeeClient) UploadSOC(owner string, id string, signature string, data [] if err != nil { return nil, err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusCreated { @@ -176,10 +176,6 @@ func (s *BeeClient) UploadSOC(owner string, id string, signature string, data [] if err != nil { return nil, errors.New("error downloading data") } - err = response.Body.Close() - if err != nil { - return nil, err - } var addrResp *chunkAddressResponse err = json.Unmarshal(addrData, &addrResp) @@ -218,6 +214,8 @@ func (s *BeeClient) UploadChunk(ch swarm.Chunk, pin bool) (address []byte, err e if err != nil { return nil, err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { @@ -228,10 +226,6 @@ func (s *BeeClient) UploadChunk(ch swarm.Chunk, pin bool) (address []byte, err e if err != nil { return nil, errors.New("error downloading data") } - err = response.Body.Close() - if err != nil { - return nil, err - } var addrResp *chunkAddressResponse err = json.Unmarshal(addrData, &addrResp) @@ -271,6 +265,8 @@ func (s *BeeClient) DownloadChunk(ctx context.Context, address []byte) (data []b if err != nil { return nil, err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { @@ -281,10 +277,6 @@ func (s *BeeClient) DownloadChunk(ctx context.Context, address []byte) (data []b if err != nil { return nil, errors.New("error downloading data") } - err = response.Body.Close() - if err != nil { - return nil, err - } s.addToChunkCache(addrString, data) fields := logrus.Fields{ @@ -325,6 +317,8 @@ func (s *BeeClient) UploadBlob(data []byte, pin, encrypt bool) (address []byte, if err != nil { return nil, err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusCreated { @@ -335,10 +329,6 @@ func (s *BeeClient) UploadBlob(data []byte, pin, encrypt bool) (address []byte, if err != nil { return nil, errors.New("error uploading blob") } - err = response.Body.Close() - if err != nil { - return nil, err - } var resp bytesPostResponse err = json.Unmarshal(respData, &resp) @@ -379,6 +369,8 @@ func (s *BeeClient) DownloadBlob(address []byte) ([]byte, int, error) { if err != nil { return nil, http.StatusNotFound, err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { @@ -389,10 +381,6 @@ func (s *BeeClient) DownloadBlob(address []byte) ([]byte, int, error) { if err != nil { return nil, response.StatusCode, errors.New("error downloading blob") } - err = response.Body.Close() - if err != nil { - return nil, http.StatusOK, err - } fields := logrus.Fields{ "reference": addrString, @@ -423,15 +411,14 @@ func (s *BeeClient) DeleteChunk(address []byte) error { if err != nil { return err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { return err } - err = response.Body.Close() - if err != nil { - return err - } + fields := logrus.Fields{ "reference": addrString, "duration": time.Since(to).String(), @@ -455,15 +442,13 @@ func (s *BeeClient) DeleteBlob(address []byte) error { if err != nil { return err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusOK { return err } - err = response.Body.Close() - if err != nil { - return err - } fields := logrus.Fields{ "reference": addrString, @@ -487,6 +472,8 @@ func (s *BeeClient) GetNewPostageBatch() error { if err != nil { return err } + defer response.Body.Close() + req.Close = true if response.StatusCode != http.StatusCreated { @@ -497,10 +484,6 @@ func (s *BeeClient) GetNewPostageBatch() error { if err != nil { return errors.New("error getting postage stamp") } - err = response.Body.Close() - if err != nil { - return err - } var batchResp *postageBatchResponse err = json.Unmarshal(respData, &batchResp) @@ -553,19 +536,20 @@ func (s *BeeClient) getFromChunkCache(key string) []byte { return nil } -func (s *BeeClient) addToBlockCache(cache *lru.Cache, key string, value []byte) { +func (*BeeClient) addToBlockCache(cache *lru.Cache, key string, value []byte) { if cache != nil { cache.Add(key, value) } } -func (s *BeeClient) inBlockCache(cache *lru.Cache, key string) bool { +func (*BeeClient) inBlockCache(cache *lru.Cache, key string) bool { if cache != nil { return cache.Contains(key) } return false } -func (s *BeeClient) getFromBlockCache(cache *lru.Cache, key string) []byte { + +func (*BeeClient) getFromBlockCache(cache *lru.Cache, key string) []byte { if cache != nil { value, ok := cache.Get(key) if ok { diff --git a/pkg/blockstore/bee/mock/client.go b/pkg/blockstore/bee/mock/client.go index d20cc47f..9c73ff53 100644 --- a/pkg/blockstore/bee/mock/client.go +++ b/pkg/blockstore/bee/mock/client.go @@ -43,7 +43,7 @@ func NewMockBeeClient() *MockBeeClient { } } -func (m *MockBeeClient) CheckConnection() bool { +func (*MockBeeClient) CheckConnection() bool { return true } @@ -131,6 +131,6 @@ func (m *MockBeeClient) DeleteBlob(address []byte) error { return errors.New("blob not found") } -func (m *MockBeeClient) GetNewPostageBatch() error { +func (*MockBeeClient) GetNewPostageBatch() error { return nil } diff --git a/pkg/collection/document.go b/pkg/collection/document.go index 7c2ca77f..13b6d5f4 100644 --- a/pkg/collection/document.go +++ b/pkg/collection/document.go @@ -283,6 +283,7 @@ func (d *Document) DeleteDocumentDB(dbName string) error { d.logger.Errorf("deleting document db: %v", err.Error()) return err } + defer d.removeFromOpenedDB(dbName) } docDB := d.getOpenedDb(dbName) //TODO: before deleting the indexes, unpin all the documents referenced in the ID index @@ -972,7 +973,13 @@ func (d *Document) addToOpenedDb(dbName string, docDB *DocumentDB) { d.openDocDBs[dbName] = docDB } -func (d *Document) resolveExpression(expr string) (string, string, string, error) { +func (d *Document) removeFromOpenedDB(dbName string) { + d.openDOcDBMu.Lock() + defer d.openDOcDBMu.Unlock() + delete(d.openDocDBs, dbName) +} + +func (*Document) resolveExpression(expr string) (string, string, string, error) { var operator string if strings.Contains(expr, "=>") { operator = "=>" @@ -995,7 +1002,7 @@ func (d *Document) resolveExpression(expr string) (string, string, string, error // CreateDocBatch creates a batch index instead of normal index. This is used when doing a bulk insert. func (d *Document) CreateDocBatch(dbName string) (*DocBatch, error) { - d.logger.Info("creeating batch for inserting in document db: ", dbName) + d.logger.Info("creating batch for inserting in document db: ", dbName) if d.fd.IsReadOnlyFeed() { d.logger.Errorf("creating batch: ", ErrReadOnlyIndex) return nil, ErrReadOnlyIndex @@ -1072,198 +1079,206 @@ func (d *Document) DocBatchPut(docBatch *DocBatch, doc []byte, index int64) erro d.logger.Errorf("inserting in batch: ", err.Error()) return err } - docMap := t.(map[string]interface{}) + switch t.(type) { + case map[string]interface{}: + // it's an object + docMap := t.(map[string]interface{}) - // check if docMap has all the fields in the simpleIndex - for field := range docBatch.db.simpleIndexes { - if _, found := docMap[field]; !found { - d.logger.Errorf("inserting in batch: ", ErrDocumentDBIndexFieldNotPresent) - return ErrDocumentDBIndexFieldNotPresent + // check if docMap has all the fields in the simpleIndex + for field := range docBatch.db.simpleIndexes { + if _, found := docMap[field]; !found { + d.logger.Errorf("inserting in batch: ", ErrDocumentDBIndexFieldNotPresent) + return ErrDocumentDBIndexFieldNotPresent + } } - } - var ref []byte - if docBatch.db.mutable { + var ref []byte + if docBatch.db.mutable { + + // check if the id is already present + // and remove it if it is present + var valStr string + idValue := docMap[DefaultIndexFieldName] + switch v := idValue.(type) { + case float64: + valStr = strconv.FormatFloat(v, 'f', 6, 64) + case string: + valStr = v + default: + return ErrInvalidIndexType + } - // check if the id is already present - // and remove it if it is present - var valStr string - idValue := docMap[DefaultIndexFieldName] - switch v := idValue.(type) { - case float64: - valStr = strconv.FormatFloat(v, 'f', 6, 64) - case string: - valStr = v - default: - return ErrInvalidIndexType - } + if valStr == "" { + d.logger.Errorf("inserting in batch: ", ErrInvalidDocumentId) + return ErrInvalidDocumentId + } else { + idBatchIndex := docBatch.batches[DefaultIndexFieldName] + refs, err := idBatchIndex.Get(valStr) + if err == nil { + // found a doc with the same id, so remove it and all the indexes + if len(refs) > 0 { + data, _, err := d.client.DownloadBlob(refs[0]) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } - if valStr == "" { - d.logger.Errorf("inserting in batch: ", ErrInvalidDocumentId) - return ErrInvalidDocumentId - } else { - idBatchIndex := docBatch.batches[DefaultIndexFieldName] - refs, err := idBatchIndex.Get(valStr) - if err == nil { - // found a doc with the same id, so remove it and all the indexes - if len(refs) > 0 { - data, _, err := d.client.DownloadBlob(refs[0]) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } + var t interface{} + err = json.Unmarshal(data, &t) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + oldDocMap := t.(map[string]interface{}) - var t interface{} - err = json.Unmarshal(data, &t) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } - oldDocMap := t.(map[string]interface{}) - - for field, batchIndex := range docBatch.batches { - v1 := oldDocMap[field] // it is already checked to be present - switch batchIndex.idx.indexType { - case StringIndex: - _, err := batchIndex.Del(v1.(string)) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } - case MapIndex: - valMap := v1.(map[string]interface{}) - for keyField, valueField := range valMap { - vf := valueField.(string) - mapField := keyField + vf - _, err := batchIndex.Del(mapField) + for field, batchIndex := range docBatch.batches { + v1 := oldDocMap[field] // it is already checked to be present + switch batchIndex.idx.indexType { + case StringIndex: + _, err := batchIndex.Del(v1.(string)) if err != nil { d.logger.Errorf("inserting in batch: ", err.Error()) return err } - } - case ListIndex: - valList := v1.([]interface{}) - for _, listVal := range valList { - _, err := batchIndex.Del(listVal.(string)) + case MapIndex: + valMap := v1.(map[string]interface{}) + for keyField, valueField := range valMap { + vf := valueField.(string) + mapField := keyField + vf + _, err := batchIndex.Del(mapField) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + } + case ListIndex: + valList := v1.([]interface{}) + for _, listVal := range valList { + _, err := batchIndex.Del(listVal.(string)) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + } + case NumberIndex: + val := v1.(float64) + //valStr = strconv.FormatFloat(val, 'f', 6, 64) + _, err := batchIndex.DelNumber(val) if err != nil { d.logger.Errorf("inserting in batch: ", err.Error()) return err } + case BytesIndex: + d.logger.Errorf("inserting in batch: ", ErrIndexNotSupported) + return ErrIndexNotSupported + default: + d.logger.Errorf("inserting in batch: ", ErrInvalidIndexType) + return ErrInvalidIndexType } - case NumberIndex: - val := v1.(float64) - //valStr = strconv.FormatFloat(val, 'f', 6, 64) - _, err := batchIndex.DelNumber(val) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } - case BytesIndex: - d.logger.Errorf("inserting in batch: ", ErrIndexNotSupported) - return ErrIndexNotSupported - default: - d.logger.Errorf("inserting in batch: ", ErrInvalidIndexType) - return ErrInvalidIndexType } - } - err = d.client.DeleteBlob(refs[0]) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } + err = d.client.DeleteBlob(refs[0]) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + } } } - } - // upload the document - ref, err = d.client.UploadBlob(doc, true, true) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err + // upload the document + ref, err = d.client.UploadBlob(doc, true, true) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + } else { + // store the seek index of the document instead of its reference + b := make([]byte, binary.MaxVarintLen64) + n := binary.PutUvarint(b, uint64(index)) + ref = b[:n] } - } else { - // store the seek index of the document instead of its reference - b := make([]byte, binary.MaxVarintLen64) - n := binary.PutUvarint(b, uint64(index)) - ref = b[:n] - } - // update the indexes - memory := !docBatch.db.mutable - for field, batchIndex := range docBatch.batches { - if v, found := docMap[field]; found { // it is already checked to be present - switch batchIndex.idx.indexType { - case StringIndex: - var valStr1 string - switch v := v.(type) { - case float64: - if field == DefaultIndexFieldName { - valStr1 = fmt.Sprintf("%d", int64(v)) - } else { - valStr1 = fmt.Sprintf("%020.20g", v) + // update the indexes + memory := !docBatch.db.mutable + for field, batchIndex := range docBatch.batches { + if v, found := docMap[field]; found { // it is already checked to be present + switch batchIndex.idx.indexType { + case StringIndex: + var valStr1 string + switch v := v.(type) { + case float64: + if field == DefaultIndexFieldName { + valStr1 = fmt.Sprintf("%d", int64(v)) + } else { + valStr1 = fmt.Sprintf("%020.20g", v) + } + case string: + valStr1 = v + default: + return ErrInvalidIndexType } - case string: - valStr1 = v - default: - return ErrInvalidIndexType - } - apnd := true - if field == DefaultIndexFieldName { - apnd = false - } - err := batchIndex.Put(valStr1, ref, apnd, memory) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err - } - case MapIndex: - valMap := v.(map[string]interface{}) - for keyField, valueField := range valMap { - vf := valueField.(string) - mapField := keyField + vf - err := batchIndex.Put(mapField, ref, true, memory) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err + apnd := true + if field == DefaultIndexFieldName { + apnd = false } - } - case ListIndex: - valList := v.([]interface{}) - for _, listVal := range valList { - listField := listVal.(string) - err := batchIndex.Put(listField, ref, true, memory) + err := batchIndex.Put(valStr1, ref, apnd, memory) if err != nil { d.logger.Errorf("inserting in batch: ", err.Error()) return err } - } - case NumberIndex: - switch v1 := v.(type) { - case string: - err := batchIndex.Put(v1, ref, true, memory) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err + case MapIndex: + valMap := v.(map[string]interface{}) + for keyField, valueField := range valMap { + vf := valueField.(string) + mapField := keyField + vf + err := batchIndex.Put(mapField, ref, true, memory) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } } - case float64: - err := batchIndex.PutNumber(v1, ref, true, memory) - if err != nil { - d.logger.Errorf("inserting in batch: ", err.Error()) - return err + case ListIndex: + valList := v.([]interface{}) + for _, listVal := range valList { + listField := listVal.(string) + err := batchIndex.Put(listField, ref, true, memory) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } } - default: + case NumberIndex: + switch v1 := v.(type) { + case string: + err := batchIndex.Put(v1, ref, true, memory) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + case float64: + err := batchIndex.PutNumber(v1, ref, true, memory) + if err != nil { + d.logger.Errorf("inserting in batch: ", err.Error()) + return err + } + default: + return ErrIndexNotSupported + } + + case BytesIndex: return ErrIndexNotSupported + default: + return ErrInvalidIndexType } - - case BytesIndex: - return ErrIndexNotSupported - default: - return ErrInvalidIndexType } } + default: + // it's something else + d.logger.Errorf("inserting in batch: unknown json format") + return ErrUnknownJsonFormat } return nil diff --git a/pkg/collection/document_test.go b/pkg/collection/document_test.go index 39274aaf..9142a1e3 100644 --- a/pkg/collection/document_test.go +++ b/pkg/collection/document_test.go @@ -863,25 +863,51 @@ func addDocument(t *testing.T, docStore *collection.Document, dbName, id, fname, func addBatchDocument(t *testing.T, docStore *collection.Document, docBatch *collection.DocBatch, id, fname, lname string, age float64, tagMap map[string]string, tagList []string) { t.Helper() - // create the doc - doc := &TestDocument{ - ID: id, - FirstName: fname, - LastName: lname, - Age: age, - TagMap: tagMap, - TagList: tagList, - } + t.Run("valid-json", func(t *testing.T) { + // create the doc + doc := &TestDocument{ + ID: id, + FirstName: fname, + LastName: lname, + Age: age, + TagMap: tagMap, + TagList: tagList, + } - // marshall the doc - data, err := json.Marshal(doc) - if err != nil { - t.Fatal(err) - } + // marshall the doc + data, err := json.Marshal(doc) + if err != nil { + t.Fatal(err) + } + + // insert the document in the batch + err = docStore.DocBatchPut(docBatch, data, 0) + if err != nil { + t.Fatal(err) + } + }) + t.Run("invalid-json", func(t *testing.T) { + // create the doc + doc := TestDocument{ + ID: id, + FirstName: fname, + LastName: lname, + Age: age, + TagMap: tagMap, + TagList: tagList, + } + + // marshall the doc + data, err := json.Marshal([]TestDocument{doc}) + if err != nil { + t.Fatal(err) + } + + // insert the document in the batch + err = docStore.DocBatchPut(docBatch, data, 0) + if err != collection.ErrUnknownJsonFormat { + t.Fatal(err) + } + }) - // insert the document in the batch - err = docStore.DocBatchPut(docBatch, data, 0) - if err != nil { - t.Fatal(err) - } } diff --git a/pkg/collection/errors.go b/pkg/collection/errors.go index 09b7a293..dd9b587a 100644 --- a/pkg/collection/errors.go +++ b/pkg/collection/errors.go @@ -50,4 +50,5 @@ var ( ErrReadOnlyIndex = errors.New("read only index") ErrCannotModifyImmutableIndex = errors.New("trying to modify immutable index") ErrCouldNotUpdatePostageBatch = errors.New("could not procure new postage batch") + ErrUnknownJsonFormat = errors.New("unknown json format") ) diff --git a/pkg/collection/index.go b/pkg/collection/index.go index 2401bf92..850c5bba 100644 --- a/pkg/collection/index.go +++ b/pkg/collection/index.go @@ -103,7 +103,7 @@ func CreateIndex(podName, collectionName, indexName string, indexType IndexType, actualIndexName := podName + collectionName + indexName topic := utils.HashString(actualIndexName) _, oldData, err := fd.GetFeedData(topic, user) - if err == nil && len(oldData) != 0 { + if err == nil && len(oldData) != 0 && string(oldData) != utils.DeletedFeedMagicWord { // if the feed is present and it has some data means there index is still valid return ErrIndexAlreadyPresent } @@ -121,6 +121,13 @@ func CreateIndex(podName, collectionName, indexName string, indexType IndexType, return ErrManifestUnmarshall } + if string(oldData) == utils.DeletedFeedMagicWord { + _, err = fd.UpdateFeed(topic, user, ref) + if err != nil { + return ErrManifestCreate + } + return nil + } _, err = fd.CreateFeed(topic, user, ref) if err != nil { return ErrManifestCreate @@ -237,7 +244,6 @@ func (idx *Index) loadManifest(manifestPath string) (*Manifest, error) { if err != nil { return nil, ErrNoManifestFound } - data, respCode, err := idx.client.DownloadBlob(refData) if err != nil { return nil, ErrNoManifestFound @@ -333,9 +339,8 @@ func longestCommonPrefix(str1, str2 string) (string, string, string) { for i := 0; i < maxLen; i++ { if str1[i] != str2[i] { break - } else { - matchLen++ } + matchLen++ } if matchLen == 0 { return "", str1, str2 diff --git a/pkg/collection/index_api.go b/pkg/collection/index_api.go index 3685f4a2..26e40dc3 100644 --- a/pkg/collection/index_api.go +++ b/pkg/collection/index_api.go @@ -319,7 +319,7 @@ func (idx *Index) addOrUpdateStringEntry(ctx context.Context, manifest *Manifest return nil } -func (idx *Index) addEntryToManifestSortedLexicographically(manifest *Manifest, entryToAdd *Entry) { +func (*Index) addEntryToManifestSortedLexicographically(manifest *Manifest, entryToAdd *Entry) { var entries []*Entry // this is the first element @@ -356,17 +356,16 @@ func (idx *Index) addEntryToManifestSortedLexicographically(manifest *Manifest, if entry.Name == "" { entries = append(entries, entry) continue - } else { - if !entryAdded { - a := entry.Name[0] - b := entryToAdd.Name[0] - if a > b { - entries = append(entries, entryToAdd) - entryAdded = true - } + } + if !entryAdded { + a := entry.Name[0] + b := entryToAdd.Name[0] + if a > b { + entries = append(entries, entryToAdd) + entryAdded = true } - entries = append(entries, entry) } + entries = append(entries, entry) } if !entryAdded { @@ -421,7 +420,6 @@ func (idx *Index) findManifest(grandParentManifest, parentManifest *Manifest, ke } } else { childManifest = entry.Manifest - } return idx.findManifest(parentManifest, childManifest, childKey) diff --git a/pkg/collection/iterator.go b/pkg/collection/iterator.go index ddf38f4f..c503dad8 100644 --- a/pkg/collection/iterator.go +++ b/pkg/collection/iterator.go @@ -229,9 +229,8 @@ func (itr *Iterator) seekStringKey(manifest *Manifest, key string) error { currentIndex: i + 1, } itr.manifestStack = append(itr.manifestStack, manifestState) - var childManifest *Manifest - if itr.index.mutable { + if itr.index.mutable || entry.Manifest == nil { // now load the child Manifest and re-seek cf, err := itr.index.loadManifest(manifest.Name + entry.Name) if err != nil { diff --git a/pkg/collection/kv.go b/pkg/collection/kv.go index 94bac044..8dbc46c9 100644 --- a/pkg/collection/kv.go +++ b/pkg/collection/kv.go @@ -56,6 +56,11 @@ type KVTable struct { columns []string } +type KVCount struct { + Count uint64 `json:"count"` + TableName string `json:"table_name"` +} + // NewKeyValueStore is the main object used to do all operation on the key value tables. func NewKeyValueStore(podName string, fd *feed.API, ai *account.Info, user utils.Address, client blockstore.Client, logger logging.Logger) *KeyValue { return &KeyValue{ @@ -169,17 +174,31 @@ func (kv *KeyValue) OpenKVTable(name string) error { } // KVCount counts the number of entries in the given key value table. -func (kv *KeyValue) KVCount(name string) (uint64, error) { +func (kv *KeyValue) KVCount(name string) (*KVCount, error) { kv.openKVTMu.Lock() defer kv.openKVTMu.Unlock() if table, ok := kv.openKVTables[name]; ok { - return table.index.CountIndex() + count, err := table.index.CountIndex() + if err != nil { + return nil, err + } + return &KVCount{ + Count: count, + TableName: name, + }, nil } else { idx, err := OpenIndex(kv.podName, defaultCollectionName, name, kv.fd, kv.ai, kv.user, kv.client, kv.logger) if err != nil { - return 0, err + return nil, err } - return idx.CountIndex() + count, err := idx.CountIndex() + if err != nil { + return nil, err + } + return &KVCount{ + Count: count, + TableName: name, + }, nil } } @@ -385,7 +404,11 @@ func (kv *KeyValue) storeKVTables(collections map[string][]string) error { } } topic := utils.HashString(kvFile) - _, err := kv.fd.UpdateFeed(topic, kv.user, buf.Bytes()) + data := buf.Bytes() + if buf.Len() == 0 { + data = []byte(utils.DeletedFeedMagicWord) + } + _, err := kv.fd.UpdateFeed(topic, kv.user, data) if err != nil { return err } diff --git a/pkg/dfs/fs_api.go b/pkg/dfs/fs_api.go index e8b0f832..b74f47ae 100644 --- a/pkg/dfs/fs_api.go +++ b/pkg/dfs/fs_api.go @@ -23,6 +23,7 @@ import ( "github.com/fairdatasociety/fairOS-dfs/pkg/dir" f "github.com/fairdatasociety/fairOS-dfs/pkg/file" + "github.com/fairdatasociety/fairOS-dfs/pkg/pod" "github.com/fairdatasociety/fairOS-dfs/pkg/user" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) @@ -126,6 +127,12 @@ func (d *DfsAPI) ListDir(podName, currentDir, sessionId string) ([]dir.Entry, [] return nil, nil, err } directory := podInfo.GetDirectory() + + // check if directory present + totalPath := utils.CombinePathAndFile(podName, currentDir, "") + if directory.GetDirFromDirectoryMap(totalPath) == nil { + return nil, nil, dir.ErrDirectoryNotPresent + } dEntries, fileList, err := directory.ListDir(currentDir) if err != nil { return nil, nil, err @@ -194,6 +201,9 @@ func (d *DfsAPI) DeleteFile(podName, podFileWithPath, sessionId string) error { file := podInfo.GetFile() err = file.RmFile(podFileWithPath) if err != nil { + if err == f.ErrDeletedFeed { + return pod.ErrInvalidFile + } return err } @@ -249,6 +259,24 @@ func (d *DfsAPI) UploadFile(podName, podFileName, sessionId string, fileSize int } file := podInfo.GetFile() directory := podInfo.GetDirectory() + + // check if file exists, then backup the file + totalPath := utils.CombinePathAndFile(podName, podPath, podFileName) + if file.IsFileAlreadyPresent(totalPath) { + m, err := file.BackupFromFileName(totalPath) + if err != nil { + return err + } + err = directory.AddEntryToDir(podPath, m.Name, true) + if err != nil { + return err + } + err = directory.RemoveEntryFromDir(podPath, podFileName, true) + if err != nil { + return err + } + } + err = file.Upload(fd, podFileName, fileSize, blockSize, podPath, compression) if err != nil { return err diff --git a/pkg/dfs/kv_api.go b/pkg/dfs/kv_api.go index fc5fe1e6..865614c9 100644 --- a/pkg/dfs/kv_api.go +++ b/pkg/dfs/kv_api.go @@ -104,21 +104,21 @@ func (d *DfsAPI) KVList(sessionId, podName string) (map[string][]string, error) } // KVCount does validation checks and calls the count KVtable function. -func (d *DfsAPI) KVCount(sessionId, podName, name string) (uint64, error) { +func (d *DfsAPI) KVCount(sessionId, podName, name string) (*collection.KVCount, error) { // get the logged in user information ui := d.users.GetLoggedInUserInfo(sessionId) if ui == nil { - return 0, ErrUserNotLoggedIn + return nil, ErrUserNotLoggedIn } // check if pod open if !ui.IsPodOpen(podName) { - return 0, ErrPodNotOpen + return nil, ErrPodNotOpen } podInfo, err := ui.GetPod().GetPodInfoFromPodMap(podName) if err != nil { - return 0, err + return nil, err } return podInfo.GetKVStore().KVCount(name) diff --git a/pkg/dfs/pod_api.go b/pkg/dfs/pod_api.go index b0be468a..89ff4203 100644 --- a/pkg/dfs/pod_api.go +++ b/pkg/dfs/pod_api.go @@ -17,6 +17,8 @@ limitations under the License. package dfs import ( + "fmt" + "github.com/fairdatasociety/fairOS-dfs/pkg/pod" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) @@ -27,21 +29,20 @@ func (d *DfsAPI) CreatePod(podName, passPhrase, sessionId string) (*pod.Info, er if ui == nil { return nil, ErrUserNotLoggedIn } - // create the pod - pi, err := ui.GetPod().CreatePod(podName, passPhrase, "") + _, err := ui.GetPod().CreatePod(podName, passPhrase, "") if err != nil { return nil, err } // open the pod - _, err = ui.GetPod().OpenPod(podName, passPhrase) + pi, err := ui.GetPod().OpenPod(podName, passPhrase) if err != nil { return nil, err } // create the root directory - err = ui.GetUserDirectory().MkRootDir(pi.GetPodName(), pi.GetPodAddress(), pi.GetFeed()) + err = pi.GetDirectory().MkRootDir(pi.GetPodName(), pi.GetPodAddress(), pi.GetFeed()) if err != nil { return nil, err } @@ -51,21 +52,54 @@ func (d *DfsAPI) CreatePod(podName, passPhrase, sessionId string) (*pod.Info, er return pi, nil } -func (d *DfsAPI) DeletePod(podName, sessionId string) error { +func (d *DfsAPI) DeletePod(podName, passphrase, sessionId string) error { // get the logged in user information ui := d.users.GetLoggedInUserInfo(sessionId) if ui == nil { return ErrUserNotLoggedIn } - // delete the pod and close if it is opened - err := ui.GetPod().DeletePod(podName) + // check for valid password + acc := ui.GetAccount() + if !acc.Authorise(passphrase) { + return fmt.Errorf("invalid password") + } + + // delete all the directory, files, and database tables under this pod from + // the Swarm network. + podInfo, err := ui.GetPod().GetPodInfoFromPodMap(podName) if err != nil { return err } + directory := podInfo.GetDirectory() - // TODO: delete all the directory, files, and database tables under this pod from - // the Swarm network. + // check if this is a shared pod + if podInfo.GetFeed().IsReadOnlyFeed() { + // delete the pod and close if it is opened + err = ui.GetPod().DeleteSharedPod(podName) + if err != nil { + return err + } + + // close the pod if it is open + if ui.IsPodOpen(podName) { + // remove from the login session + ui.RemovePodName(podName) + } + + return nil + } + + err = directory.RmRootDir() + if err != nil { + return err + } + + // delete the pod and close if it is opened + err = ui.GetPod().DeleteOwnPod(podName) + if err != nil { + return err + } // close the pod if it is open if ui.IsPodOpen(podName) { @@ -82,7 +116,6 @@ func (d *DfsAPI) OpenPod(podName, passPhrase, sessionId string) (*pod.Info, erro if ui == nil { return nil, ErrUserNotLoggedIn } - // return if pod already open if ui.IsPodOpen(podName) { return nil, ErrPodAlreadyOpen diff --git a/pkg/dir/dir_present.go b/pkg/dir/dir_present.go index c6445507..29e1f0a2 100644 --- a/pkg/dir/dir_present.go +++ b/pkg/dir/dir_present.go @@ -23,6 +23,9 @@ import ( // IsDirectoryPresent this function check if a given directory is present inside the pod. func (d *Directory) IsDirectoryPresent(directoryNameWithPath string) bool { topic := utils.HashString(directoryNameWithPath) - _, _, err := d.fd.GetFeedData(topic, d.userAddress) + _, metaBytes, err := d.fd.GetFeedData(topic, d.userAddress) + if string(metaBytes) == utils.DeletedFeedMagicWord { + return false + } return err == nil } diff --git a/pkg/dir/inode.go b/pkg/dir/inode.go index 912856ea..f45705d5 100644 --- a/pkg/dir/inode.go +++ b/pkg/dir/inode.go @@ -16,11 +16,22 @@ limitations under the License. package dir +import ( + "encoding/json" + "errors" + + "github.com/fairdatasociety/fairOS-dfs/pkg/utils" +) + type Inode struct { Meta *MetaData FileOrDirNames []string } +var ( + ErrResourceDeleted = errors.New("resource was deleted") +) + func (in *Inode) GetMeta() *MetaData { return in.Meta } @@ -32,3 +43,14 @@ func (in *Inode) GetFileOrDirNames() []string { func (in *Inode) SetFileOrDirNames(fileOrDirNames []string) { in.FileOrDirNames = fileOrDirNames } + +func (in *Inode) Unmarshal(data []byte) error { + if string(data) == utils.DeletedFeedMagicWord { + return ErrResourceDeleted + } + err := json.Unmarshal(data, in) + if err != nil { + return err + } + return nil +} diff --git a/pkg/dir/ls.go b/pkg/dir/ls.go index 87b82585..012cf10e 100644 --- a/pkg/dir/ls.go +++ b/pkg/dir/ls.go @@ -53,7 +53,7 @@ func (d *Directory) ListDir(dirNameWithPath string) ([]Entry, []string, error) { } var dirInode Inode - err = json.Unmarshal(data, &dirInode) + err = dirInode.Unmarshal(data) if err != nil { return nil, nil, fmt.Errorf("list dir : %v", err) } diff --git a/pkg/dir/mkdir.go b/pkg/dir/mkdir.go index 1563ee4a..fa020a50 100644 --- a/pkg/dir/mkdir.go +++ b/pkg/dir/mkdir.go @@ -46,8 +46,13 @@ func (d *Directory) MkDir(dirToCreateWithPath string) error { // check if directory already present totalPath := utils.CombinePathAndFile(d.podName, parentPath, dirName) topic := utils.HashString(totalPath) - addr, data, err := d.fd.GetFeedData(topic, d.userAddress) - if err == nil && addr != nil && data != nil { + + // check if parent path exists + if d.GetDirFromDirectoryMap(parentPath) == nil { + return ErrDirectoryNotPresent + } + + if d.GetDirFromDirectoryMap(totalPath) != nil { return ErrDirectoryAlreadyPresent } @@ -64,16 +69,25 @@ func (d *Directory) MkDir(dirToCreateWithPath string) error { dirInode := &Inode{ Meta: &meta, } - data, err = json.Marshal(dirInode) + data, err := json.Marshal(dirInode) if err != nil { return err } // upload the metadata as blob - _, err = d.fd.CreateFeed(topic, d.userAddress, data) - if err != nil { - return err + previousAddr, _, err := d.fd.GetFeedData(topic, d.userAddress) + if err == nil && previousAddr != nil { + _, err = d.fd.UpdateFeed(topic, d.userAddress, data) + if err != nil { + return err + } + } else { + _, err = d.fd.CreateFeed(topic, d.userAddress, data) + if err != nil { + return err + } } + d.AddToDirectoryMap(totalPath, dirInode) // get the parent directory entry and add this new directory to its list of children @@ -126,9 +140,17 @@ func (d *Directory) MkRootDir(podName string, podAddress utils.Address, fd *feed } parentPath := utils.CombinePathAndFile(podName, utils.PathSeperator, "") parentHash := utils.HashString(parentPath) - _, err = fd.CreateFeed(parentHash, podAddress, parentData) - if err != nil { - return err + addr, data, err := d.fd.GetFeedData(parentHash, d.userAddress) + if err == nil && addr != nil && data != nil { + _, err = fd.UpdateFeed(parentHash, podAddress, parentData) + if err != nil { + return err + } + } else { + _, err = fd.CreateFeed(parentHash, podAddress, parentData) + if err != nil { + return err + } } d.AddToDirectoryMap(utils.PathSeperator, parentDirInode) return nil @@ -141,11 +163,11 @@ func (d *Directory) AddRootDir(podName string, podAddress utils.Address, fd *fee if err != nil { return err } - var parentDirInode *Inode - err = json.Unmarshal(parentDataBytes, &parentDirInode) + var parentDirInode Inode + err = parentDirInode.Unmarshal(parentDataBytes) if err != nil { return err } - d.AddToDirectoryMap(utils.PathSeperator, parentDirInode) + d.AddToDirectoryMap(utils.PathSeperator, &parentDirInode) return nil } diff --git a/pkg/dir/mkdir_test.go b/pkg/dir/mkdir_test.go index bb70b258..a29a6f5e 100644 --- a/pkg/dir/mkdir_test.go +++ b/pkg/dir/mkdir_test.go @@ -70,4 +70,57 @@ func TestMkdir(t *testing.T) { t.Fatalf("invalid directory name") } }) + t.Run("complicated-mkdir", func(t *testing.T) { + dirObject := dir.NewDirectory("pod1", mockClient, fd, user, mockFile, logger) + + // make root dir so that other directories can be added + err = dirObject.MkRootDir("pod1", user, fd) + if err != nil { + t.Fatal(err) + } + + // try to create a new dir without creating root + err := dirObject.MkDir("/baseDir/baseDir2/baseDir3/baseDir4") + if err == nil || err != dir.ErrDirectoryNotPresent { + t.Fatal(err) + } + + err = dirObject.MkDir("/baseDir") + if err != nil { + t.Fatal(err) + } + + err = dirObject.MkDir("/baseDir/baseDir2") + if err != nil { + t.Fatal(err) + } + + err = dirObject.MkDir("/baseDir/baseDir2/baseDir3") + if err != nil { + t.Fatal(err) + } + + // validate dir + dirs, _, err := dirObject.ListDir("/baseDir") + if err != nil { + t.Fatal(err) + } + if len(dirs) != 1 { + t.Fatalf("invalid directory count") + } + if dirs[0].Name != "baseDir2" { + t.Fatalf("invalid directory name") + } + + dirs, _, err = dirObject.ListDir("/baseDir/baseDir2") + if err != nil { + t.Fatal(err) + } + if len(dirs) != 1 { + t.Fatalf("invalid directory count") + } + if dirs[0].Name != "baseDir3" { + t.Fatalf("invalid directory name") + } + }) } diff --git a/pkg/dir/rmdir.go b/pkg/dir/rmdir.go index 031dfe63..f20eb237 100644 --- a/pkg/dir/rmdir.go +++ b/pkg/dir/rmdir.go @@ -18,6 +18,7 @@ package dir import ( "path/filepath" + "strings" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) @@ -35,26 +36,107 @@ func (d *Directory) RmDir(directoryNameWithPath string) error { } // check if directory present - totalPath := utils.CombinePathAndFile(d.podName, parentPath, dirToDelete) + var totalPath string + if parentPath == "/" && dirToDelete == "/" { + totalPath = utils.CombinePathAndFile(d.podName, parentPath, "") + } else { + totalPath = utils.CombinePathAndFile(d.podName, parentPath, dirToDelete) + + } if d.GetDirFromDirectoryMap(totalPath) == nil { return ErrDirectoryNotPresent } - // return if the directory is not empty - // TODO: in future do a recursive delete + // recursive delete dirInode := d.GetDirFromDirectoryMap(totalPath) if dirInode.FileOrDirNames != nil && len(dirInode.FileOrDirNames) > 0 { - return ErrDirectoryNotEmpty + for _, fileOrDirName := range dirInode.FileOrDirNames { + if strings.HasPrefix(fileOrDirName, "_F_") { + fileName := strings.TrimPrefix(fileOrDirName, "_F_") + filePath := utils.CombinePathAndFile(d.podName, directoryNameWithPath, fileName) + err := d.file.RmFile(filePath) + if err != nil { + return err + } + err = d.RemoveEntryFromDir(directoryNameWithPath, fileName, true) + if err != nil { + return err + } + } else if strings.HasPrefix(fileOrDirName, "_D_") { + dirName := strings.TrimPrefix(fileOrDirName, "_D_") + path := utils.CombinePathAndFile(d.podName, directoryNameWithPath, dirName) + d.logger.Infof(directoryNameWithPath) + + err := d.RmDir(path) + if err != nil { + return err + } + } + } } // remove the feed and clear the data structure topic := utils.HashString(totalPath) - err := d.fd.DeleteFeed(topic, d.userAddress) + _, err := d.fd.UpdateFeed(topic, d.userAddress, []byte(utils.DeletedFeedMagicWord)) if err != nil { return err } d.RemoveFromDirectoryMap(totalPath) + // return if root directory + if parentPath == "/" && dirToDelete == "/" { + return nil + } // remove the directory entry from the parent dir return d.RemoveEntryFromDir(parentPath, dirToDelete, false) } + +// RmRootDir removes root directory and all the entries (file/directory) under that. +func (d *Directory) RmRootDir() error { + dirToDelete := filepath.Base("/") + + // check if directory present + var totalPath = utils.CombinePathAndFile(d.podName, dirToDelete, "") + + if d.GetDirFromDirectoryMap(totalPath) == nil { + return ErrDirectoryNotPresent + } + + // recursive delete + dirInode := d.GetDirFromDirectoryMap(totalPath) + if dirInode.FileOrDirNames != nil && len(dirInode.FileOrDirNames) > 0 { + for _, fileOrDirName := range dirInode.FileOrDirNames { + if strings.HasPrefix(fileOrDirName, "_F_") { + fileName := strings.TrimPrefix(fileOrDirName, "_F_") + filePath := utils.CombinePathAndFile(d.podName, dirToDelete, fileName) + err := d.file.RmFile(filePath) + if err != nil { + return err + } + err = d.RemoveEntryFromDir(dirToDelete, fileName, true) + if err != nil { + return err + } + } else if strings.HasPrefix(fileOrDirName, "_D_") { + dirName := strings.TrimPrefix(fileOrDirName, "_D_") + path := utils.CombinePathAndFile(d.podName, dirToDelete, dirName) + d.logger.Infof(dirToDelete) + + err := d.RmDir(path) + if err != nil { + return err + } + } + } + } + + // remove the feed and clear the data structure + topic := utils.HashString(totalPath) + _, err := d.fd.UpdateFeed(topic, d.userAddress, []byte(utils.DeletedFeedMagicWord)) + if err != nil { + return err + } + d.RemoveFromDirectoryMap(totalPath) + + return nil +} diff --git a/pkg/dir/rmdir_test.go b/pkg/dir/rmdir_test.go index 18c56bba..11942e0c 100644 --- a/pkg/dir/rmdir_test.go +++ b/pkg/dir/rmdir_test.go @@ -18,6 +18,7 @@ package dir_test import ( "io/ioutil" + "strings" "testing" "github.com/fairdatasociety/fairOS-dfs/pkg/account" @@ -59,23 +60,147 @@ func TestRmdir(t *testing.T) { t.Fatal(err) } + // now delete the directory + err = dirObject.RmDir("/dirToRemove") + if err != nil { + t.Fatal(err) + } + + // verify if the directory is actually removed + dirEntry, _, err := dirObject.ListDir("/") + if err != nil { + t.Fatal(err) + } + if dirEntry != nil { + t.Fatalf("could not delete directory") + } + }) + t.Run("nested-rmdir", func(t *testing.T) { + dirObject := dir.NewDirectory("pod1", mockClient, fd, user, mockFile, logger) + // make root dir so that other directories can be added err = dirObject.MkRootDir("pod1", user, fd) if err != nil { t.Fatal(err) } + // create a new dir + err := dirObject.MkDir("/dirToRemove1") + if err != nil { + t.Fatal(err) + } + // create a new dir + err = dirObject.MkDir("/dirToRemove1/dirToRemove2") + if err != nil { + t.Fatal(err) + } + // create a new dir + err = dirObject.MkDir("/dirToRemove1/dirToRemove2/dirToRemove") + if err != nil { + t.Fatal(err) + } + + // make sure directories were created + dirEntry, _, err := dirObject.ListDir("/dirToRemove1") + if err != nil { + t.Fatal(err) + } + if dirEntry == nil { + t.Fatal("nested directory \"/dirToRemove1/dirToRemove2\" was not created") + } + dirEntry, _, err = dirObject.ListDir("/dirToRemove1/dirToRemove2") + if err != nil { + t.Fatal(err) + } + if dirEntry == nil { + t.Fatal("nested directory \"/dirToRemove1/dirToRemove2/dirToRemove\" was not created") + } + // now delete the directory - err = dirObject.RmDir("/dirToRemove") + err = dirObject.RmDir("/dirToRemove1") if err != nil { t.Fatal(err) } // verify if the directory is actually removed - dirEntry, _, err := dirObject.ListDir("/") + dirEntry, _, err = dirObject.ListDir("/") + if err != nil { + t.Fatal(err) + } + if dirEntry != nil { + t.Fatalf("could not delete directory") + } + }) +} + +func TestRmRootDir(t *testing.T) { + mockClient := bm.NewMockBeeClient() + logger := logging.New(ioutil.Discard, 0) + acc := account.New(logger) + _, _, err := acc.CreateUserAccount("password", "") + if err != nil { + t.Fatal(err) + } + pod1AccountInfo, err := acc.CreatePodAccount(1, "password", false) + if err != nil { + t.Fatal(err) + } + fd := feed.New(pod1AccountInfo, mockClient, logger) + user := acc.GetAddress(1) + mockFile := fm.NewMockFile() + + t.Run("rmrootdir", func(t *testing.T) { + dirObject := dir.NewDirectory("pod1", mockClient, fd, user, mockFile, logger) + + // make root dir so that other directories can be added + err = dirObject.MkRootDir("pod1", user, fd) + if err != nil { + t.Fatal(err) + } + + // create a new dir + err := dirObject.MkDir("/dirToRemove1") if err != nil { t.Fatal(err) } + // create a new dir + err = dirObject.MkDir("/dirToRemove1/dirToRemove2") + if err != nil { + t.Fatal(err) + } + // create a new dir + err = dirObject.MkDir("/dirToRemove1/dirToRemove2/dirToRemove") + if err != nil { + t.Fatal(err) + } + + // make sure directories were created + dirEntry, _, err := dirObject.ListDir("/dirToRemove1") + if err != nil { + t.Fatal(err) + } + if dirEntry == nil { + t.Fatal("nested directory \"/dirToRemove1/dirToRemove2\" was not created") + } + dirEntry, _, err = dirObject.ListDir("/dirToRemove1/dirToRemove2") + if err != nil { + t.Fatal(err) + } + if dirEntry == nil { + t.Fatal("nested directory \"/dirToRemove1/dirToRemove2/dirToRemove\" was not created") + } + + // now delete the root directory + err = dirObject.RmRootDir() + if err != nil { + t.Fatal(err) + } + + // verify if the directory is actually removed + dirEntry, _, err = dirObject.ListDir("/") + if !strings.HasSuffix(err.Error(), dir.ErrResourceDeleted.Error()) { + t.Fatal("root directory was not deleted") + } if dirEntry != nil { t.Fatalf("could not delete directory") } diff --git a/pkg/dir/stat.go b/pkg/dir/stat.go index 916f3492..629645ee 100644 --- a/pkg/dir/stat.go +++ b/pkg/dir/stat.go @@ -43,6 +43,9 @@ func (d *Directory) DirStat(podName, dirNameWithPath string) (*DirStats, error) if err != nil { return nil, fmt.Errorf("dir stat: %v", err) } + if string(data) == utils.DeletedFeedMagicWord { + return nil, ErrDirectoryNotPresent + } var dirInode Inode err = json.Unmarshal(data, &dirInode) @@ -50,8 +53,8 @@ func (d *Directory) DirStat(podName, dirNameWithPath string) (*DirStats, error) return nil, fmt.Errorf("dir stat: %v", err) } - if dirInode.Meta == nil || dirInode.FileOrDirNames == nil { - return nil, fmt.Errorf("dir stat: directory not found") + if dirInode.Meta == nil && dirInode.FileOrDirNames == nil { + return nil, ErrDirectoryNotPresent } files := 0 diff --git a/pkg/dir/sync.go b/pkg/dir/sync.go index c652125f..ed6394d1 100644 --- a/pkg/dir/sync.go +++ b/pkg/dir/sync.go @@ -17,8 +17,6 @@ limitations under the License. package dir import ( - "encoding/json" - "fmt" "strings" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" @@ -32,13 +30,13 @@ func (d *Directory) SyncDirectory(dirNameWithPath string) error { return nil // pod is empty } - var dirInode *Inode - err = json.Unmarshal(data, &dirInode) + var dirInode Inode + err = dirInode.Unmarshal(data) if err != nil { - return fmt.Errorf("dir sync: %v", err) + d.logger.Errorf("dir sync: %v", err) + return err } - d.AddToDirectoryMap(dirNameWithPath, dirInode) - + d.AddToDirectoryMap(dirNameWithPath, &dirInode) for _, fileOrDirName := range dirInode.FileOrDirNames { if strings.HasPrefix(fileOrDirName, "_F_") { fileName := strings.TrimPrefix(fileOrDirName, "_F_") diff --git a/pkg/feed/lookup/epoch.go b/pkg/feed/lookup/epoch.go index a604938f..0237b646 100644 --- a/pkg/feed/lookup/epoch.go +++ b/pkg/feed/lookup/epoch.go @@ -62,7 +62,7 @@ func (e *Epoch) MarshalBinary() (data []byte, err error) { // UnmarshalBinary implements the encoding.BinaryUnmarshaller interface func (e *Epoch) UnmarshalBinary(data []byte) error { if len(data) != EpochLength { - return errors.New("Invalid data unmarshalling Epoch") + return errors.New("invalid data unmarshalling Epoch") } b := make([]byte, 8) copy(b, data) diff --git a/pkg/feed/timestampprovider.go b/pkg/feed/timestampprovider.go index fb60cea9..0b9eea2f 100644 --- a/pkg/feed/timestampprovider.go +++ b/pkg/feed/timestampprovider.go @@ -55,7 +55,7 @@ func NewDefaultTimestampProvider() *DefaultTimestampProvider { } // Now returns the current time according to this provider -func (dtp *DefaultTimestampProvider) Now() Timestamp { +func (*DefaultTimestampProvider) Now() Timestamp { return Timestamp{ Time: uint64(time.Now().Unix()), } diff --git a/pkg/file/download.go b/pkg/file/download.go index 0cfd526f..5ebd0b63 100644 --- a/pkg/file/download.go +++ b/pkg/file/download.go @@ -18,25 +18,30 @@ package file import ( "encoding/json" - "fmt" + "errors" "io" "time" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) +var ( + ErrFileNotPresent = errors.New("file not present") + ErrFileNotFound = errors.New("file not found in dfs") +) + // Download does all the validation for the existence of the file and creates a // Reader to read the contents of the file from the pod. func (f *File) Download(podFileWithPath string) (io.ReadCloser, uint64, error) { // check if file present totalFilePath := utils.CombinePathAndFile(f.podName, podFileWithPath, "") if !f.IsFileAlreadyPresent(totalFilePath) { - return nil, 0, fmt.Errorf("file not present") + return nil, 0, ErrFileNotPresent } meta := f.GetFromFileMap(totalFilePath) if meta == nil { - return nil, 0, fmt.Errorf("file not found in dfs") + return nil, 0, ErrFileNotFound } fileInodeBytes, _, err := f.getClient().DownloadBlob(meta.InodeAddress) @@ -49,11 +54,13 @@ func (f *File) Download(podFileWithPath string) (io.ReadCloser, uint64, error) { return nil, 0, err } - //need to change the access time for podFile - meta.AccessTime = time.Now().Unix() - err = f.updateMeta(meta) - if err != nil { - return nil, 0, err + //need to change the access time for podFile if it is owned by user + if !f.fd.IsReadOnlyFeed() { + meta.AccessTime = time.Now().Unix() + err = f.updateMeta(meta) + if err != nil { + return nil, 0, err + } } reader := NewReader(fileInode, f.getClient(), meta.Size, meta.BlockSize, meta.Compression, false) diff --git a/pkg/file/meta.go b/pkg/file/meta.go index c83c6b9a..0b78a29d 100644 --- a/pkg/file/meta.go +++ b/pkg/file/meta.go @@ -18,12 +18,17 @@ package file import ( "encoding/json" + "errors" + "fmt" + "time" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) var ( MetaVersion uint8 = 1 + + ErrDeletedFeed = errors.New("deleted feed") ) type MetaData struct { @@ -46,6 +51,9 @@ type MetaData struct { func (f *File) LoadFileMeta(fileNameWithPath string) error { meta, err := f.GetMetaFromFileName(fileNameWithPath, f.userAddress) if err != nil { + if err == ErrDeletedFeed { + return nil + } return err } f.AddToFileMap(fileNameWithPath, meta) @@ -53,6 +61,18 @@ func (f *File) LoadFileMeta(fileNameWithPath string) error { return nil } +func (f *File) handleMeta(meta *MetaData) error { + // check if meta is present. + totalPath := utils.CombinePathAndFile(f.podName, meta.Path, meta.Name) + _, err := f.GetMetaFromFileName(totalPath, meta.UserAddress) + if err != nil { + if err != ErrDeletedFeed { + return f.uploadMeta(meta) + } + } + return f.updateMeta(meta) +} + func (f *File) uploadMeta(meta *MetaData) error { // marshall the meta structure fileMetaBytes, err := json.Marshal(meta) @@ -71,6 +91,12 @@ func (f *File) uploadMeta(meta *MetaData) error { return nil } +func (f *File) deleteMeta(meta *MetaData) error { + totalPath := utils.CombinePathAndFile(f.podName, meta.Path, meta.Name) + topic := utils.HashString(totalPath) + return f.fd.DeleteFeed(topic, meta.UserAddress) +} + func (f *File) updateMeta(meta *MetaData) error { // marshall the meta structure fileMetaBytes, err := json.Marshal(meta) @@ -89,6 +115,32 @@ func (f *File) updateMeta(meta *MetaData) error { return nil } +func (f *File) BackupFromFileName(fileNameWithPath string) (*MetaData, error) { + p, err := f.GetMetaFromFileName(fileNameWithPath, f.userAddress) + if err != nil { + return nil, err + } + + err = f.deleteMeta(p) + if err != nil { + return nil, err + } + + // change previous meta.Name + p.Name = fmt.Sprintf("%d_%s", time.Now().Unix(), p.Name) + p.ModificationTime = time.Now().Unix() + + // upload PreviousMeta + err = f.uploadMeta(p) + if err != nil { + return nil, err + } + + // add file to map + f.AddToFileMap(utils.CombinePathAndFile(f.podName, p.Path, p.Name), p) + return p, nil +} + func (f *File) GetMetaFromFileName(fileNameWithPath string, userAddress utils.Address) (*MetaData, error) { topic := utils.HashString(fileNameWithPath) _, metaBytes, err := f.fd.GetFeedData(topic, userAddress) @@ -96,6 +148,10 @@ func (f *File) GetMetaFromFileName(fileNameWithPath string, userAddress utils.Ad return nil, err } + if string(metaBytes) == utils.DeletedFeedMagicWord { + return nil, ErrDeletedFeed + } + var meta *MetaData err = json.Unmarshal(metaBytes, &meta) if err != nil { diff --git a/pkg/file/mock/mock_file.go b/pkg/file/mock/mock_file.go index 2bf5f514..5a4c098d 100644 --- a/pkg/file/mock/mock_file.go +++ b/pkg/file/mock/mock_file.go @@ -29,34 +29,34 @@ func NewMockFile() *MockFile { return &MockFile{} } -func (mf *MockFile) Upload(fd io.Reader, podFileName string, fileSize int64, blockSize uint32, podPath, compression string) error { +func (*MockFile) Upload(_ io.Reader, _ string, _ int64, _ uint32, _, _ string) error { return nil } -func (mf *MockFile) Download(podFileWithPath string) (io.ReadCloser, uint64, error) { +func (*MockFile) Download(_ string) (io.ReadCloser, uint64, error) { return nil, 0, nil } -func (mf *MockFile) ListFiles(files []string) ([]file.Entry, error) { +func (*MockFile) ListFiles(_ []string) ([]file.Entry, error) { return nil, nil } -func (mf *MockFile) GetStats(podName, podFileWithPath string) (*file.Stats, error) { +func (*MockFile) GetStats(_, _ string) (*file.Stats, error) { return nil, nil } -func (mf *MockFile) RmFile(podFileWithPath string) error { +func (*MockFile) RmFile(_ string) error { return nil } -func (mf *MockFile) Read(b []byte) (n int, err error) { +func (*MockFile) Read(_ []byte) (n int, err error) { return 0, nil } -func (mf *MockFile) AddFileToPath(filePath, metaHexRef string) error { +func (*MockFile) AddFileToPath(_, _ string) error { return nil } -func (mf *MockFile) LoadFileMeta(fileNameWithPath string) error { +func (*MockFile) LoadFileMeta(_ string) error { return nil } diff --git a/pkg/file/reader_test.go b/pkg/file/reader_test.go index d8b27d58..a82452e3 100644 --- a/pkg/file/reader_test.go +++ b/pkg/file/reader_test.go @@ -348,10 +348,9 @@ func createFileWithNewlines(t *testing.T, fileSize uint64, blockSize uint32, com if !gotFirstNewLine { gotFirstNewLine = true continue - } else { - startIndex = k + 1 - borderCrossingLineStartingPoint = (int(blockSize) * int(i)) + startIndex } + startIndex = k + 1 + borderCrossingLineStartingPoint = (int(blockSize) * int(i)) + startIndex } } borderCrossingLine = append(borderCrossingLine, buf[startIndex:]...) diff --git a/pkg/file/rm_test.go b/pkg/file/rm_test.go index c01d1c05..fab63494 100644 --- a/pkg/file/rm_test.go +++ b/pkg/file/rm_test.go @@ -79,4 +79,28 @@ func TestRemoveFile(t *testing.T) { t.Fatalf("retrieved invalid file name") } }) + + t.Run("delete-file-in-loop", func(t *testing.T) { + fileObject := file.NewFile("pod1", mockClient, fd, user, logger) + + for i := 0; i < 80; i++ { + // upload file1 + _, err = uploadFile(t, fileObject, "/dir1", "file1", "", 100, 10) + if err != nil { + t.Fatal(err) + } + + // remove file1 + err = fileObject.RmFile("/dir1/file1") + if err != nil { + t.Fatal(err) + } + + // validate file deletion + meta := fileObject.GetFromFileMap(utils.CombinePathAndFile("pod1", "/dir1", "file1")) + if meta != nil { + t.Fatalf("file is not removed") + } + } + }) } diff --git a/pkg/file/upload.go b/pkg/file/upload.go index b4b145d9..bbd1780c 100644 --- a/pkg/file/upload.go +++ b/pkg/file/upload.go @@ -36,9 +36,9 @@ var ( NoOfParallelWorkers = runtime.NumCPU() ) -// Upload uploads a given blob of bytes as a file in the pod. It also splits the file in to number of blocks. the -// size of the block is preovided during upload. This function also des compression of the blocks gzip/snappy if it is -// requsted during the upload. +// Upload uploads a given blob of bytes as a file in the pod. It also splits the file into number of blocks. the +// size of the block is provided during upload. This function also does compression of the blocks gzip/snappy if it is +// requested during the upload. func (f *File) Upload(fd io.Reader, podFileName string, fileSize int64, blockSize uint32, podPath, compression string) error { reader := bufio.NewReader(fd) now := time.Now().Unix() @@ -75,9 +75,8 @@ func (f *File) Upload(fd io.Reader, podFileName string, fileSize int64, blockSiz return fmt.Errorf("invalid file length of file data received") } break - } else { - return err } + return err } // determine the content type from the first 512 bytes of the file @@ -160,7 +159,7 @@ func (f *File) Upload(fd io.Reader, podFileName string, fileSize int64, blockSiz } meta.InodeAddress = addr - err = f.uploadMeta(&meta) + err = f.handleMeta(&meta) if err != nil { return err } @@ -168,7 +167,7 @@ func (f *File) Upload(fd io.Reader, podFileName string, fileSize int64, blockSiz return nil } -func (f *File) getContentType(bufferReader *bufio.Reader) string { +func (*File) getContentType(bufferReader *bufio.Reader) string { buffer, err := bufferReader.Peek(512) if err != nil && err != io.EOF { return "" diff --git a/pkg/pod/del.go b/pkg/pod/del.go index f42d126a..2d338528 100644 --- a/pkg/pod/del.go +++ b/pkg/pod/del.go @@ -21,8 +21,8 @@ import ( "strings" ) -// DeletePod removed a pod and the list of pods belonging to a user. -func (p *Pod) DeletePod(podName string) error { +// DeleteOwnPod removed a pod and the list of pods belonging to a user. +func (p *Pod) DeleteOwnPod(podName string) error { pods, sharedPods, err := p.loadUserPods() if err != nil { return err @@ -53,3 +53,32 @@ func (p *Pod) DeletePod(podName string) error { // remove the pod finally return p.storeUserPods(pods, sharedPods) } + +// DeleteSharedPod removed a pod and the list of pods shared by other users. +func (p *Pod) DeleteSharedPod(podName string) error { + pods, sharedPods, err := p.loadUserPods() + if err != nil { + return err + } + found := false + for index, pod := range sharedPods { + if strings.Trim(pod, "\n") == podName { + delete(sharedPods, index) + found = true + } + } + if !found { + return fmt.Errorf("pod not found") + } + + // remove it from other data structures + p.removePodFromPodMap(podName) + + // if last sharedPods is deleted.. something should be there to update the feed + if sharedPods == nil { + sharedPods = make(map[string]string) + } + + // remove the pod finally + return p.storeUserPods(pods, sharedPods) +} diff --git a/pkg/pod/del_test.go b/pkg/pod/del_test.go index 207821bf..c4aa2d46 100644 --- a/pkg/pod/del_test.go +++ b/pkg/pod/del_test.go @@ -59,7 +59,7 @@ func TestDelete(t *testing.T) { t.Fatalf("podName is not %s", podName1) } - err = pod1.DeletePod(podName1) + err = pod1.DeleteOwnPod(podName1) if err != nil { t.Fatal(err) } @@ -106,7 +106,7 @@ func TestDelete(t *testing.T) { t.Fatalf("podName is not %s, got %s", podName2, pods[1]) } - err = pod1.DeletePod(podName1) + err = pod1.DeleteOwnPod(podName1) if err != nil { t.Fatal(err) } diff --git a/pkg/pod/errors.go b/pkg/pod/errors.go index c36106c0..fe0f84d8 100644 --- a/pkg/pod/errors.go +++ b/pkg/pod/errors.go @@ -19,7 +19,7 @@ package pod import "errors" var ( - ErrInvalidPodName = errors.New("invalid pod name") + ErrInvalidPodName = errors.New("pod does not exist") ErrTooLongPodName = errors.New("pod name too long") ErrPodAlreadyExists = errors.New("pod already exists") ErrMaxPodsReached = errors.New("max number of pods reached") @@ -27,4 +27,5 @@ var ( ErrInvalidDirectory = errors.New("invalid directory name") ErrTooLongDirectoryName = errors.New("directory name too long") ErrReadOnlyPod = errors.New("operation not permitted: read only pod") + ErrInvalidFile = errors.New("file does not exist") ) diff --git a/pkg/pod/new.go b/pkg/pod/new.go index 602fca14..2d863292 100644 --- a/pkg/pod/new.go +++ b/pkg/pod/new.go @@ -198,7 +198,7 @@ func (p *Pod) storeUserPods(pods map[int]string, sharedPods map[string]string) e return nil } -func (p *Pod) getFreeId(pods map[int]string) (int, error) { +func (*Pod) getFreeId(pods map[int]string) (int, error) { for i := 0; i < maxPodId; i++ { if _, ok := pods[i]; !ok { if i == 0 { @@ -211,7 +211,7 @@ func (p *Pod) getFreeId(pods map[int]string) (int, error) { return 0, ErrMaxPodsReached } -func (p *Pod) checkIfPodPresent(pods map[int]string, podName string) bool { +func (*Pod) checkIfPodPresent(pods map[int]string, podName string) bool { for _, pod := range pods { if strings.Trim(pod, "\n") == podName { return true diff --git a/pkg/pod/open.go b/pkg/pod/open.go index 56ef2aa2..03f0a645 100644 --- a/pkg/pod/open.go +++ b/pkg/pod/open.go @@ -29,7 +29,7 @@ import ( "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) -// OpenPod opene a pod if it is not already opened. as part of opening the pod +// OpenPod opens a pod if it is not already opened. as part of opening the pod // it loads all the data structures related to the pod. Also it syncs all the // files and directories under this pod from the Swarm network. func (p *Pod) OpenPod(podName, passPhrase string) (*Info, error) { @@ -81,6 +81,7 @@ func (p *Pod) OpenPod(podName, passPhrase string) (*Info, error) { if err != nil { return nil, err } + fd = feed.New(accountInfo, p.client, p.logger) file = f.NewFile(podName, p.client, fd, accountInfo.GetAddress(), p.logger) dir = d.NewDirectory(podName, p.client, fd, accountInfo.GetAddress(), file, p.logger) @@ -107,14 +108,13 @@ func (p *Pod) OpenPod(podName, passPhrase string) (*Info, error) { // sync the pod's files and directories err = p.SyncPod(podName) - if err != nil { + if err != nil && err != d.ErrResourceDeleted { return nil, err } - return podInfo, nil } -func (p *Pod) getIndex(pods map[int]string, podName string) int { +func (*Pod) getIndex(pods map[int]string, podName string) int { for index, pod := range pods { if strings.Trim(pod, "\n") == podName { return index @@ -123,7 +123,7 @@ func (p *Pod) getIndex(pods map[int]string, podName string) int { return -1 } -func (p *Pod) getAddress(sharedPods map[string]string, podName string) string { +func (*Pod) getAddress(sharedPods map[string]string, podName string) string { for address, pod := range sharedPods { if strings.Trim(pod, "\n") == podName { return address diff --git a/pkg/pod/sync.go b/pkg/pod/sync.go index 22f3b20d..2af29d92 100644 --- a/pkg/pod/sync.go +++ b/pkg/pod/sync.go @@ -16,7 +16,7 @@ limitations under the License. package pod -// SyncPod syncs the pod to the latest version by extracting the current meta information of +// SyncPod syncs the pod to the latest version by extracting the current meta information // of files and directories of the pod. func (p *Pod) SyncPod(podName string) error { podName, err := CleanPodName(podName) @@ -38,5 +38,6 @@ func (p *Pod) SyncPod(podName string) error { if err != nil { return err } + return nil } diff --git a/pkg/pod/utils.go b/pkg/pod/utils.go index 49e4ece5..0fd1e257 100644 --- a/pkg/pod/utils.go +++ b/pkg/pod/utils.go @@ -33,14 +33,14 @@ func (p *Pod) IsPodOpened(podName string) bool { return false } -func (p *Pod) GetPath(inode *d.Inode) string { +func (*Pod) GetPath(inode *d.Inode) string { if inode != nil { return inode.Meta.Path } return "" } -func (p *Pod) GetName(inode *d.Inode) string { +func (*Pod) GetName(inode *d.Inode) string { if inode != nil { return inode.Meta.Name } diff --git a/pkg/user/name_address.go b/pkg/user/name_address.go index 17a4e3b9..7f7ef34c 100644 --- a/pkg/user/name_address.go +++ b/pkg/user/name_address.go @@ -28,7 +28,7 @@ const ( userDirectoryName = "user" ) -func (u *Users) isUserMappingPresent(userName, dataDir string) bool { +func (*Users) isUserMappingPresent(userName, dataDir string) bool { destDir := filepath.Join(dataDir, userDirectoryName) err := os.MkdirAll(destDir, 0700) if err != nil { @@ -42,7 +42,7 @@ func (u *Users) isUserMappingPresent(userName, dataDir string) bool { return !info.IsDir() } -func (u *Users) storeUserNameToAddressFileMapping(userName, dataDir string, address utils.Address) error { +func (*Users) storeUserNameToAddressFileMapping(userName, dataDir string, address utils.Address) error { destDir := filepath.Join(dataDir, userDirectoryName) err := os.MkdirAll(destDir, 0700) if err != nil { @@ -58,7 +58,7 @@ func (u *Users) deleteUserMapping(userName, dataDir string) error { return os.Remove(userFileName) } -func (u *Users) getAddressFromUserName(userName, dataDir string) (utils.Address, error) { +func (*Users) getAddressFromUserName(userName, dataDir string) (utils.Address, error) { destDir := filepath.Join(dataDir, userDirectoryName) userFileName := filepath.Join(destDir, userName) data, err := ioutil.ReadFile(userFileName) diff --git a/pkg/user/present.go b/pkg/user/present.go index 5ebe31da..e576a8d4 100644 --- a/pkg/user/present.go +++ b/pkg/user/present.go @@ -17,6 +17,6 @@ limitations under the License. package user // IsUsernameAvailable checks if a supplied user name is present in this dfs server. -func (u *Users) IsUsernameAvailable(userName string, dataDir string) bool { +func (u *Users) IsUsernameAvailable(userName, dataDir string) bool { return u.isUserMappingPresent(userName, dataDir) } diff --git a/pkg/user/stat.go b/pkg/user/stat.go index 9ee8c6a0..04c1eb8f 100644 --- a/pkg/user/stat.go +++ b/pkg/user/stat.go @@ -20,7 +20,7 @@ import "github.com/fairdatasociety/fairOS-dfs/pkg/account" type Stat struct { Name string `json:"user_name"` - Reference string `json:"reference"` + Reference string `json:"address"` } // GetUserStat shows the user information like user name and his address. diff --git a/pkg/user/store_mnemonic.go b/pkg/user/store_mnemonic.go index 3fa24619..cc732e69 100644 --- a/pkg/user/store_mnemonic.go +++ b/pkg/user/store_mnemonic.go @@ -22,14 +22,14 @@ import ( "github.com/fairdatasociety/fairOS-dfs/pkg/utils" ) -func (u *Users) uploadEncryptedMnemonic(userName string, address utils.Address, encryptedMnemonic string, fd *feed.API) error { +func (*Users) uploadEncryptedMnemonic(userName string, address utils.Address, encryptedMnemonic string, fd *feed.API) error { topic := utils.HashString(userName) data := []byte(encryptedMnemonic) _, err := fd.CreateFeed(topic, address, data) return err } -func (u *Users) getEncryptedMnemonic(userName string, address utils.Address, fd *feed.API) (string, error) { +func (*Users) getEncryptedMnemonic(userName string, address utils.Address, fd *feed.API) (string, error) { topic := utils.HashString(userName) _, data, err := fd.GetFeedData(topic, address) if err != nil { @@ -38,7 +38,7 @@ func (u *Users) getEncryptedMnemonic(userName string, address utils.Address, fd return string(data), nil } -func (u *Users) deleteMnemonic(userName string, address utils.Address, fd *feed.API, client blockstore.Client) error { +func (*Users) deleteMnemonic(userName string, address utils.Address, fd *feed.API, client blockstore.Client) error { topic := utils.HashString(userName) feedAddress, _, err := fd.GetFeedData(topic, address) if err != nil { diff --git a/pkg/utils/address.go b/pkg/utils/address.go index 6ba49330..f7a065a5 100644 --- a/pkg/utils/address.go +++ b/pkg/utils/address.go @@ -33,10 +33,12 @@ func NewAddress(b []byte) Address { a.SetBytes(b) return a } + func (a *Address) String() string { return hex.EncodeToString(a[:]) } -func (a *Address) ParseAddress(s string) (Address, error) { + +func (*Address) ParseAddress(s string) (Address, error) { b, err := hex.DecodeString(s) if err != nil { return ZeroAddress, err diff --git a/vendor/github.com/google/shlex/COPYING b/vendor/github.com/google/shlex/COPYING new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/google/shlex/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/google/shlex/README b/vendor/github.com/google/shlex/README new file mode 100644 index 00000000..c86bcc06 --- /dev/null +++ b/vendor/github.com/google/shlex/README @@ -0,0 +1,2 @@ +go-shlex is a simple lexer for go that supports shell-style quoting, +commenting, and escaping. diff --git a/vendor/github.com/google/shlex/go.mod b/vendor/github.com/google/shlex/go.mod new file mode 100644 index 00000000..0ab3bce7 --- /dev/null +++ b/vendor/github.com/google/shlex/go.mod @@ -0,0 +1,3 @@ +module github.com/google/shlex + +go 1.13 diff --git a/vendor/github.com/google/shlex/shlex.go b/vendor/github.com/google/shlex/shlex.go new file mode 100644 index 00000000..d98308bc --- /dev/null +++ b/vendor/github.com/google/shlex/shlex.go @@ -0,0 +1,416 @@ +/* +Copyright 2012 Google Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package shlex implements a simple lexer which splits input in to tokens using +shell-style rules for quoting and commenting. + +The basic use case uses the default ASCII lexer to split a string into sub-strings: + + shlex.Split("one \"two three\" four") -> []string{"one", "two three", "four"} + +To process a stream of strings: + + l := NewLexer(os.Stdin) + for ; token, err := l.Next(); err != nil { + // process token + } + +To access the raw token stream (which includes tokens for comments): + + t := NewTokenizer(os.Stdin) + for ; token, err := t.Next(); err != nil { + // process token + } + +*/ +package shlex + +import ( + "bufio" + "fmt" + "io" + "strings" +) + +// TokenType is a top-level token classification: A word, space, comment, unknown. +type TokenType int + +// runeTokenClass is the type of a UTF-8 character classification: A quote, space, escape. +type runeTokenClass int + +// the internal state used by the lexer state machine +type lexerState int + +// Token is a (type, value) pair representing a lexographical token. +type Token struct { + tokenType TokenType + value string +} + +// Equal reports whether tokens a, and b, are equal. +// Two tokens are equal if both their types and values are equal. A nil token can +// never be equal to another token. +func (a *Token) Equal(b *Token) bool { + if a == nil || b == nil { + return false + } + if a.tokenType != b.tokenType { + return false + } + return a.value == b.value +} + +// Named classes of UTF-8 runes +const ( + spaceRunes = " \t\r\n" + escapingQuoteRunes = `"` + nonEscapingQuoteRunes = "'" + escapeRunes = `\` + commentRunes = "#" +) + +// Classes of rune token +const ( + unknownRuneClass runeTokenClass = iota + spaceRuneClass + escapingQuoteRuneClass + nonEscapingQuoteRuneClass + escapeRuneClass + commentRuneClass + eofRuneClass +) + +// Classes of lexographic token +const ( + UnknownToken TokenType = iota + WordToken + SpaceToken + CommentToken +) + +// Lexer state machine states +const ( + startState lexerState = iota // no runes have been seen + inWordState // processing regular runes in a word + escapingState // we have just consumed an escape rune; the next rune is literal + escapingQuotedState // we have just consumed an escape rune within a quoted string + quotingEscapingState // we are within a quoted string that supports escaping ("...") + quotingState // we are within a string that does not support escaping ('...') + commentState // we are within a comment (everything following an unquoted or unescaped # +) + +// tokenClassifier is used for classifying rune characters. +type tokenClassifier map[rune]runeTokenClass + +func (typeMap tokenClassifier) addRuneClass(runes string, tokenType runeTokenClass) { + for _, runeChar := range runes { + typeMap[runeChar] = tokenType + } +} + +// newDefaultClassifier creates a new classifier for ASCII characters. +func newDefaultClassifier() tokenClassifier { + t := tokenClassifier{} + t.addRuneClass(spaceRunes, spaceRuneClass) + t.addRuneClass(escapingQuoteRunes, escapingQuoteRuneClass) + t.addRuneClass(nonEscapingQuoteRunes, nonEscapingQuoteRuneClass) + t.addRuneClass(escapeRunes, escapeRuneClass) + t.addRuneClass(commentRunes, commentRuneClass) + return t +} + +// ClassifyRune classifiees a rune +func (t tokenClassifier) ClassifyRune(runeVal rune) runeTokenClass { + return t[runeVal] +} + +// Lexer turns an input stream into a sequence of tokens. Whitespace and comments are skipped. +type Lexer Tokenizer + +// NewLexer creates a new lexer from an input stream. +func NewLexer(r io.Reader) *Lexer { + + return (*Lexer)(NewTokenizer(r)) +} + +// Next returns the next word, or an error. If there are no more words, +// the error will be io.EOF. +func (l *Lexer) Next() (string, error) { + for { + token, err := (*Tokenizer)(l).Next() + if err != nil { + return "", err + } + switch token.tokenType { + case WordToken: + return token.value, nil + case CommentToken: + // skip comments + default: + return "", fmt.Errorf("Unknown token type: %v", token.tokenType) + } + } +} + +// Tokenizer turns an input stream into a sequence of typed tokens +type Tokenizer struct { + input bufio.Reader + classifier tokenClassifier +} + +// NewTokenizer creates a new tokenizer from an input stream. +func NewTokenizer(r io.Reader) *Tokenizer { + input := bufio.NewReader(r) + classifier := newDefaultClassifier() + return &Tokenizer{ + input: *input, + classifier: classifier} +} + +// scanStream scans the stream for the next token using the internal state machine. +// It will panic if it encounters a rune which it does not know how to handle. +func (t *Tokenizer) scanStream() (*Token, error) { + state := startState + var tokenType TokenType + var value []rune + var nextRune rune + var nextRuneType runeTokenClass + var err error + + for { + nextRune, _, err = t.input.ReadRune() + nextRuneType = t.classifier.ClassifyRune(nextRune) + + if err == io.EOF { + nextRuneType = eofRuneClass + err = nil + } else if err != nil { + return nil, err + } + + switch state { + case startState: // no runes read yet + { + switch nextRuneType { + case eofRuneClass: + { + return nil, io.EOF + } + case spaceRuneClass: + { + } + case escapingQuoteRuneClass: + { + tokenType = WordToken + state = quotingEscapingState + } + case nonEscapingQuoteRuneClass: + { + tokenType = WordToken + state = quotingState + } + case escapeRuneClass: + { + tokenType = WordToken + state = escapingState + } + case commentRuneClass: + { + tokenType = CommentToken + state = commentState + } + default: + { + tokenType = WordToken + value = append(value, nextRune) + state = inWordState + } + } + } + case inWordState: // in a regular word + { + switch nextRuneType { + case eofRuneClass: + { + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + case spaceRuneClass: + { + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + case escapingQuoteRuneClass: + { + state = quotingEscapingState + } + case nonEscapingQuoteRuneClass: + { + state = quotingState + } + case escapeRuneClass: + { + state = escapingState + } + default: + { + value = append(value, nextRune) + } + } + } + case escapingState: // the rune after an escape character + { + switch nextRuneType { + case eofRuneClass: + { + err = fmt.Errorf("EOF found after escape character") + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + default: + { + state = inWordState + value = append(value, nextRune) + } + } + } + case escapingQuotedState: // the next rune after an escape character, in double quotes + { + switch nextRuneType { + case eofRuneClass: + { + err = fmt.Errorf("EOF found after escape character") + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + default: + { + state = quotingEscapingState + value = append(value, nextRune) + } + } + } + case quotingEscapingState: // in escaping double quotes + { + switch nextRuneType { + case eofRuneClass: + { + err = fmt.Errorf("EOF found when expecting closing quote") + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + case escapingQuoteRuneClass: + { + state = inWordState + } + case escapeRuneClass: + { + state = escapingQuotedState + } + default: + { + value = append(value, nextRune) + } + } + } + case quotingState: // in non-escaping single quotes + { + switch nextRuneType { + case eofRuneClass: + { + err = fmt.Errorf("EOF found when expecting closing quote") + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + case nonEscapingQuoteRuneClass: + { + state = inWordState + } + default: + { + value = append(value, nextRune) + } + } + } + case commentState: // in a comment + { + switch nextRuneType { + case eofRuneClass: + { + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } + case spaceRuneClass: + { + if nextRune == '\n' { + state = startState + token := &Token{ + tokenType: tokenType, + value: string(value)} + return token, err + } else { + value = append(value, nextRune) + } + } + default: + { + value = append(value, nextRune) + } + } + } + default: + { + return nil, fmt.Errorf("Unexpected state: %v", state) + } + } + } +} + +// Next returns the next token in the stream. +func (t *Tokenizer) Next() (*Token, error) { + return t.scanStream() +} + +// Split partitions a string into a slice of strings. +func Split(s string) ([]string, error) { + l := NewLexer(strings.NewReader(s)) + subStrings := make([]string, 0) + for { + word, err := l.Next() + if err != nil { + if err == io.EOF { + return subStrings, nil + } + return subStrings, err + } + subStrings = append(subStrings, word) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0c810e1e..8961c140 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -114,6 +114,9 @@ github.com/golang/protobuf/protoc-gen-go/descriptor # github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 ## explicit github.com/golang/snappy +# github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 +## explicit +github.com/google/shlex # github.com/google/uuid v1.1.4 github.com/google/uuid # github.com/gorilla/mux v1.7.4 @@ -156,15 +159,12 @@ github.com/jackpal/go-nat-pmp # github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 github.com/karalabe/usb # github.com/klauspost/compress v1.10.1 -## explicit github.com/klauspost/compress/flate # github.com/klauspost/pgzip v1.2.5 ## explicit github.com/klauspost/pgzip # github.com/konsorten/go-windows-terminal-sequences v1.0.3 github.com/konsorten/go-windows-terminal-sequences -# github.com/libp2p/go-libp2p-autonat-svc v0.1.0 -## explicit # github.com/magiconair/properties v1.8.1 github.com/magiconair/properties # github.com/mattn/go-colorable v0.1.4 @@ -173,9 +173,6 @@ github.com/mattn/go-colorable github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.9 github.com/mattn/go-runewidth -# github.com/mattn/go-sqlite3 v1.14.6 -## explicit -github.com/mattn/go-sqlite3 # github.com/mattn/go-tty v0.0.3 ## explicit github.com/mattn/go-tty @@ -187,8 +184,6 @@ github.com/miguelmota/go-ethereum-hdwallet github.com/mitchellh/go-homedir # github.com/mitchellh/mapstructure v1.3.2 github.com/mitchellh/mapstructure -# github.com/mmcloughlin/avo v0.0.0-20200803215136-443f81d77104 -## explicit # github.com/olekukonko/tablewriter v0.0.4 github.com/olekukonko/tablewriter # github.com/pborman/uuid v1.2.0 @@ -251,8 +246,6 @@ github.com/syndtr/goleveldb/leveldb/opt github.com/syndtr/goleveldb/leveldb/storage github.com/syndtr/goleveldb/leveldb/table github.com/syndtr/goleveldb/leveldb/util -# github.com/tidwall/pretty v1.0.2 -## explicit # github.com/tinygrasshopper/bettercsv v0.0.1 ## explicit github.com/tinygrasshopper/bettercsv diff --git a/version.go b/version.go index af06a7b0..b42f7914 100644 --- a/version.go +++ b/version.go @@ -5,7 +5,7 @@ package dfs var ( - version = "0.6.2" // manually set semantic version number + version = "0.7.0" // manually set semantic version number commit string // automatically set git commit hash Version = func() string {