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: filter for DIDCommMessaging service type #27

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions didcomm_messaging/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ async def _resolve_services(self, to: str) -> List[DIDCommV2Service]:
services = []
if did_doc.service: # service is not guaranteed to exist
for did_service in did_doc.service:
if did_service.type != "DIDCommMessaging":
continue
Comment on lines +31 to +32
Copy link
Member

Choose a reason for hiding this comment

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

Technically, did-communication could be used to identify a DIDComm v2 endpoint. We could consider supporting it if the accept property has didcomm/v2 in it. I haven't fully formed an opinion either way on this yet. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the DIDComm spec encourages DIDCommMessaging, I feel that we should encourage it as well. You brought up an excellent point of making the class more modular in the future in slack, which I think is an excellent idea. Though I'm not sure when we should do that

if "didcomm/v2" in did_service.service_endpoint.accept:
services.append(did_service)
if not services:
Expand Down
Loading