Coder Social home page Coder Social logo

vc.js's Introduction

These source files have moved here

vc.js's People

Contributors

acarnagey avatar dependabot[bot] avatar gjgd avatar haardikk21 avatar or13 avatar timoglastra avatar

Stargazers

 avatar  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

vc.js's Issues

Class static side 'typeof Ed25519KeyPair2020' incorrectly extends base class static side 'typeof Ed25519KeyPair'.

Hey, I get the following error when using this library:

  The types returned by 'from(...)' are incompatible between these types.
    Type 'Promise<Ed25519KeyPair2020>' is missing the following properties from type 'Ed25519KeyPair': id, type, controller, publicKeyBuffer, and 9 more.

Furthermore, I had to add @transmute/did-key-ed25519 manually, since it's only a devDependency. Since Ed25519KeyPair2020 uses it directly I feel it should go into dependencies

Divergence from jsonld-signatures

I was testing compatibility between linked-data-proof and jsonld-signatures and noticed some divergence here https://github.com/transmute-industries/vc.js/blob/master/packages/linked-data-proof/src/ProofSet.ts#L150 and here https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/ProofSet.js#L188. I believe the fix would be:

+ const context = document['@context'] || constants.SECURITY_CONTEXT_URL
  const proofSet = proofSet.map((proof: any) => ({
-   '@context': constants.SECURITY_CONTEXT_URL,
+   '@context': context,
    ...proof,
  }));

When testing that out I also noticed that vc.js will need to be updated too: https://github.com/transmute-industries/vc.js/blob/master/packages/vc.js/src/vc-ld/purposes/CredentialIssuancePurpose.ts#L62. The fix here I think would be:

  const issuer = jsonld.getValues(
    document,
-   'https://www.w3.org/2018/credentials#issuer'
+   'issuer'
  );
+ const issuerId = const issuerId = typeof issuer[0] === 'string' ? issuer[0] : issuer[0].id;
-  if (result.controller.id !== issuer[0].id) {
+  if (result.controller.id !== issuerId) {
    throw new Error(
      'Credential issuer must match the verification method controller.'
    );
  }

I tried to create a PR that fixes and tests these things but to do so I needed a signing suite that wasn't supported by sec-v2 context I tried using https://github.com/digitalbazaar/ed25519-signature-2020 but that requires the latest jsonld-signatures and that has other changes that impact compatibility (no more compact proof support)

Automated release

Github actions, conventional commits, release documentation, etc...

Need a node cli

Would be nice to add a nodejs bin / cli with support for boring web URLs

Add github link to package.json of packages

This is a minor nitpick but would make it a lot easier to go from npm to github (and from github to github).

Two reasons:

  1. When on NPM you can't go directly to Github (it renders a link if present in package.json). You have to manually find where the package is located. With monorepos this can be inconvient.
  2. I'm using OctoLinker which adds links to file/package imports in the Github Web UI. If you have a link to the Github repo in your package.json it will automatically link them together.

E.g. for the @transmute/vc.js package this will mean adding the following to the package.json:

{
  "name": "@transmute/vc.js",
  // ...
  "repository": {
    "type" : "git",
    "url" : "https://github.com/transmute-industries/vc.js.git",
    "directory": "packages/vc.js"
  },
  "homepage": "https://github.com/transmute-industries/vc.js/tree/master/packages/vc.js",
  // OR 
  "homepage": "https://transmute-industries.github.io/vc.js/"
}

Happy to assist if you agree :)

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.