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

Discovery: search API for clients #2672

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Discovery: search API for clients #2672

merged 3 commits into from
Jan 9, 2024

Conversation

reinkrul
Copy link
Member

@reinkrul reinkrul commented Dec 11, 2023

PR adds Discovery.Seach() API that searches for presentations registered on a discovery service. The actual search functionality for the database already existed in the store implementation, this PR adds API exposure.

Alongside the matching VPs, it also returns a map with fields from the PEX definition mapped to credential fields, just like the OAuth2 token introspection API. This is useful for displaying search results (e.g. organization search like in Demo EHR).

Example output:

[
  {
    "vp": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDpleGFtcGxlOmFsaWNlIzAiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOlsidXNlY2FzZV92MSJdLCJleHAiOjE3MDQyMTI1MTksImlzcyI6ImRpZDpleGFtcGxlOmFsaWNlIiwianRpIjoiZGlkOmV4YW1wbGU6YWxpY2UjOGE5NWVlMTYtZmI1Ny00NjYzLThkZTctY2Y2NzJmMTRlNWQzIiwibmJmIjoxNzA0MTgzNzE5LCJzdWIiOiJkaWQ6ZXhhbXBsZTphbGljZSIsInZwIjp7IkBjb250ZXh0IjpudWxsLCJ0eXBlIjoiVmVyaWZpYWJsZVByZXNlbnRhdGlvbiIsInZlcmlmaWFibGVDcmVkZW50aWFsIjoiZXlKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNkltUnBaRHBsZUdGdGNHeGxPbUZzYVdObEl6QWlMQ0owZVhBaU9pSktWMVFpZlEuZXlKbGVIQWlPakUzTURReU56QXhNVGtzSW1semN5STZJbVJwWkRwbGVHRnRjR3hsT21GMWRHaHZjbWwwZVNJc0ltcDBhU0k2SW1ScFpEcGxlR0Z0Y0d4bE9tRjFkR2h2Y21sMGVTTXhZV05qTVdaaU5DMWhNREEyTFRReE4yWXRPR1psTWkwNU16UXlOamN5TmpBNU5ESWlMQ0p1WW1ZaU9qRTNNRFF4T0RNM01Ua3NJbk4xWWlJNkltUnBaRHBsZUdGdGNHeGxPbUZzYVdObElpd2lkbU1pT25zaVFHTnZiblJsZUhRaU9tNTFiR3dzSW1OeVpXUmxiblJwWVd4VGRXSnFaV04wSWpwYmV5SnBaQ0k2SW1ScFpEcGxlR0Z0Y0d4bE9tRnNhV05sSWl3aWNHVnljMjl1SWpwN0ltWmhiV2xzZVU1aGJXVWlPaUpLYjI1bGN5SXNJbWRwZG1WdVRtRnRaU0k2SWtGc2FXTmxJbjE5WFN3aWRIbHdaU0k2V3lKV1pYSnBabWxoWW14bFEzSmxaR1Z1ZEdsaGJDSXNJbFJsYzNSRGNtVmtaVzUwYVdGc0lsMTlmUS4wNUlWT2c0d3hTQl9DWGxXU0Rjby1BeVNRRDlOdGdBcUhsLWctQ0NLaElTOXFWNW9HWmEwcmVPaTFyVk9nSlp5c2RJVzd5NGdIMFNrY0tad0k3ZG1JQSJ9fQ.Bl3PmN6X5ESFTdwnrisx588ts1wKCkmgpnWegDQXBobeAc2myd4u8VZmIGtKPI3eVwI4gNQS8ZjjfozEEiyjrw",
    "fields": {
      "issuer_field": "did:example:authority"
    }
  }
]

@reinkrul reinkrul force-pushed the discovery-search-api branch from bf787a2 to 5c91748 Compare December 16, 2023 07:22
@reinkrul reinkrul force-pushed the discovery-search-api branch from 5c91748 to dbe4f21 Compare January 2, 2024 08:20
@reinkrul reinkrul marked this pull request as ready for review January 2, 2024 08:56
@reinkrul reinkrul force-pushed the discovery-search-api branch from dbe4f21 to 02bf6f8 Compare January 2, 2024 09:26
@reinkrul reinkrul force-pushed the discovery-search-api branch from 02bf6f8 to 7a81266 Compare January 9, 2024 09:57
Copy link
Member

@woutslakhorst woutslakhorst left a comment

Choose a reason for hiding this comment

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

Might be good to add that the API runs on the downloaded list, no call to the Discovery server is made

@reinkrul reinkrul merged commit adff763 into master Jan 9, 2024
9 checks passed
@reinkrul reinkrul deleted the discovery-search-api branch January 9, 2024 12:14
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