Skip to content

Commit

Permalink
feat: Add filter param to connection list for invitations
Browse files Browse the repository at this point in the history
As mentioned in #1789, there is no way to currently filter for
connections/invited created via the OOB handler. This commit adds a
filter query param to filter off the invitation message ID.

Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
  • Loading branch information
TheTechmage committed Jun 7, 2022
1 parent 00d97b3 commit d460885
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aries_cloudagent/protocols/connections/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ class ConnectionsListQueryStringSchema(OpenAPISchema):
),
example=ConnRecord.Protocol.RFC_0160.aries_protocol,
)
invitation_msg_id = fields.UUID(
description="Identifier of the associated Invintation Mesage",
required=False,
example=UUIDFour.EXAMPLE,
)


class CreateInvitationQueryStringSchema(OpenAPISchema):
Expand Down Expand Up @@ -336,6 +341,7 @@ async def connections_list(request: web.BaseRequest):
"request_id",
"invitation_key",
"their_public_did",
"invitation_msg_id",
):
if param_name in request.query and request.query[param_name] != "":
tag_filter[param_name] = request.query[param_name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async def test_connections_list(self):
"connection_protocol": ConnRecord.Protocol.RFC_0160.aries_protocol,
"invitation_key": "some-invitation-key",
"their_public_did": "a_public_did",
"invitation_msg_id": "dummy_msg",
}

STATE_COMPLETED = ConnRecord.State.COMPLETED
Expand Down Expand Up @@ -94,6 +95,7 @@ async def test_connections_list(self):
"invitation_id": "dummy",
"invitation_key": "some-invitation-key",
"their_public_did": "a_public_did",
"invitation_msg_id": "dummy_msg",
},
post_filter_positive={
"their_role": [v for v in ConnRecord.Role.REQUESTER.value],
Expand Down

0 comments on commit d460885

Please sign in to comment.