Giter Site home page Giter Site logo

aries-framework-go-ext's People

Contributors

0xardi avatar aholovko avatar baha-ai avatar bstasyszyn avatar drk3 avatar fqutishat avatar moopli avatar pfeairheller avatar rolsonquadras avatar ryjones avatar sandrask avatar soluchok avatar troyronda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aries-framework-go-ext's Issues

Full PostgreSQL storage provider/store implementation

The current PostgreSQL storage implementation is incomplete.

In no particular order:

  • Some methods are just not implemented at all
  • The SetStoreConfig method does not allow tag names to be removed from the store config. Additionally, tag names cannot be added properly - if some existing tag names plus some new ones are used in one call, then the whole operation will fail. There are many difficulties here that require consideration. With the PostgreSQL implementation, tag names are columns. If removing a tag names, do we remove the whole column? If so, the tag information gets destroyed. This isn't true in other implementations (like NoSQL ones), so there's an inconsistency here among implementations.
  • Tag names are case-insensitive. For other storage provider implementations, they are case-sensitive. Either this implementation should allow them to be case-sensitive or the interface should specify that they should be case-insensitive in order to ensure consistency among implementations.
  • SetStoreConfig is mandatory, but should be optional. This is tricky since we need the columns to exist before doing a Put or Query using those tags (in NoSQL implementations like MongoDB, there are no columns so this isn't a problem).
  • Overwriting an existing key-value pair will not update the tags - they should be updated.
  • The query method needs to support tag name + tag value queries (currently only tag name queries are supported)

mysql: optimize the `tagMap` mechanism

The tagMap mechanism of the mysql storage implementation should be optimized. It is being stored as a composite value of a single record in the data table. Instead, the tags should be maintained in a separate 'tags' table. Queries, updates, and deletions involving the tagMap should not require SELECT prior to UPDATE/DELETE. Furthermore, it should be possible to do bulk updates/deletions to the tag map (see Batch()).

CouchDB provider: if data is binary and large, store as a CouchDB attachment

CouchDB has something called "attachments" that could be used to store binary data in a more efficient form. We should make it so that if the binary data is greater than some size, then it gets stored as an attachment. When retrieving documents from CouchDB, we must then check to see if they have an attachment. If they do, then we return the attachment data. Otherwise, we look at the usual "value" field.

Should all store implementations require tags to be defined in store config before allowing them to be used?

Some store implementations don't require it at all (EDV in non-ext repo), some store implementations don't require it but will benefit from a performance improvement thanks to indexing (CouchDB) and some store implementations require it and will throw an error if it's not done (probably MySQL?)

Should all store implementations enforce the store config? Even if it's not required or optional?

Edit: the EDV storage implementation will soon make use of the store config to create indexes, so it'll be in the "benefits from from indexing but not requiring it" category

Create repo structure

The following structure is based on known proposed contributions.

Common Actions:

  • All contributions must include Apache v2 License headers. This must be enforced by global checks.
  • All contributions must be linted. This must be enforced by global checks.
  • All contributions must have unit & bdd / integration tests. This must be enforced by global checks.
  • Checks should only be run on changed (or new) modules for a particular commit.

Open Questions

  • Name of parent folder. Based on a prior aries presentation, I am thinking "component".
  • Do we have any common code in this repo contained within the top-level module?
  • How do we handle codecov?

Structure:

  • README
  • LICENSE
  • .github (workflow definitions)
  • go.mod (empty for now)
  • Makefile (global checks enforcement)
  • component (or ... module | mod | addon | ext) ("plugin" would be confused for go plugins)
    • storage
      • couchdb
        • go.mod
        • go sources (or under pkg directory if needed) - example: store.go, store_test.go
        • Makefile
        • README
        • test
      • mysql | sql (does it make sense to combine several variations of sql)
        • go.mod and other files (see above)
      • postgres (see above)
        • go.mod and other files (see above)
      • mongodb
        • go.mod and other files (see above)
    • vdr
      • indy
        • go.mod and other files (see above)
      • trustbloc
        • go.mod and other files (see above)
    • crypto (future)
    • kms (future)
    • credential | cred (future)
    • protocol (future)
  • scripts (common scripts - e.g., checks enforcement).
  • test (common test support - if applicable).
  • pkg (TBD: do we have any extension common code - most common code be in the framework repo).
  • cmd (TBD: do we have any binaries generated here - initial thought is no).

CouchDB support for non-admin account

Currently, the couchdb store can't operate with a non-admin account.

I found the following issues that hold back the couchdb store:

  1. The _users database is queried. This feature has been disabled in version 3.1.0 apache/couchdb#3084
  2. Requested stores are directly created without testing their existence. The subsequent error message is that there's a lack of permissions https://github.com/hyperledger/aries-framework-go-ext/blob/main/component/storage/couchdb/store.go#L373

CouchDB provider - return newstorage.MultiError from Batch method

The Batch method just returns a regular error. It would be better to examine the BulkResults object returned from the BulkDocs method from the Kivik library (currently that return value is ignored) to see if we can return a MultiError which will contain errors for each operation (if any occurred)

MongoDB tests don't work

make unit-test command runs all unit tests. Currently, MongoDB tests are not working properly.
MongoDB depends on the docker image. But Image isn’t created anywhere. Theoretically, tests should fail but they are not.
The problem is with os.Exit(0). Even if an error happens we exit with a successful code (0).
See https://github.com/hyperledger/aries-framework-go-ext/blob/main/component/storage/mongodb/mongodb_test.go#L47

What needs to be done?

  • when an error happens the exit code must be greater than 0
  • docker image needs to be set up (e.g dockertest is preferable)

CouchDB provider - consider adding option for preserving history in Batch calls?

In the case of a batch call where some of the operations are redundant (like a put, and then a put that overrides the previous one), those redundant operations will be stripped out. This is necessary to allow the CouchDB batch call to work correctly. CouchDB will not have any revision history of these stripped out operations, however. We may want to consider adding an option to preserve revision history (at the expense of speed most likely)

Full MongoDB implementation of new storage interface

The MongoDB implementation needs to be updated to support new functionality in order to be used as an aries-framework-go storage provider. At a minimum, the SetStoreConfig and Query methods need to be implemented, as well as tag storage (currently the Put method throws an error if you try to store tags).

Add options to VDR accept; update long-form logic

Currently VDR makes decision on whether to accept or reject request based on method only.
Add options to VDR Accept function so VDR can make more complex decisions (for example
long-form VDR should reject request if number of parts in DID is not at least four)

Update Orb VDR

Update Orb VDR with latest sidetree-core, sidetree VDR and aries-framework go

Error when running linter locally

Try running make lint on your local system, and you'll get the following error:

level=warning msg="[runner] Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites: [[email protected]/hyperledger/aries-framework-go-ext/component/vdr/indy: analysis skipped: errors in package: [/opt/workspace/vdr.go:21:2: could not import github.com/hyperledger/indy-vdr/wrappers/golang/vdr (/go/pkg/mod/github.com/hyperledger/indy-vdr/wrappers/[email protected]/vdr/cb.go:32:8: could not import C (cgo preprocessing failed))]]"
level=warning msg="[runner] Can't run linter unused: buildir: failed to load package vdr: could not load export data: no export data for \"github.com/hyperledger/indy-vdr/wrappers/golang/vdr\""
level=error msg="Running error: buildir: failed to load package vdr: could not load export data: no export data for \"github.com/hyperledger/indy-vdr/wrappers/golang/vdr\""

Note that this doesn't happen in the CI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.