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

Updated driver details for did-elem #287

Merged
merged 2 commits into from
Feb 14, 2022
Merged

Updated driver details for did-elem #287

merged 2 commits into from
Feb 14, 2022

Conversation

BenjaminMoe
Copy link
Contributor

@BenjaminMoe BenjaminMoe commented Feb 14, 2022

Changes:

  • did:elem was updated to did:elem:ropsten to avoid confusion as did:elem is reserved for mainnet.
  • Example curl request was updated to reflect this change
  • driver in config.json was updated with regex and instance for resolving did:elem:ropsten

Issue:

#283

Example:

curl -X GET http://localhost:8080/1.0/identifiers/did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A

Returns

{
  "@context":"https://w3id.org/did-resolution/v1",
  "didDocument":{
    "assertionMethod":[
      "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
    ],
    "keyAgreement":[
      "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
    ],
    "id":"did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
    "verificationMethod":[
      {
        "id":"#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp",
        "controller":"did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
        "type":"JsonWebKey2020",
        "publicKeyJwk":{
          "kty":"EC",
          "crv":"secp256k1",
          "x":"7hfx9LZXlMBaZ2EurUcXOITSIGLIFQ4YY7pXCbEqntU",
          "y":"B1FId5MlHAuhxsDU9uvPuE2JXKVPP3ohjuR6HUvY6XM"
        }
      }
    ],
    "authentication":[
      "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
    ]
  },
  "didResolutionMetadata":{
    "pattern":"^(did:elem:ropsten:.+)$",
    "driverUrl":"https://ropsten.element.transmute.industries/api/1.0/identifiers/$1",
    "duration":17783,
    "did":{
      "didString":"did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
      "methodSpecificId":"ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
      "method":"elem"
    },
    "contentType":"application/did+ld+json",
    "convertedFrom":"application/did+json",
    "convertedTo":"application/did+ld+json"
  },
  "didDocumentMetadata":{
    "method":{
      "published":true,
      "recoveryCommitment":"EiB2lrE88cmhcepLS-p8wBbxHfZKSvniCKfL0CfZe4i36g",
      "updateCommitment":"EiBch3E26X_PoJ_Io2NS8-Dn6F94hcMAChZ6-AaZ2B_pUQ"
    },
    "canonicalId":"did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A"
  }
}

@BenjaminMoe BenjaminMoe marked this pull request as ready for review February 14, 2022 17:58
@OR13
Copy link
Contributor

OR13 commented Feb 14, 2022

Worth noting that this might now work with LD Proofs because the context is being stripped by the resolver middleware.

@OR13
Copy link
Contributor

OR13 commented Feb 14, 2022

curl -s -H "Accept: application/did+ld+json" https://ropsten.element.transmute.industries/api/1.0/identifiers/did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A
curl -s -H "Accept: application/did+json" https://ropsten.element.transmute.industries/api/1.0/identifiers/did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A

Universal resolver should not tamper with resolutions responses from drivers.

EDIT: imo our endpoint should probably be updated to behave the same with the universal resolver behaves.

even in cases where we think the behavior is a bug, like this.

@BenjaminMoe
Copy link
Contributor Author

curl -s -H "Accept: application/did+json" http://localhost:8080/1.0/identifiers/did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A

Returns

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/suites/jws-2020/v1",
    {
      "@vocab": "https://www.w3.org/ns/did#"
    }
  ],
  "id": "did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
  "verificationMethod": [
    {
      "id": "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp",
      "controller": "did:elem:ropsten:EiCtwD11AV9e1oISQRHnMJsBC3OBdYDmx8xeKeASrKaw6A",
      "type": "JsonWebKey2020",
      "publicKeyJwk": {
        "kty": "EC",
        "crv": "secp256k1",
        "x": "7hfx9LZXlMBaZ2EurUcXOITSIGLIFQ4YY7pXCbEqntU",
        "y": "B1FId5MlHAuhxsDU9uvPuE2JXKVPP3ohjuR6HUvY6XM"
      }
    }
  ],
  "authentication": [
    "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
  ],
  "assertionMethod": [
    "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
  ],
  "keyAgreement": [
    "#zQ3shvfXLUVwKffPochZ1UkSjxQqpgND3Z5DhzTADooqmmypp"
  ]
}

@OR13
Copy link
Contributor

OR13 commented Feb 14, 2022

Seems the issue is the default accept header is for a. "did resolution response" not a "did document".... and the "did resolution response" strips the context, but the "did document does not".

We should just remember to never ask for the did resolution response and we should be good on our end.

@BernhardFuchs BernhardFuchs merged commit 28f7c0f into decentralized-identity:main Feb 14, 2022
@BenjaminMoe BenjaminMoe deleted the bugfix-issue-283-did branch February 14, 2022 20:49
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