Skip to content

Commit 0e1f06f

Browse files
do not reject invitation with unknown handshake protocol(s)
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
1 parent a28441a commit 0e1f06f

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

  • aries_cloudagent/protocols/out_of_band/v1_0/messages

aries_cloudagent/protocols/out_of_band/v1_0/messages/invitation.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ class Meta:
221221
fields.Str(
222222
description="Handshake protocol",
223223
example=DIDCommPrefix.qualify_current(HSProto.RFC23.name),
224-
validate=lambda hsp: (
225-
DIDCommPrefix.unqualify(hsp) in [p.name for p in HSProto]
226-
),
227224
),
228225
required=False,
229226
)
@@ -275,14 +272,11 @@ def validate_fields(self, data, **kwargs):
275272
ValidationError: If any of the fields do not validate
276273
"""
277274
handshake_protocols = data.get("handshake_protocols")
278-
requests_attach = data.get("requests_attach")
279-
if not (
280-
(handshake_protocols and len(handshake_protocols) > 0)
281-
or (requests_attach and len(requests_attach) > 0)
282-
):
275+
requests_attach = data.get("requests~attach")
276+
if not handshake_protocols and not requests_attach:
283277
raise ValidationError(
284278
"Model must include non-empty "
285-
"handshake_protocols or requests_attach or both"
279+
"handshake_protocols or requests~attach or both"
286280
)
287281

288282
# services = data.get("services")

0 commit comments

Comments
 (0)