835 tests run, 824 passed, 5 skipped, 6 failed.
Annotations
Check failure on line 105 in app/tests/e2e/test_did_exchange.py
github-actions / JUnit Test Report
test_did_exchange.test_create_did_exchange_request[clean-clean-None-None-False]
fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
Raw output
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfadb0>
url = '/v1/connections/ff0a100a-0a03-4c53-94ad-a9d5e863c5d6', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_QWPTB - HTTP DELETE `/v1/connections/ff0a100a-0a03-4c53-94ad-a9d5e863c5d6` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
> response.raise_for_status()
shared/util/rich_async_client.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [500 Internal Server Error]>
def raise_for_status(self) -> Response:
"""
Raise the `HTTPStatusError` if one occurred.
"""
request = self._request
if request is None:
raise RuntimeError(
"Cannot call `raise_for_status` as the request "
"instance has not been set on this response."
)
if self.is_success:
return self
if self.has_redirect_location:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"Redirect location: '{0.headers[location]}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
else:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
status_class = self.status_code // 100
error_types = {
1: "Informational response",
3: "Redirect response",
4: "Client error",
5: "Server error",
}
error_type = error_types.get(status_class, "Invalid status code")
message = message.format(self, error_type=error_type)
> raise HTTPStatusError(message, request=request, response=self)
E httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://governance-tenant-web.cloudapi.dev.didxtech.com/tenant/v1/connections/ff0a100a-0a03-4c53-94ad-a9d5e863c5d6'
E For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
/usr/local/lib/python3.12/site-packages/httpx/_models.py:763: HTTPStatusError
The above exception was the direct cause of the following exception:
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfadb0>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f0df8380>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f0df96a0>
use_did = None, use_did_method = None, use_public_did = False
@pytest.mark.anyio
@pytest.mark.parametrize(
"use_did,use_did_method,use_public_did",
[
(None, None, False),
(True, None, False),
(None, "did:peer:2", False),
(None, "did:peer:4", False),
(True, "did:peer:4", False),
(None, None, True),
],
)
async def test_create_did_exchange_request(
alice_member_client: RichAsyncClient,
faber_client: RichAsyncClient,
alice_acapy_client: AcaPyClient,
faber_acapy_client: AcaPyClient,
use_did: Optional[str],
use_did_method: Optional[str],
use_public_did: bool,
):
faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
if use_did:
new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
request_data["use_did"] = new_did.did
if use_did_method:
request_data["use_did_method"] = use_did_method
if use_public_did:
request_data["use_public_did"] = use_public_did
if use_public_did: # Alice doesn't have a public DID
with pytest.raises(HTTPException) as exc_info:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
elif use_did and use_did_method:
with pytest.raises(HTTPException) as exc_info:
await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert (
exc_info.value.detail
== """{"detail":"Cannot specify both use_did and use_did_method."}"""
)
else:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
)
assert response.status_code == 200
connection_record = response.json()
assert_that(connection_record).contains("connection_id", "state")
assert_that(connection_record["state"]).is_equal_to("request-sent")
alice_connection_id = connection_record["connection_id"]
alice_did = connection_record["my_did"]
try:
# Due to auto-accepts, Alice's connection is complete
assert await check_webhook_state(
alice_member_client,
topic="connections",
state="completed",
filter_map={"connection_id": alice_connection_id},
)
# Faber now has a complete connection too
assert await check_webhook_state(
faber_client,
topic="connections",
state="completed",
filter_map={"their_did": alice_did},
)
finally:
await asyncio.sleep(1) # Short sleep assists in avoiding 500 error
# Delete connection records:
> await alice_member_client.delete(
f"{CONNECTIONS_BASE_PATH}/{alice_connection_id}"
)
app/tests/e2e/test_did_exchange.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfadb0>
url = '/v1/connections/ff0a100a-0a03-4c53-94ad-a9d5e863c5d6', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_QWPTB - HTTP DELETE `/v1/connections/ff0a100a-0a03-4c53-94ad-a9d5e863c5d6` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
response.raise_for_status()
except HTTPStatusError as e:
code = e.response.status_code
message = e.response.text
log_message = f"{self.name} DELETE `{url}` failed. Status code: {code}. Response: `{message}`."
logger.error(log_message)
> raise HTTPException(status_code=code, detail=message) from e
E fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
shared/util/rich_async_client.py:68: HTTPException
Check failure on line 105 in app/tests/e2e/test_did_exchange.py
github-actions / JUnit Test Report
test_did_exchange.test_create_did_exchange_request[clean-clean-None-did:peer:2-False]
fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
Raw output
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f199fe60>
url = '/v1/connections/d0efeb84-3728-47a7-848d-51820a31f2c8', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_DJYZH - HTTP DELETE `/v1/connections/d0efeb84-3728-47a7-848d-51820a31f2c8` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
> response.raise_for_status()
shared/util/rich_async_client.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [500 Internal Server Error]>
def raise_for_status(self) -> Response:
"""
Raise the `HTTPStatusError` if one occurred.
"""
request = self._request
if request is None:
raise RuntimeError(
"Cannot call `raise_for_status` as the request "
"instance has not been set on this response."
)
if self.is_success:
return self
if self.has_redirect_location:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"Redirect location: '{0.headers[location]}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
else:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
status_class = self.status_code // 100
error_types = {
1: "Informational response",
3: "Redirect response",
4: "Client error",
5: "Server error",
}
error_type = error_types.get(status_class, "Invalid status code")
message = message.format(self, error_type=error_type)
> raise HTTPStatusError(message, request=request, response=self)
E httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://governance-tenant-web.cloudapi.dev.didxtech.com/tenant/v1/connections/d0efeb84-3728-47a7-848d-51820a31f2c8'
E For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
/usr/local/lib/python3.12/site-packages/httpx/_models.py:763: HTTPStatusError
The above exception was the direct cause of the following exception:
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f199fe60>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f199ff20>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f199ebd0>
use_did = None, use_did_method = 'did:peer:2', use_public_did = False
@pytest.mark.anyio
@pytest.mark.parametrize(
"use_did,use_did_method,use_public_did",
[
(None, None, False),
(True, None, False),
(None, "did:peer:2", False),
(None, "did:peer:4", False),
(True, "did:peer:4", False),
(None, None, True),
],
)
async def test_create_did_exchange_request(
alice_member_client: RichAsyncClient,
faber_client: RichAsyncClient,
alice_acapy_client: AcaPyClient,
faber_acapy_client: AcaPyClient,
use_did: Optional[str],
use_did_method: Optional[str],
use_public_did: bool,
):
faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
if use_did:
new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
request_data["use_did"] = new_did.did
if use_did_method:
request_data["use_did_method"] = use_did_method
if use_public_did:
request_data["use_public_did"] = use_public_did
if use_public_did: # Alice doesn't have a public DID
with pytest.raises(HTTPException) as exc_info:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
elif use_did and use_did_method:
with pytest.raises(HTTPException) as exc_info:
await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert (
exc_info.value.detail
== """{"detail":"Cannot specify both use_did and use_did_method."}"""
)
else:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
)
assert response.status_code == 200
connection_record = response.json()
assert_that(connection_record).contains("connection_id", "state")
assert_that(connection_record["state"]).is_equal_to("request-sent")
alice_connection_id = connection_record["connection_id"]
alice_did = connection_record["my_did"]
try:
# Due to auto-accepts, Alice's connection is complete
assert await check_webhook_state(
alice_member_client,
topic="connections",
state="completed",
filter_map={"connection_id": alice_connection_id},
)
# Faber now has a complete connection too
assert await check_webhook_state(
faber_client,
topic="connections",
state="completed",
filter_map={"their_did": alice_did},
)
finally:
await asyncio.sleep(1) # Short sleep assists in avoiding 500 error
# Delete connection records:
> await alice_member_client.delete(
f"{CONNECTIONS_BASE_PATH}/{alice_connection_id}"
)
app/tests/e2e/test_did_exchange.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f199fe60>
url = '/v1/connections/d0efeb84-3728-47a7-848d-51820a31f2c8', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_DJYZH - HTTP DELETE `/v1/connections/d0efeb84-3728-47a7-848d-51820a31f2c8` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
response.raise_for_status()
except HTTPStatusError as e:
code = e.response.status_code
message = e.response.text
log_message = f"{self.name} DELETE `{url}` failed. Status code: {code}. Response: `{message}`."
logger.error(log_message)
> raise HTTPException(status_code=code, detail=message) from e
E fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
shared/util/rich_async_client.py:68: HTTPException
Check failure on line 105 in app/tests/e2e/test_did_exchange.py
github-actions / JUnit Test Report
test_did_exchange.test_create_did_exchange_request[clean-clean-None-did:peer:4-False]
fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
Raw output
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19ce840>
url = '/v1/connections/3424f5f7-965c-4e81-ae19-28df0afd46c3', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_CWQGA - HTTP DELETE `/v1/connections/3424f5f7-965c-4e81-ae19-28df0afd46c3` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
> response.raise_for_status()
shared/util/rich_async_client.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [500 Internal Server Error]>
def raise_for_status(self) -> Response:
"""
Raise the `HTTPStatusError` if one occurred.
"""
request = self._request
if request is None:
raise RuntimeError(
"Cannot call `raise_for_status` as the request "
"instance has not been set on this response."
)
if self.is_success:
return self
if self.has_redirect_location:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"Redirect location: '{0.headers[location]}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
else:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
status_class = self.status_code // 100
error_types = {
1: "Informational response",
3: "Redirect response",
4: "Client error",
5: "Server error",
}
error_type = error_types.get(status_class, "Invalid status code")
message = message.format(self, error_type=error_type)
> raise HTTPStatusError(message, request=request, response=self)
E httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://governance-tenant-web.cloudapi.dev.didxtech.com/tenant/v1/connections/3424f5f7-965c-4e81-ae19-28df0afd46c3'
E For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
/usr/local/lib/python3.12/site-packages/httpx/_models.py:763: HTTPStatusError
The above exception was the direct cause of the following exception:
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19ce840>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
alice_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f19cc620>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f19cda00>
use_did = None, use_did_method = 'did:peer:4', use_public_did = False
@pytest.mark.anyio
@pytest.mark.parametrize(
"use_did,use_did_method,use_public_did",
[
(None, None, False),
(True, None, False),
(None, "did:peer:2", False),
(None, "did:peer:4", False),
(True, "did:peer:4", False),
(None, None, True),
],
)
async def test_create_did_exchange_request(
alice_member_client: RichAsyncClient,
faber_client: RichAsyncClient,
alice_acapy_client: AcaPyClient,
faber_acapy_client: AcaPyClient,
use_did: Optional[str],
use_did_method: Optional[str],
use_public_did: bool,
):
faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
if use_did:
new_did = await acapy_wallet.create_did(controller=alice_acapy_client)
request_data["use_did"] = new_did.did
if use_did_method:
request_data["use_did_method"] = use_did_method
if use_public_did:
request_data["use_public_did"] = use_public_did
if use_public_did: # Alice doesn't have a public DID
with pytest.raises(HTTPException) as exc_info:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert exc_info.value.detail == """{"detail":"No public DID configured."}"""
elif use_did and use_did_method:
with pytest.raises(HTTPException) as exc_info:
await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request",
params=request_data,
)
assert exc_info.value.status_code == 400
assert (
exc_info.value.detail
== """{"detail":"Cannot specify both use_did and use_did_method."}"""
)
else:
response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
)
assert response.status_code == 200
connection_record = response.json()
assert_that(connection_record).contains("connection_id", "state")
assert_that(connection_record["state"]).is_equal_to("request-sent")
alice_connection_id = connection_record["connection_id"]
alice_did = connection_record["my_did"]
try:
# Due to auto-accepts, Alice's connection is complete
assert await check_webhook_state(
alice_member_client,
topic="connections",
state="completed",
filter_map={"connection_id": alice_connection_id},
)
# Faber now has a complete connection too
assert await check_webhook_state(
faber_client,
topic="connections",
state="completed",
filter_map={"their_did": alice_did},
)
finally:
await asyncio.sleep(1) # Short sleep assists in avoiding 500 error
# Delete connection records:
> await alice_member_client.delete(
f"{CONNECTIONS_BASE_PATH}/{alice_connection_id}"
)
app/tests/e2e/test_did_exchange.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19ce840>
url = '/v1/connections/3424f5f7-965c-4e81-ae19-28df0afd46c3', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_CWQGA - HTTP DELETE `/v1/connections/3424f5f7-965c-4e81-ae19-28df0afd46c3` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
response.raise_for_status()
except HTTPStatusError as e:
code = e.response.status_code
message = e.response.text
log_message = f"{self.name} DELETE `{url}` failed. Status code: {code}. Response: `{message}`."
logger.error(log_message)
> raise HTTPException(status_code=code, detail=message) from e
E fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
shared/util/rich_async_client.py:68: HTTPException
Check failure on line 178 in app/tests/e2e/test_did_exchange.py
github-actions / JUnit Test Report
test_did_exchange.test_accept_did_exchange_invitation[clean-clean-False]
fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
Raw output
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19873e0>
url = '/v1/connections/0f009581-c318-471a-bc58-278b3e5654a9', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_UYGDX - HTTP DELETE `/v1/connections/0f009581-c318-471a-bc58-278b3e5654a9` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
> response.raise_for_status()
shared/util/rich_async_client.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Response [500 Internal Server Error]>
def raise_for_status(self) -> Response:
"""
Raise the `HTTPStatusError` if one occurred.
"""
request = self._request
if request is None:
raise RuntimeError(
"Cannot call `raise_for_status` as the request "
"instance has not been set on this response."
)
if self.is_success:
return self
if self.has_redirect_location:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"Redirect location: '{0.headers[location]}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
else:
message = (
"{error_type} '{0.status_code} {0.reason_phrase}' for url '{0.url}'\n"
"For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/{0.status_code}"
)
status_class = self.status_code // 100
error_types = {
1: "Informational response",
3: "Redirect response",
4: "Client error",
5: "Server error",
}
error_type = error_types.get(status_class, "Invalid status code")
message = message.format(self, error_type=error_type)
> raise HTTPStatusError(message, request=request, response=self)
E httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://governance-tenant-web.cloudapi.dev.didxtech.com/tenant/v1/connections/0f009581-c318-471a-bc58-278b3e5654a9'
E For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
/usr/local/lib/python3.12/site-packages/httpx/_models.py:763: HTTPStatusError
The above exception was the direct cause of the following exception:
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19873e0>
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
tenant_admin_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f1985430>
faber_acapy_client = <aries_cloudcontroller.acapy_client.AcaPyClient object at 0x7fe4f1985cd0>
use_public_did = False
@pytest.mark.anyio
@pytest.mark.parametrize("use_public_did", [False])
async def test_accept_did_exchange_invitation(
alice_member_client: RichAsyncClient,
faber_client: RichAsyncClient,
tenant_admin_client: RichAsyncClient,
faber_acapy_client: AcaPyClient,
use_public_did: bool,
):
# First disable auto-accept invites for Faber
faber_wallet_id = get_wallet_id_from_async_client(client=faber_client)
await tenant_admin_client.put(
f"{TENANTS_BASE_PATH}/{faber_wallet_id}",
json={"extra_settings": {"ACAPY_AUTO_ACCEPT_REQUESTS": False}},
)
faber_public_did = await acapy_wallet.get_public_did(controller=faber_acapy_client)
request_data = {"their_public_did": qualified_did_sov(faber_public_did.did)}
alice_create_request_response = await alice_member_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/create-request", params=request_data
)
alice_create_request_response = alice_create_request_response.json()
alice_connection_id = alice_create_request_response["connection_id"]
alice_did = alice_create_request_response["my_did"]
try:
faber_connection_request_received_event = await check_webhook_state(
faber_client,
topic="connections",
state="request-received",
filter_map={"their_did": alice_did},
)
faber_connection_id = faber_connection_request_received_event["connection_id"]
accept_params = {
"connection_id": faber_connection_id,
"use_public_did": use_public_did,
}
faber_accept_request_response = await faber_client.post(
f"{CONNECTIONS_BASE_PATH}/did-exchange/accept-request", params=accept_params
)
assert faber_accept_request_response.status_code == 200
accept_response = faber_accept_request_response.json()
assert accept_response["state"] == "response-sent"
# Now Alice's connection is complete
assert await check_webhook_state(
alice_member_client,
topic="connections",
state="completed",
filter_map={"connection_id": alice_connection_id},
)
# And Faber's connection is complete
assert await check_webhook_state(
faber_client,
topic="connections",
state="completed",
filter_map={"connection_id": faber_connection_id},
)
finally:
await asyncio.sleep(1) # Short sleep assists in avoiding 500 error
# Delete connection records:
> await alice_member_client.delete(
f"{CONNECTIONS_BASE_PATH}/{alice_connection_id}"
)
app/tests/e2e/test_did_exchange.py:178:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19873e0>
url = '/v1/connections/0f009581-c318-471a-bc58-278b3e5654a9', kwargs = {}
response = <Response [500 Internal Server Error]>, code = 500
message = '{"detail":"Internal Server Error"}'
log_message = 'Tenant alice_UYGDX - HTTP DELETE `/v1/connections/0f009581-c318-471a-bc58-278b3e5654a9` failed. Status code: 500. Response: `{"detail":"Internal Server Error"}`.'
async def delete(self, url: str, **kwargs) -> Response:
try:
response = await super().delete(url, **kwargs)
if self.raise_status_error:
response.raise_for_status()
except HTTPStatusError as e:
code = e.response.status_code
message = e.response.text
log_message = f"{self.name} DELETE `{url}` failed. Status code: {code}. Response: `{message}`."
logger.error(log_message)
> raise HTTPException(status_code=code, detail=message) from e
E fastapi.exceptions.HTTPException: 500: {"detail":"Internal Server Error"}
shared/util/rich_async_client.py:68: HTTPException
Check failure on line 46 in app/tests/e2e/issuer/test_connections_use_public_did.py
github-actions / JUnit Test Report
test_connections_use_public_did.test_accept_use_public_did[clean-clean]
app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
meld_co_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f198f110>
@pytest.mark.anyio
async def test_accept_use_public_did(
faber_client: RichAsyncClient, # issuer has public did
meld_co_client: RichAsyncClient, # also has public did
):
invite_json = CreateInvitation(use_public_did=True).model_dump()
response = await faber_client.post(
f"{BASE_PATH}/create-invitation", json=invite_json
)
assert response.status_code == 200
invitation = response.json()
assert_that(invitation["connection_id"]).is_not_empty()
assert_that(invitation["invitation"]).is_instance_of(dict).contains(
"@id", "@type", "recipientKeys", "serviceEndpoint"
)
assert_that(invitation["invitation_url"]).matches(r"^https?://")
accept_invite_json = AcceptInvitation(
invitation=invitation["invitation"],
).model_dump()
accept_response = await meld_co_client.post(
f"{BASE_PATH}/accept-invitation",
json=accept_invite_json,
)
connection_record = accept_response.json()
assert_that(connection_record).contains(
"connection_id", "state", "created_at", "updated_at", "invitation_key"
)
assert_that(connection_record).has_state("request-sent")
> assert await check_webhook_state(
client=meld_co_client,
topic="connections",
state="completed",
filter_map={
"connection_id": connection_record["connection_id"],
},
)
app/tests/e2e/issuer/test_connections_use_public_did.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
app/tests/util/webhooks.py:58: in check_webhook_state
event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <app.tests.util.sse_listener.SseListener object at 0x7fe4f198fd70>
field = 'connection_id', field_id = 'f306eff5-2ded-4988-a905-055c24135d52'
desired_state = 'completed', timeout = Timeout(timeout=30)
async def wait_for_event(
self,
field,
field_id,
desired_state,
timeout: int = DEFAULT_LISTENER_TIMEOUT,
) -> Dict[str, Any]:
"""
Start listening for SSE events. When an event is received that matches the specified parameters.
"""
url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}"
timeout = Timeout(timeout)
async with RichAsyncClient(timeout=timeout) as client:
async with client.stream("GET", url) as response:
async for line in response.aiter_lines():
if line.startswith("data: "):
data = json.loads(line[6:])
return data["payload"]
elif line == "" or line.startswith(": ping"):
pass # ignore newlines and pings
else:
logger.warning("Unexpected SSE line: {}", line)
> raise SseListenerTimeout("Requested filtered event was not returned by server.")
E app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
app/tests/util/sse_listener.py:56: SseListenerTimeout
Check failure on line 90 in app/tests/e2e/issuer/test_connections_use_public_did.py
github-actions / JUnit Test Report
test_connections_use_public_did.test_accept_use_public_did_between_issuer_and_holder[clean-clean]
app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
Raw output
faber_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f0dfb260>
alice_member_client = <shared.util.rich_async_client.RichAsyncClient object at 0x7fe4f19859a0>
@pytest.mark.anyio
async def test_accept_use_public_did_between_issuer_and_holder(
faber_client: RichAsyncClient, # issuer has public did
alice_member_client: RichAsyncClient, # no public did
):
invite_json = CreateInvitation(use_public_did=True).model_dump()
response = await faber_client.post(
f"{BASE_PATH}/create-invitation", json=invite_json
)
assert response.status_code == 200
invitation = response.json()
assert_that(invitation["connection_id"]).is_not_empty()
assert_that(invitation["invitation"]).is_instance_of(dict).contains(
"@id", "@type", "recipientKeys", "serviceEndpoint"
)
assert_that(invitation["invitation_url"]).matches(r"^https?://")
accept_invite_json = AcceptInvitation(
invitation=invitation["invitation"]
).model_dump()
accept_response = await alice_member_client.post(
f"{BASE_PATH}/accept-invitation",
json=accept_invite_json,
)
connection_record = accept_response.json()
assert_that(connection_record).contains(
"connection_id", "state", "created_at", "updated_at", "invitation_key"
)
assert_that(connection_record).has_state("request-sent")
> assert await check_webhook_state(
client=alice_member_client,
topic="connections",
state="completed",
filter_map={
"connection_id": connection_record["connection_id"],
},
)
app/tests/e2e/issuer/test_connections_use_public_did.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
app/tests/util/webhooks.py:58: in check_webhook_state
event = await listener.wait_for_event(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <app.tests.util.sse_listener.SseListener object at 0x7fe4f19ea150>
field = 'connection_id', field_id = '006c2133-2b4d-479a-8305-6c2396181959'
desired_state = 'completed', timeout = Timeout(timeout=30)
async def wait_for_event(
self,
field,
field_id,
desired_state,
timeout: int = DEFAULT_LISTENER_TIMEOUT,
) -> Dict[str, Any]:
"""
Start listening for SSE events. When an event is received that matches the specified parameters.
"""
url = f"{waypoint_base_url}/{self.wallet_id}/{self.topic}/{field}/{field_id}/{desired_state}"
timeout = Timeout(timeout)
async with RichAsyncClient(timeout=timeout) as client:
async with client.stream("GET", url) as response:
async for line in response.aiter_lines():
if line.startswith("data: "):
data = json.loads(line[6:])
return data["payload"]
elif line == "" or line.startswith(": ping"):
pass # ignore newlines and pings
else:
logger.warning("Unexpected SSE line: {}", line)
> raise SseListenerTimeout("Requested filtered event was not returned by server.")
E app.tests.util.sse_listener.SseListenerTimeout: Requested filtered event was not returned by server.
app/tests/util/sse_listener.py:56: SseListenerTimeout