Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: SDS EDV format provider #2210

Merged

Conversation

DRK3
Copy link
Contributor

@DRK3 DRK3 commented Sep 30, 2020

This new provider type allows for data to be stored in an underlying provider using the EDV document models.

Signed-off-by: Derek Trider Derek.Trider@securekey.com

@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch from dba30a6 to 1993b8d Compare October 15, 2020 21:33
@DRK3 DRK3 changed the title WIP: feat: SDS EDV provider skeleton feat: SDS EDV format provider Oct 15, 2020
@DRK3 DRK3 marked this pull request as ready for review October 15, 2020 21:34
@DRK3
Copy link
Contributor Author

DRK3 commented Oct 15, 2020

Note for reviewers: I recommend you start by looking at the edvformatprovider.go file. Then dig in to the other pieces referenced there.

@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch from 1993b8d to 76855ec Compare October 15, 2020 21:40

"github.com/hyperledger/aries-framework-go/pkg/storage"
"github.com/hyperledger/aries-framework-go/pkg/storage/sds"
"github.com/hyperledger/aries-framework-go/pkg/storage/sds/edvformatprovider/edvdocumentprocessor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edvformatprovider depends on a sub package (edvdocumentprocessor), is the document processor only going to be used by the format provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The EDVFormatProvider will use it to do the encryption before storing in the underlying provider, and it'll also use it for decrypting the data from the underlying provider. The idea is that the existing providers work without making any changes. In another PR I'll be pushing in the near-future, I'll be adding the EDV rest API as a provider as well that can be used as an underlying provider.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(per our offline conversation, I made the EDVFormatProvider and EDVDocumentProcessor packages siblings in terms of their folder hierarchy.)


// EDVDocumentProcessor represents a type that can encrypt and decrypt between
// Structured Documents and Encrypted Documents.
type EDVDocumentProcessor interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there going to be a default implementation of this interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the default implementation will use the Aries JOSE Encrypter and Decrypter.

@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch from 76855ec to 6aa5de6 Compare October 16, 2020 15:45

// EDVDocumentProcessor represents a type that can encrypt and decrypt between
// Structured Documents and Encrypted Documents.
type EDVDocumentProcessor interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all packages, files and interface start with edv - there is a lot of stutter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved all the "edv" files within a folder and removed that prefix.

pkg/storage/sds/edvformatprovider/edvformatprovider.go Outdated Show resolved Hide resolved
pkg/storage/sds/edvformatprovider/edvformatprovider.go Outdated Show resolved Hide resolved
pkg/storage/sds/edvformatprovider/edvformatprovider.go Outdated Show resolved Hide resolved
@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch from 6aa5de6 to 31d2031 Compare October 16, 2020 20:00
@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch 2 times, most recently from 4777bf6 to 574ad52 Compare October 19, 2020 14:19
@codecov
Copy link

codecov bot commented Oct 19, 2020

Codecov Report

Merging #2210 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2210      +/-   ##
==========================================
+ Coverage   89.52%   89.57%   +0.04%     
==========================================
  Files         220      221       +1     
  Lines       15032    15094      +62     
==========================================
+ Hits        13458    13520      +62     
  Misses        935      935              
  Partials      639      639              
Impacted Files Coverage Δ
pkg/storage/edv/formatprovider/formatprovider.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5734c20...563bb83. Read the comment docs.


"github.com/hyperledger/aries-framework-go/pkg/storage"
"github.com/hyperledger/aries-framework-go/pkg/storage/sds"
"github.com/hyperledger/aries-framework-go/pkg/storage/sds/edv/documentprocessor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need to come back to this topic - sds/edv seems a bit odd, but I don't currently have a better suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the sds folder and just moved edv to be directly under storage for now since everything that's in there is purely EDV-related. The SDS spec is still in flux so perhaps this should change in the future.

SPDX-License-Identifier: Apache-2.0
*/

package sds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly confused about the split between the sds package and the edv package.

Aren't these models related to the edv portion of the sds spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed they are... that was an error on my part. I've moved models inside the edv package.

@troyronda troyronda requested a review from fqutishat October 19, 2020 14:31
@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch 2 times, most recently from 99c76a2 to 0746e1b Compare October 19, 2020 16:10
This new provider type allows for data to be stored in an underlying provider using the EDV document models.

Signed-off-by: Derek Trider <Derek.Trider@securekey.com>
@DRK3 DRK3 force-pushed the EncryptedProviderSkeleton branch from 0746e1b to 563bb83 Compare October 19, 2020 16:25
@fqutishat fqutishat merged commit 440ab57 into hyperledger-archives:master Oct 19, 2020
@DRK3 DRK3 mentioned this pull request Oct 19, 2020
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants