edvprovider

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// VaultConfigurationStoreName is the name for the store that holds data vault configurations.
	VaultConfigurationStoreName = "data_vault_configurations"
	// VaultConfigReferenceIDTagName is the tag name used for querying vault configs based on their reference IDs.
	VaultConfigReferenceIDTagName = "ReferenceID"

	// MappingDocumentTagName is the tag name used for querying mapping documents
	// based on what attribute name they're for.
	MappingDocumentTagName = "AttributeName"
	// MappingDocumentMatchingEncryptedDocIDTagName is the tag name used for querying mapping documents
	// based on what encrypted document they're for.
	MappingDocumentMatchingEncryptedDocIDTagName = "MatchingEncryptedDocumentID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider added in v0.1.7

type Provider struct {
	// contains filtered or unexported fields
}

Provider represents an EDV storage provider. It wraps an Aries storage provider with additional functionality that's needed for EDV operations.

func NewProvider added in v0.1.7

func NewProvider(ariesProvider storage.Provider, retrievalPageSize uint) *Provider

NewProvider instantiates a new Provider. retrievalPageSize is used by ariesProvider for query paging. It may be ignored if ariesProvider doesn't support paging.

func (*Provider) OpenStore added in v0.1.7

func (c *Provider) OpenStore(name string) (*Store, error)

OpenStore opens a store and returns it. The name is converted to a UUID if it is a base58-encoded 128-bit value.

func (*Provider) SetStoreConfig added in v0.1.7

func (c *Provider) SetStoreConfig(name string, config storage.StoreConfiguration) error

SetStoreConfig sets the store configuration in the underlying core provider.

func (*Provider) StoreExists added in v0.1.7

func (c *Provider) StoreExists(name string) (bool, error)

StoreExists returns a boolean indicating whether a given store has ever been created. It checks to see if the underlying database exists via the GetStoreConfig method.

type Store added in v0.1.7

type Store struct {
	// contains filtered or unexported fields
}

Store represents an EDV store. It wraps an Aries store with additional functionality that's needed for EDV operations.

func (*Store) Delete added in v0.1.7

func (c *Store) Delete(docID string) error

Delete deletes the given document and its mapping document(s).

func (*Store) Get added in v0.1.7

func (c *Store) Get(k string) ([]byte, error)

Get fetches the document associated with the given key.

func (*Store) Put added in v0.1.7

func (c *Store) Put(document models.EncryptedDocument) error

Put stores the given document. Mapping documents are also created and stored in order to allow for encrypted indices to work.

func (*Store) Query added in v0.1.7

func (c *Store) Query(query *models.Query) ([]models.EncryptedDocument, error)

Query does an EDV encrypted index query. We first get the "mapping document" and then use the ID we get from that to lookup the associated encrypted document. Then we check that encrypted document to see if the value matches what was specified in the query. If query.Has is not blank, then we assume it's a "has" query, and so any documents with an index name matching query.Has will be returned regardless of value. TODO (#168): Add support for pagination (not currently in the spec).

The c.retrievalPageSize parameter is passed in from the startup args and could be used with pagination.

func (*Store) StoreDataVaultConfiguration added in v0.1.7

func (c *Store) StoreDataVaultConfiguration(config *models.DataVaultConfiguration, vaultID string) error

StoreDataVaultConfiguration stores the given DataVaultConfiguration and vaultID

func (*Store) Update added in v0.1.7

func (c *Store) Update(newDoc models.EncryptedDocument) error

Update updates the given document.

func (*Store) UpsertBulk added in v0.1.7

func (c *Store) UpsertBulk(documents []models.EncryptedDocument) error

UpsertBulk stores the given documents, creating or updating them as needed. TODO (#171): Address encrypted index limitations of this method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL