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

fix: Accept a did_base64 for querying a DID via REST #174

Merged
merged 3 commits into from
Jul 8, 2021

Conversation

youngjoon-lee
Copy link
Contributor

@youngjoon-lee youngjoon-lee commented Jul 8, 2021

Fixes #173

I tested this manually. We should have integration tests for REST API. I'll open another issue.

The response body below has snake_case, but we want for the document to obey the W3C spec (camelCase). Let's try to fix it as a next PR.

$ echo -n "did:panacea:4Fsrryj58HP3zxRE9FPBcsG4EehAmoSuGXuvvpxbrziF" | base64 | pbcopy
$ curl -X GET http://localhost:1317/panacea/did/v2/dids/ZGlkOnBhbmFjZWE6NEZzcnJ5ajU4SFAzenhSRTlGUEJjc0c0RWVoQW1vU3VHWHV2dnB4YnJ6aUY="

{
  "did_document_with_seq": {
    "document": {
      "contexts": [
        "https://www.w3.org/ns/did/v1"
      ],
      "id": "did:panacea:4Fsrryj58HP3zxRE9FPBcsG4EehAmoSuGXuvvpxbrziF",
      "controller": null,
      "verification_methods": [
        {
          "id": "did:panacea:4Fsrryj58HP3zxRE9FPBcsG4EehAmoSuGXuvvpxbrziF#key1",
          "type": "Secp256k1VerificationKey2018",
          "controller": "did:panacea:4Fsrryj58HP3zxRE9FPBcsG4EehAmoSuGXuvvpxbrziF",
          "public_key_base58": "ecfi6w7BeaWmumQ1s7nHvcMasAWhpPkXNoPZ3eXyERLU"
        }
      ],
      "authentications": [
        "did:panacea:4Fsrryj58HP3zxRE9FPBcsG4EehAmoSuGXuvvpxbrziF#key1"
      ],
      "assertion_methods": [
      ],
      "key_agreements": [
      ],
      "capability_invocations": [
      ],
      "capability_delegations": [
      ],
      "services": [
      ]
    },
    "sequence": "0"
  }
}

Copy link
Contributor

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

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

👍

@youngjoon-lee youngjoon-lee merged commit d820d73 into master Jul 8, 2021
@youngjoon-lee youngjoon-lee deleted the fix/173/did-rest-base64 branch July 8, 2021 07:39
@youngjoon-lee youngjoon-lee added this to the v2.0.0 milestone Jul 12, 2021
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.

REST /panacea/did/v2/dids/{did} returns Not Implemented
2 participants