Code Monkey home page Code Monkey logo

edv's People

Contributors

aholovko avatar baha-ai avatar bstasyszyn avatar fqutishat avatar grace0925 avatar llorllale avatar rolsonquadras avatar silveraid avatar soluchok avatar sudeshrshetty avatar talwinder50 avatar troyronda avatar ypukhta avatar

Stargazers

 avatar  avatar  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  avatar

edv's Issues

EDV: Client

Make a reusable client type that can be used to interact with an EDV in code. The client will be responsible for managing the REST API calls, encryption keys, etc.

/BUG/FIXME

edv/.golangci.yml

Lines 84 to 86 in eeb06b1

- Line contains TODO/BUG/FIXME
# Add comments for package
- at least one file in a package should have a package comment


This issue was generated by todo based on a TODO comment in eeb06b1 when #1 was merged. cc @DRK3.

Add logging

Right now the EDV only outputs a message to let you know it's running, but it would be helpful to have messages when other veents happen (such as a new document being created).

OpenAPI annotations

add swagger annotations for OpenAPI.
add Makefile target to generate OpenAPI/swagger documentation.

Alternate authorization mechanism

The EDV spec does not mandate a particular authorization scheme. In our implementation here, it's essentially left up to the storage provider. e.g. for CouchDB, the username and password can be supplied via the database URL flag.

We could use DIDs and signing, similar to how Transmute does in https://www.youtube.com/watch?v=1zNe_KsdszI to authenticate users.

Validate incoming DataVaultConfigurations and Documents

Currently the only check is a basic JSON unmarshal call. This means that the only check the server will do right now is validating whether the input is valid JSON, but not whether it's actually got the correct data per the spec. Implement robust validation.

Additional check: return an error if an "invalid id" is provided. The ID has to work correctly when concatenated to a URL. Any provided ID that will cause this to fail (such as ones that contain //) need to generate an error. No longer applicable since vault IDs are generated by the server, and document IDs have to be Base58-encoded.

Mock EDV APIs

Mock EDV APIs for storage to allow plugging Implementation later on.

  • Basic API implementation, simple in-memory store trustbloc/edge-store#27
  • Implement EDV client #3
  • EDV Docker image #14
  • Client BDD test

(No encryption or authentication, using StructuredDocuments instead of EncryptedDocuments for now)

Implement ZCAP authorization

The authorization mechanism is left up to the implementer.

From the spec:

It is necessary to have a mechanism that enables authorized sharing of encrypted information among one or more entities.

The system is expected to specify one mandatory authorization scheme, but also allow other alternate authorization schemes. Examples of authorization schemes include OAuth2, Web Access Control, and Authorization Capabilities (ZCAP-LD).

Currently, in our implementation it's essentially left up to the storage provider. e.g. for CouchDB, the username and password can be supplied via the database URL flag.

We could use DIDs and signing, similar to how Transmute does in https://www.youtube.com/watch?v=1zNe_KsdszI to authenticate users.

Implement remaining DataVaultConfiguration properties

There are additional properties in DataVaultConfiguration objects that haven't been implemented, such as sequence, controller, delgator, etc.

However, there aren't a lot of details on these fields and there still seems to be some things in the spec that need to get worked out since there's a note in that section that says:

ISSUE 5 Data vault configuration isn't strictly necessary for using the other features of data vaults. This should have its own conformance section/class or potentially event be non-normative.

We should figure out what to do here, perhaps after the spec has been updated?

See https://www.youtube.com/watch?v=1zNe_KsdszI to see how Transmute uses a DID to verify that the controller is indeed the one accessing the vault.

URL-encoded slashes don't work for vault IDs or document IDs

If your vault ID or document ID contains a slash, the resulting location that will be returned from the server will be unreachable since the slash breaks the path. Even if the slash is urlencoded as %2F, it still can't be reached.

This seems to be an inherent issue in the Go net/url and so this issue carries over to the Gorilla mux package. See gorilla/mux#77 for details.

There is a workaround: call mux.useEncodedPath() before starting the router.

We will also probably want to urlencode the returned location in the response so that it's actually usable as well.

Swagger UI doesn't show location header

May or may not be an issue with go-swagger - I was unable to get it to actually show the location header, despite it showing up in the expected response. This issue affects the create vault and create document endpoints in the OpenAPI demo.

image

Figure out the intermittent failure when querying from CouchDB

When edge-sandbox was running on AWS, there was an intermittent failure that happened when edge-service was retrieving a credential from the EDV. The EDV queried the underlying CouchDB database (which was running in cluster mode) and it returned no documents. This seemed to happen more often where there were many CouchDB documents in the store (over 50). When inspecting the database, the documents appeared to be there, so it's strange that CouchDB returned no results.

Things to investigate...

Single node vs cluster mode - does that make a difference?
When those failures happen - check and confirm that the query is correct.
Could there be an issue with the underlying Kivik library?
Checks the CouchDB logs.

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.