Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
fix: presentation-request-received output reformatted
Browse files Browse the repository at this point in the history
`presentation-request-received` had all presentation information
included because the raw record information was included. The user of
the API should not rely on the raw record, instead,
`presentation_exchange_id` and `presentation_request` have been pulled
out and are now top-level elements. Similar to the
`presentation-get-matching-credentials` API response.

Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
  • Loading branch information
TheTechmage committed Oct 8, 2021
1 parent d634155 commit abeb5c4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions acapy_plugin_toolbox/holder/v0_1/messages/pres_request_received.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ class PresRequestReceived(AdminHolderMessage):
class Fields:
"""Fields of Presentation request received message."""

record = PresExRecordField(required=True, description="Presentation details.")
raw_repr = PresExRecordField(required=True, description="Presentation details.")
presentation_exchange_id = fields.Str(
required=True, description="Exchange ID for matched credentials."
)
# TODO Use a toolbox PresentationExchangeRepresentation
presentation_request = fields.Mapping(
required=True,
description="Presentation Request associated with the Presentation Exchange ID.",
)
matching_credentials = fields.Nested(
IndyCredPrecisSchema,
many=True,
Expand All @@ -39,13 +47,15 @@ class Fields:

def __init__(self, record: PresExRecord, **kwargs):
super().__init__(**kwargs)
self.record = record
self.raw_repr = record
self.presentation_request = record.presentation_request
self.presentation_exchange_id = record.presentation_exchange_id
self.matching_credentials = []
self.page = None

async def retrieve_matching_credentials(self, profile: Profile):
holder = profile.inject(IndyHolder)
request = self.record.presentation_request
request = self.presentation_request

if not (type(request) is dict):
request = request.serialize()
Expand Down

0 comments on commit abeb5c4

Please sign in to comment.