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

Implemented did resolve as per the DID Spec; Fixed REST endpoint pattern for DID #83

Merged
merged 2 commits into from
Feb 25, 2022

Conversation

arnabghose997
Copy link
Contributor

@arnabghose997 arnabghose997 commented Feb 25, 2022

REST Endpoints

  1. Retrieving the count and list of didDocs:

Url: http://localhost:1318/hypersign-protocol/hidnode/ssi/did

Output:

{
   "totalDidCount":"2",
   "didDocList":[
      {
         "_at_context":"",
         "didDocument":{
            "context":[
               "https://www.w3.org/ns/did/v1",
               "https://w3id.org/security/v1",
               "https://schema.org"
            ],
            "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
            "controller":[
               
            ],
            "alsoKnownAs":[
               "did:hs:1f49341a-de30993e6c51"
            ],
            "verificationMethod":[
               {
                  "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf",
                  "type":"Ed25519VerificationKey2020",
                  "controller":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
                  "publicKeyMultibase":"zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf"
               }
            ],
            "authentication":[
               "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf"
            ],
            "assertionMethod":[
               
            ],
            "keyAgreement":[
               
            ],
            "capabilityInvocation":[
               
            ],
            "capabilityDelegation":[
               
            ],
            "service":[
               
            ]
         },
         "didDocumentMetadata":{
            "created":"2022-02-25T09:20:15Z",
            "updated":"2022-02-25T09:20:15Z",
            "deactivated":false,
            "versionId":"GkAO5TuRaFWnMD3IgoKaaBMKEIByYWIi9h/W9LvLk+Q="
         },
         "didResolutionMetadata":{
            "retrieved":"2022-02-25T09:20:19Z",
            "error":""
         }
      },
      {
         "_at_context":"",
         "didDocument":{
            "context":[
               "https://www.w3.org/ns/did/v1",
               "https://w3id.org/security/v1",
               "https://schema.org"
            ],
            "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52",
            "controller":[
               "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52"
            ],
            "alsoKnownAs":[
               "did:hs:1f49341a-de30993e6c52"
            ],
            "verificationMethod":[
               {
                  "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4",
                  "type":"Ed25519VerificationKey2020",
                  "controller":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52",
                  "publicKeyMultibase":"z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4"
               }
            ],
            "authentication":[
               "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4"
            ],
            "assertionMethod":[
               
            ],
            "keyAgreement":[
               
            ],
            "capabilityInvocation":[
               
            ],
            "capabilityDelegation":[
               
            ],
            "service":[
               {
                  "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#vcs",
                  "type":"LinkedDomains",
                  "serviceEndpoint":"https://example.com/vc"
               },
               {
                  "id":"did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#file",
                  "type":"LinkedDomains",
                  "serviceEndpoint":"https://example.in/somefile"
               }
            ]
         },
         "didDocumentMetadata":{
            "created":"2022-02-25T09:20:11Z",
            "updated":"2022-02-25T09:20:11Z",
            "deactivated":false,
            "versionId":"ClUei1OW9mDtFQuFdhgmfzPZT1gWa7hGwfRI9DP2mMs="
         },
         "didResolutionMetadata":{
            "retrieved":"2022-02-25T09:20:19Z",
            "error":""
         }
      }
   ]
}
  1. Retrieving a Did Document by DID Id:

Url: http://localhost:1318/hypersign-protocol/hidnode/ssi/did/did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52:

Output:

{
  "_at_context": "",
  "didDocument": {
    "context": [
      "https://www.w3.org/ns/did/v1",
      "https://w3id.org/security/v1",
      "https://schema.org"
    ],
    "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52",
    "controller": [
      "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52"
    ],
    "alsoKnownAs": [
      "did:hs:1f49341a-de30993e6c52"
    ],
    "verificationMethod": [
      {
        "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4",
        "type": "Ed25519VerificationKey2020",
        "controller": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52",
        "publicKeyMultibase": "z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4"
      }
    ],
    "authentication": [
      "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#z8BXg2zjwBRTrjPs7uCnkFBKrL9bPD14HxEJMENxm3CJ4"
    ],
    "assertionMethod": [],
    "keyAgreement": [],
    "capabilityInvocation": [],
    "capabilityDelegation": [],
    "service": [
      {
        "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c52#vcs",
        "type": "LinkedDomains",
        "serviceEndpoint": "https://example.com/vc"
      },
      {
        "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#file",
        "type": "LinkedDomains",
        "serviceEndpoint": "https://example.in/somefile"
      }
    ]
  },
  "didDocumentMetadata": {
    "created": "2022-02-25T09:20:11Z",
    "updated": "2022-02-25T09:20:11Z",
    "deactivated": false,
    "versionId": "ClUei1OW9mDtFQuFdhgmfzPZT1gWa7hGwfRI9DP2mMs="
  },
  "didResolutionMetadata": {
    "retrieved": "2022-02-25T09:24:43Z",
    "error": ""
  }
}
  1. Setting the Page Limit

url: http://localhost:1318/hypersign-protocol/hidnode/ssi/did?pagination.limit=1

{
  "totalDidCount": "2",
  "didDocList": [
    {
      "_at_context": "",
      "didDocument": {
        "context": [
          "https://www.w3.org/ns/did/v1",
          "https://w3id.org/security/v1",
          "https://schema.org"
        ],
        "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
        "controller": [],
        "alsoKnownAs": [
          "did:hs:1f49341a-de30993e6c51"
        ],
        "verificationMethod": [
          {
            "id": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf",
            "type": "Ed25519VerificationKey2020",
            "controller": "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51",
            "publicKeyMultibase": "zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf"
          }
        ],
        "authentication": [
          "did:hs:0f49341a-20ef-43d1-bc93-de30993e6c51#zEYJrMxWigf9boyeJMTRN4Ern8DJMoCXaLK77pzQmxVjf"
        ],
        "assertionMethod": [],
        "keyAgreement": [],
        "capabilityInvocation": [],
        "capabilityDelegation": [],
        "service": []
      },
      "didDocumentMetadata": {
        "created": "2022-02-25T15:18:59Z",
        "updated": "2022-02-25T15:18:59Z",
        "deactivated": false,
        "versionId": "OwpjbfvZn5mBdf1gJWrpYFKrI2yLCQAjVhgHCqq6WOo="
      },
      "didResolutionMetadata": {
        "retrieved": "2022-02-25T15:19:05Z",
        "error": ""
      }
    }
  ]
}

@arnabghose997 arnabghose997 added this to In progress in Hypersign Identity Network v0.0.3 via automation Feb 25, 2022
@arnabghose997 arnabghose997 self-assigned this Feb 25, 2022
@arnabghose997 arnabghose997 linked an issue Feb 25, 2022 that may be closed by this pull request
@arnabghose997 arnabghose997 merged commit fb1af6a into v0.0.3 Feb 25, 2022
Hypersign Identity Network v0.0.3 automation moved this from In progress to Done Feb 25, 2022
@arnabghose997 arnabghose997 deleted the ssi-module-did-resolve branch February 25, 2022 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Implement DID Resolve
1 participant