Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C a test suite #61

Open
6 tasks
Nebulis opened this issue Dec 13, 2019 · 0 comments
Open
6 tasks

W3C a test suite #61

Nebulis opened this issue Dec 13, 2019 · 0 comments
Labels
enhancement New feature or request w3c

Comments

@Nebulis
Copy link
Contributor

Nebulis commented Dec 13, 2019

Current Behavior

Generating a VC using OpenAttestation is not compatible with the W3C standard

Expected Behavior

OpenAttestation MUST generate valid W3C VC.

Proposal

The goal is to make OpenAttestation be able to generate valid W3C VC using the W3C VC test suite.

In order to support this multiple issues have already been created in this repository and in open-attestation-cli repository.

The goal of this issue is to focus only on the validation of the input data. Most of the test ran by the test suite provide a credential as input and ensure that the output is either a valid VC or an error.

In this issue we will focus on the following tests suite:

  • basic
  • schema
  • refresh
  • evidence
  • status
  • tou

Note 1: this issue will focus on VC only and will ignore VP tests
Note 2: it is for the moment unclear how we should handle JSON-LD. As per the test suite, we should throw error when we encounter properties not describe by the data. However the validation is quite slow. We will keep the validation for the moment but further inspection will be needed.
Example to validate JSON-LD:

import { compact } from "jsonld";
compact(credential, "https://w3id.org/security/v2", {
  expansionMap: info => {
    if (info.unmappedProperty) {
      throw new Error(
        'The property "' + info.unmappedProperty + '" in the input ' + "was not defined in the context."
      );
    }
  }
});
@Nebulis Nebulis added the enhancement New feature or request label Dec 13, 2019
@Nebulis Nebulis added the w3c label Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request w3c
Projects
None yet
Development

No branches or pull requests

1 participant