Skip to content

Commit

Permalink
Debug connection invitation
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Dec 7, 2022
1 parent 885f7ba commit 7c4c06f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion mydata_did/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3312,6 +3312,8 @@ async def create_invitation(

image_url = None

self._logger.debug("line 3315")

try:
# Fetch iGrant.io config
igrantio_config = await self.fetch_igrantio_config_from_os_environ()
Expand All @@ -3328,15 +3330,21 @@ async def create_invitation(
async with aiohttp.ClientSession(headers=request_headers) as session:
async with session.get(igrantio_organisation_detail_url) as resp:
if resp.status == 200:
self._logger.debug("line 3333")
jresp = await resp.json()

if "Organization" in jresp:
organization_details = jresp["Organization"]
my_label = organization_details["Name"]
image_url = organization_details["LogoImageURL"] + "/web"
else:
self._logger.debug("line 3341")
tresp = await resp.text()
self._logger.debug(f"Failed to fetch organisation details from iGrant.io: {tresp}")

except ADAManagerError as err:
pass
self._logger.debug("line 3346")
self._logger.debug(err)

wallet: BaseWallet = await self.context.inject(BaseWallet)

Expand Down Expand Up @@ -3399,6 +3407,8 @@ async def create_invitation(
# Create connection invitation message
# Note: Need to split this into two stages to support inbound routing of invites
# Would want to reuse create_did_document and convert the result
self._logger.debug("line 3410")
self._logger.debug(f"Image url: {image_url}")
invitation = ConnectionInvitation(
label=my_label, recipient_keys=[
connection_key.verkey], endpoint=my_endpoint, image_url=image_url
Expand Down
1 change: 1 addition & 0 deletions mydata_did/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,7 @@ async def v2_connections_create_invitation(request: web.BaseRequest):
# Initialise MyData DID Manager.
mydata_did_manager: ADAManager = ADAManager(context=context)
try:
LOGGER.debug("line 3106")
(connection, invitation) = await mydata_did_manager.create_invitation(
auto_accept=auto_accept, public=public, multi_use=multi_use, alias=alias
)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ attrs==21.2.0
autopep8==1.5.7
base58==2.0.1
cachetools==4.2.2
aries-cloudagent==0.5.6
certifi==2021.5.30
cffi==1.14.5
chardet==3.0.4
Expand Down

0 comments on commit 7c4c06f

Please sign in to comment.