TBD54566975 / web5-go

Apache License 2.0
7 stars 6 forks source link

didcore.Document @context non-string types #92

Closed KendallWeihe closed 4 months ago

KendallWeihe commented 4 months ago

From the spec https://www.w3.org/TR/did-core/#dfn-context

The JSON-LD Context is either a string or a list containing any combination of strings and/or ordered maps.

From LinkedIn's did:web https://www.linkedin.com/.well-known/did.json

{
  "id": "did:web:www.linkedin.com",
  "@context": [
    "https://www.w3.org/ns/did/v1",
    { "@base": "did:web:www.linkedin.com" }
  ],
  "service": [
    {
      "id": "#linkeddomains",
      "type": "LinkedDomains",
      "serviceEndpoint": { "origins": ["https://www.linkedin.com/"] }
    },
    {
      "id": "#hub",
      "type": "IdentityHub",
      "serviceEndpoint": {
        "instances": [
          "https://hub.did.msidentity.com/v1.0/658728e7-1632-412a-9815-fe53f53ec58b"
        ]
      }
    }
  ],
  "verificationMethod": [
    {
      "id": "#074cfbf193f046bcba5841ac4751e91bvcSigningKey-46682",
      "controller": "did:web:www.linkedin.com",
      "type": "EcdsaSecp256k1VerificationKey2019",
      "publicKeyJwk": {
        "crv": "secp256k1",
        "kty": "EC",
        "x": "NHIQivVR0HX7c0flpxgWQ7vRtbWDvr0UPN1nJ--0lyU",
        "y": "hYiIldgLRShym7vzflFrEkg6NYkayUHkDpV0RMjUEYE"
      }
    }
  ],
  "authentication": ["#074cfbf193f046bcba5841ac4751e91bvcSigningKey-46682"],
  "assertionMethod": ["#074cfbf193f046bcba5841ac4751e91bvcSigningKey-46682"]
}
KendallWeihe commented 4 months ago

There are more properties than just the @context, for example look at the services. Feel free to use this ticket to create new tickets.

KendallWeihe commented 4 months ago

Reviewing the spec for other instances of mixed types...

The following are all for embedded VMs, so could probably be implemented together

KendallWeihe commented 4 months ago

Closing in favor of https://github.com/TBD54566975/web5-go/issues/109