Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: vc wallet EDV storage
Browse files Browse the repository at this point in the history
- if wallet user provides EDV settings during profile creationfor
storage then wallet will create internal EDV client instance for storing
wallet contents
- for now, encryption and MAC key IDs has to be provided by client user
during profile creation/update
- closes hyperledger-archives#2757

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
sudeshrshetty committed Apr 27, 2021
1 parent 06fb8b7 commit 7b1984a
Showing 20 changed files with 1,003 additions and 242 deletions.
2 changes: 1 addition & 1 deletion cmd/aries-agent-mobile/go.mod
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ require (
github.com/google/uuid v1.1.2
github.com/hyperledger/aries-framework-go v0.1.7-0.20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210426170825-9321eebd7637
github.com/hyperledger/aries-framework-go/test/component v0.0.0-20210422133815-2ef2d99cb692
github.com/stretchr/testify v1.7.0
nhooyr.io/websocket v1.8.3
52 changes: 38 additions & 14 deletions cmd/aries-agent-mobile/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/aries-agent-rest/go.mod
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ require (
github.com/hyperledger/aries-framework-go v0.1.7-0.20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/component/storage/leveldb v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210426170825-9321eebd7637
github.com/rs/cors v1.7.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5 // indirect
53 changes: 39 additions & 14 deletions cmd/aries-agent-rest/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/aries-js-worker/go.mod
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ require (
github.com/google/uuid v1.1.2
github.com/hyperledger/aries-framework-go v0.1.7-0.20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/component/storage/indexeddb v0.0.0-00010101000000-000000000000
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210426170825-9321eebd7637
github.com/mitchellh/mapstructure v1.3.0
github.com/stretchr/testify v1.7.0
)
52 changes: 38 additions & 14 deletions cmd/aries-js-worker/go.sum

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -9,19 +9,23 @@ require (
github.com/PaesslerAG/jsonpath v0.1.1
github.com/VictoriaMetrics/fastcache v1.5.7
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833
github.com/btcsuite/btcd v0.20.1-beta
github.com/btcsuite/btcutil v1.0.1
github.com/btcsuite/btcd v0.21.0-beta
github.com/btcsuite/btcutil v1.0.2
github.com/cenkalti/backoff/v4 v4.0.2
github.com/decred/dcrd/lru v1.1.0 // indirect
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.5.2
github.com/google/tink/go v1.5.0
github.com/google/uuid v1.1.2
github.com/gorilla/mux v1.7.3
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20210426170825-9321eebd7637 // indirect
github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210422133815-2ef2d99cb692
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210426170825-9321eebd7637
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e
github.com/kilic/bls12-381 v0.0.0-20201104083100-a288617c07f1
github.com/kilic/bls12-381 v0.1.0
github.com/kkdai/bstream v1.0.0 // indirect
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/mitchellh/mapstructure v1.1.2
github.com/multiformats/go-multibase v0.0.1
@@ -31,14 +35,15 @@ require (
github.com/rs/cors v1.7.0
github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693
github.com/stretchr/testify v1.7.0
github.com/teserakt-io/golang-ed25519 v0.0.0-20200315192543-8255be791ce4
github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8
github.com/tidwall/gjson v1.6.7
github.com/tidwall/sjson v1.1.4
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f // indirect
google.golang.org/protobuf v1.25.0
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 // indirect
google.golang.org/protobuf v1.26.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
nhooyr.io/websocket v1.8.3
)

169 changes: 169 additions & 0 deletions go.sum

Large diffs are not rendered by default.

23 changes: 9 additions & 14 deletions pkg/wallet/contents.go
Original file line number Diff line number Diff line change
@@ -100,29 +100,24 @@ var (

// contentStore is store for wallet contents for given user profile.
type contentStore struct {
provider storage.Provider
storeID string
provider *storageProvider
open storeOpenHandle
close storeCloseHandle
lock sync.RWMutex
}

// newContentStore returns new wallet content store instance.
func newContentStore(p storage.Provider, pr *profile) (*contentStore, error) {
err := p.SetStoreConfig(pr.ID, storage.StoreConfiguration{TagNames: []string{
Collection.Name(), Credential.Name(), Connection.Name(), DIDResolutionResponse.Name(), Connection.Name(), Key.Name(),
}})
if err != nil {
return nil, fmt.Errorf("failed to set store config for user '%s' : %w", pr.User, err)
}

return &contentStore{open: storeLocked, close: noOp, provider: p, storeID: pr.ID}, nil
// will use underlying storage provider as content storage if profile doesn't have edv settings.
func newContentStore(p storage.Provider, pr *profile) *contentStore {
return &contentStore{open: storeLocked, close: noOp, provider: newWalletStorageProvider(pr, p)}
}

func (cs *contentStore) Open() error {
store, err := cs.provider.OpenStore(cs.storeID)
func (cs *contentStore) Open(auth string) error {
store, err := cs.provider.OpenStore(auth, storage.StoreConfiguration{TagNames: []string{
Collection.Name(), Credential.Name(), Connection.Name(), DIDResolutionResponse.Name(), Connection.Name(), Key.Name(),
}})
if err != nil {
return fmt.Errorf("failed to open store : %w", err)
return err
}

cs.lock.Lock()
Loading

0 comments on commit 7b1984a

Please sign in to comment.