Skip to content

Conversation

MarkusGarmeister
Copy link

fixes KILTProtocol/ticket#3033

A light DID resolution with encoded details, which can not be decoded, is parsed and decoded twice. I tried to fix this with a check of the encodedDetails in the parse function. However the tests are failling.

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)
    • Either PR or Ticket to update the Docs
    • Link the PR/Ticket here

Copy link
Member

@Dudleyneedham Dudleyneedham left a comment

Choose a reason for hiding this comment

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

I think we can use functionality in the library

const queryParameters = exportQueryParamsFromDidUrl(did as DidUrl)
// checking if encodedDetails can be decoded
if (encodedDetails) {
try {
Copy link
Member

Choose a reason for hiding this comment

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

The library has a validation function. We should be able to use that. @rflechtner What do you think?

base58Validate(encodedDetails, true)

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.

2 participants