Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: W3C credential support #792

Merged
merged 29 commits into from
Sep 4, 2024
Merged

feat: W3C credential support #792

merged 29 commits into from
Sep 4, 2024

Conversation

amanji
Copy link
Contributor

@amanji amanji commented Sep 3, 2024

This PR adds support for storing W3C credential formats in aries-vcr. A number of db migrations have been added to be able to store the raw JSON data in the db along with Django code and tests to support registering W3C credential issuers and to receive W3C credentials.

amanji added 29 commits August 14, 2024 08:12
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
result = handle_vc_di_issuer(message)
response = Response(result.serialize())
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)
except Exception as err:
response = Response(str(err), status=status.HTTP_500_INTERNAL_SERVER_ERROR)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
result = handle_vc_di_credential_type(message)
response = Response(result.serialize())
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)
except Exception as err:
response = Response(str(err), status=status.HTTP_500_INTERNAL_SERVER_ERROR)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
result = handle_vc_di_credential(message)
response = Response(result)
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
except ValidationError as err:
response = Response(str(err), status=status.HTTP_422_UNPROCESSABLE_ENTITY)
except Exception as err:
response = Response(str(err), status=status.HTTP_500_INTERNAL_SERVER_ERROR)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
@amanji amanji requested review from ianco, WadeBarnes and esune September 3, 2024 15:31
@ianco
Copy link
Contributor

ianco commented Sep 3, 2024

@amanji how are you testing sending a W3C json credential?

@ianco
Copy link
Contributor

ianco commented Sep 3, 2024

Testing with the BC Reg issuer I get errors when I try to issue credentials:

vcr-agent-1   | 2024-09-03 21:32:52,419 aries_cloudagent.transport.outbound.manager ERROR Outbound message could not be delivered to http://vcr-api:8080/agentcb/topic/issue_credential/
vcr-agent-1   | Traceback (most recent call last):
vcr-agent-1   |   File "/home/indy/.local/lib/python3.9/site-packages/aiohttp/connector.py", line 1025, in _wrap_create_connection
vcr-agent-1   |     return await self._loop.create_connection(*args, **kwargs)
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1065, in create_connection
vcr-agent-1   |     raise exceptions[0]
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1050, in create_connection
vcr-agent-1   |     sock = await self._connect_sock(
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/base_events.py", line 961, in _connect_sock
vcr-agent-1   |     await self.sock_connect(sock, address)
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 500, in sock_connect
vcr-agent-1   |     return await fut
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in __await__
vcr-agent-1   |     yield self  # This tells Task to wait for completion.
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
vcr-agent-1   |     future.result()
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result
vcr-agent-1   |     raise self._exception
vcr-agent-1   |   File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 535, in _sock_connect_cb
vcr-agent-1   |     raise OSError(err, f'Connect call failed {address}')
vcr-agent-1   | ConnectionRefusedError: [Errno 111] Connect call failed ('172.19.0.10', 8080)

@amanji
Copy link
Contributor Author

amanji commented Sep 3, 2024

@amanji how are you testing sending a W3C json credential?

We can post directly to the agent webhook topic. We don't require a didcomm connection.

@amanji
Copy link
Contributor Author

amanji commented Sep 3, 2024

@ianco I did modify the docker-compose configs a bit so the services might be waiting on debugpy

@ianco
Copy link
Contributor

ianco commented Sep 3, 2024

@ianco I did modify the docker-compose configs a bit so the services might be waiting on debugpy

Should that be optional? I just need to start all the services and post some credentials (usually thousands of them).

@WadeBarnes WadeBarnes merged commit bd5b0eb into main Sep 4, 2024
3 checks passed
@amanji
Copy link
Contributor Author

amanji commented Sep 4, 2024

@ianco See PR #793 for a developer experience improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants