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

[do not merge] Update create vector #149

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

nitro-neal
Copy link
Contributor

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
Copy link
Member

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

Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an improvement so I will approve.

I think we should add additional vectors to verify that going from input -> VC -> VC JWT -> VC is a consistent process

@nitro-neal
Copy link
Contributor Author

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

@jiyoontbd jiyoontbd changed the title Update create vector [do not merge] Update create vector Apr 5, 2024
@decentralgabe
Copy link
Member

@nitro-neal can this be closed?

@decentralgabe decentralgabe linked an issue Aug 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change credentials create test vectors
3 participants