-
Notifications
You must be signed in to change notification settings - Fork 519
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
Feature/native did web resolver #1218
Feature/native did web resolver #1218
Conversation
Signed-off-by: Woerner Dominic (RBCH/PJ-IOT) <dominic.woerner2@ch.bosch.com>
Signed-off-by: Woerner Dominic (RBCH/PJ-IOT) <dominic.woerner2@ch.bosch.com>
Codecov Report
@@ Coverage Diff @@
## main #1218 +/- ##
==========================================
- Coverage 98.47% 98.41% -0.06%
==========================================
Files 456 457 +1
Lines 25428 25474 +46
==========================================
+ Hits 25039 25070 +31
- Misses 389 404 +15 |
from typing import Sequence, Pattern | ||
import aiohttp | ||
import urllib.parse | ||
|
||
from ...config.injection_context import InjectionContext | ||
from ...core.profile import Profile | ||
from ..base import ( | ||
BaseDIDResolver, | ||
DIDNotFound, | ||
ResolverError, | ||
ResolverType, | ||
) | ||
from ...messaging.valid import DIDWeb | ||
from pydid import DID, DIDDocument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reorder imports:
import urllib.parse
from typing import Sequence, Pattern
import aiohttp
from pydid import DID, DIDDocument
from ...config.injection_context import InjectionContext
from ...core.profile import Profile
from ...messaging.valid import DIDWeb
from ..base import (
BaseDIDResolver,
DIDNotFound,
ResolverError,
ResolverType,
)
Signed-off-by: Woerner Dominic (RBCH/PJ-IOT) <dominic.woerner2@ch.bosch.com>
Signed-off-by: Woerner Dominic (RBCH/PJ-IOT) <dominic.woerner2@ch.bosch.com>
Signed-off-by: Woerner Dominic (RBCH/PJ-IOT) <dominic.woerner2@ch.bosch.com>
def supported_methods(self) -> Sequence[str]: | ||
"""Return list of supported methods.""" | ||
return ["web"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should no longer be required, technically.
I was trying this out and have found that while Error: Response was incorrectly formatted. Failed to deserialize DIDDocumentRoot:. 1 validation error for ParsingModel[DIDDocumentRoot]. __root__ -> @context -> 1. str type expected (type=type_error.str). [ErrorWrapper(exc=ValidationError(model='DIDDocumentRoot', errors=[{'loc': ('@context', 1), 'msg': 'str type expected', 'type': 'type_error.str'}]), loc=('__root__',))]. I'm guessing this is because of the JSON-LD contexts in the Mike document (and Carol). Is that the issue? Thanks |
PyDID is complaining about the embedded object in the |
Yes -- I was using |
Add native did:web resolver. Carved out and touched up from #1143
Does not support encoding of ports in DIDs yet (e.g.did:web:localhost%3A8443 -> https://localhost:443/.well-known/did.json
yet, because pyDID does not allow '%' char in DID (See: Allow % char in DID Indicio-tech/pydid#34)