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

Update create vector #294

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

Update create vector #294

wants to merge 10 commits into from

Conversation

nitro-neal
Copy link
Contributor

@nitro-neal nitro-neal commented Apr 3, 2024

Overview

Updated the way VerifiableCredential.create() works

Description

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.

Web5-Spec changes - TBD54566975/web5-spec#149
Example test 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
        }
      }
    },
    ```

Copy link
Contributor

@jiyoontbd jiyoontbd left a comment

Choose a reason for hiding this comment

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

let's use types! types are cool and fun and neato

val evidence = vector.input.credential?.get("evidence") as? List<Any>

val vc = VerifiableCredential.create(
type = vector.input.credential?.get("type") as String,
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a lot of ?get("...") here - have you considered having concrete types for these fields inside vector or credential input?

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.

3 participants