Skip to content

Commit

Permalink
include image_url in oob invitation
Browse files Browse the repository at this point in the history
Signed-off-by: Pritam Singh <[email protected]>
  • Loading branch information
Zzocker committed Oct 6, 2022
1 parent 9dc2fa3 commit dbcac2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aries_cloudagent/protocols/out_of_band/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ async def create_invitation(
mediation_id,
or_default=True,
)
image_url = self.profile.context.settings.get("image_url")

if not (hs_protos or attachments):
raise OutOfBandManagerError(
Expand Down Expand Up @@ -235,6 +236,7 @@ async def create_invitation(
services=[f"did:sov:{public_did.did}"],
accept=service_accept if protocol_version != "1.0" else None,
version=protocol_version or DEFAULT_VERSION,
image_url=image_url,
)

our_recipient_key = public_did.verkey
Expand Down Expand Up @@ -333,6 +335,7 @@ async def create_invitation(
invi_msg.handshake_protocols = handshake_protocols
invi_msg.requests_attach = message_attachments
invi_msg.accept = service_accept if protocol_version != "1.0" else None
invi_msg.image_url = image_url
invi_msg.services = [
ServiceMessage(
_id="#inline",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(
*,
comment: str = None,
label: str = None,
image_url: str = None,
handshake_protocols: Sequence[Text] = None,
requests_attach: Sequence[AttachDecorator] = None,
services: Sequence[Union[Service, Text]] = None,
Expand All @@ -138,6 +139,7 @@ def __init__(
# super().__init__(_id=_id, **kwargs)
super().__init__(_type=msg_type, _version=version, **kwargs)
self.label = label
self.image_url = image_url
self.handshake_protocols = (
list(handshake_protocols) if handshake_protocols else []
)
Expand Down Expand Up @@ -208,6 +210,13 @@ class Meta:
example="https://didcomm.org/my-family/1.0/my-message-type",
)
label = fields.Str(required=False, description="Optional label", example="Bob")
image_url = fields.URL(
data_key="imageUrl",
required=False,
allow_none=True,
description="Optional image URL for out-of-band invitation",
example="http://192.168.56.101/img/logo.jpg",
)
handshake_protocols = fields.List(
fields.Str(
description="Handshake protocol",
Expand Down

0 comments on commit dbcac2c

Please sign in to comment.