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

daf7 with schemaValidation on can't use universal resolver #291

Closed
mirceanis opened this issue Dec 9, 2020 · 1 comment
Closed

daf7 with schemaValidation on can't use universal resolver #291

mirceanis opened this issue Dec 9, 2020 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mirceanis
Copy link
Member

Bug severity
3

Describe the bug
When using DafResolverUniversal, the DID documents are formatted closer to did core spec (they have @context as array of strings)
This causes failures with INVALID_TYPE errors when resolving DIDs

To Reproduce

import { DafUniversalResolver } from 'daf-resolver-universal'
import { createAgent, IResolver } from 'daf-core'
;(async ()=>{
  const agent = createAgent<IResolver>({
    schemaValidation: true,
    plugins: [
      new DafUniversalResolver({ url: 'https://dev.uniresolver.io/1.0/identifiers/'}),
      //...
    ],
  })
    const doc = await agent.resolveDid({ didUrl: 'did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6' })
})();

Expected behaviour
A doc is returned

Observed behaviour
INVALID_TYPE error is thrown

Additional context
The data types in question are imported from did-resolver, sometimes indirectly through did-jwt.
The latest versions of both these libraries have fixed these definitions.

Versions (please complete the following information):

  • Daf: 7.0.0-beta.55
@mirceanis mirceanis added the bug Something isn't working label Dec 9, 2020
@mirceanis mirceanis added this to the DAF 7.0 milestone Dec 9, 2020
@mirceanis mirceanis self-assigned this Dec 9, 2020
mirceanis added a commit that referenced this issue Dec 9, 2020
`JwtMessageHandler` can parse them but they fail later in the the message handler chain if `typ` is missing.

Also, this fixes #291
mirceanis added a commit that referenced this issue Dec 9, 2020
`JwtMessageHandler` can parse them but they fail later in the the message handler chain if `typ` is missing.

Also, this fixes #291
mirceanis added a commit that referenced this issue Dec 9, 2020
`JwtMessageHandler` can parse them but they fail later in the the message handler chain if `typ` is missing.

Also, this fixes #291
@mirceanis
Copy link
Member Author

closed in #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant