TBD54566975 / web5-spec

https://tbd54566975.github.io/sdk-report-runner/
Apache License 2.0
6 stars 5 forks source link

[do not merge] Update create vector #149

Open nitro-neal opened 3 months ago

nitro-neal commented 3 months ago

This updates the way create works:

The input are the fields for the actual input fields of a vc with the VerifiableCredential.create() method. The output is the comparison of the VcDataModel object to what is expected.

Note classes implementing this have can't JUST do an object to object comparison because certain things like id and issuance date will be different than the output (by design)

Example VerifiableCredential.create() vector:

      "description":"valid simple credential",
      "input":{
        "credential":{
          "type":"SimpleCred",
          "issuer":"did:example:issuer",
          "subject":"did:example:subject",
          "credentialSubject":{
            "legit":true
          }
        }
      },
      "output":{
        "@context":[
          "https://www.w3.org/2018/credentials/v1"
        ],
        "type":[
          "VerifiableCredential",
          "SimpleCred"
        ],
        "id":"urn:uuid:ea74b564-fbe0-4b80-bd60-cd465d433e12",
        "issuer":"did:example:issuer",
        "credentialSubject":{
          "id":"did:example:subject",
          "legit":true
        }
      }
    },
decentralgabe commented 3 months ago

@nitro-neal is the intention to have this vector test an intermediate representation of a VC before it gets serialized as a JWT?

nitro-neal commented 3 months ago

As discussed:

Every other test vector like corresponds to a function call:

eg: VerifiableCredential.verify() DidDht.resolve()

every other one works in that you put the input and its like ‘known expected output’ so basically this is an attempt to do the same for VerifiableCredential.create()

Will create a new test vector VerifiableCredential.parseJwt() for round trip testing