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: DIDComm V2 messaging support #1458

Merged

Conversation

Artemkaaas
Copy link
Contributor

This is follow up PR of: #1096
Chanegs:

  • Merged with the main branch and solved conflicts
  • Used combination of Askar and AFJ methods to support DIDComm V2 messaging instead of using Sicpa library
    • Implemented required crypto using Askar (Inds-SDK wallet do not support DIDComm V2)
    • Implemented required didcomm logic using existing AFJ (DidDocument resolving, Forward wrapping)

karimStekelenburg and others added 30 commits January 9, 2023 06:28
Signed-off-by: Karim Stekelenburg <karim@animo.id>
…1196)

Bumps [luxon](https://github.com/moment/luxon) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/moment/luxon/releases)
- [Changelog](https://github.com/moment/luxon/blob/master/CHANGELOG.md)
- [Commits](moment/luxon@1.28.0...1.28.1)

---
updated-dependencies:
- dependency-name: luxon
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Timo Glastra <timo@animo.id>
Co-authored-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
* docs: update readme packages

Signed-off-by: Karim Stekelenburg <karim@animo.id>
Co-authored-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Timo Glastra <timo@animo.id>

Signed-off-by: Timo Glastra <timo@animo.id>
Work funded by the Government of Ontario.

* feat: add openid4vc-client package

Signed-off-by: Karim Stekelenburg <karim@animo.id>
Co-authored-by: Timo Glastra <timo@animo.id>
…1210)

Signed-off-by: Karim Stekelenburg <karim@animo.id>
…ation#1215)

Signed-off-by: Grammatopoulos Athanasios Vasileios <GramThanos@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Timo Glastra <timo@animo.id>
…undation#1160)

work funded by the Government of Ontario

Signed-off-by: Victor Anene <victor@animo.id>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
This PR adds support for the `pre-authorized` OpenID for Verifiable Credentials issuance flow to the new `openid4vc-client` module.

Here are some highlights of the work:
- Allows the user to execute the entire `pre-authorized` flow by calling a single method.
- Adds a happy-flow test
    - HTTP(S) requests and responses are mocked using a network mocking library called [nock](https://github.com/nock/nock)
    - Because the JSON-LD credential that is received is expanded by the `W3cCredentialService`, I've added a few new contexts to our test document loader.
    - Not-so-happy-flow tests will be added later on. If you have any suggestions for edge cases that deserve testing, feel free to drop a comment. 
- Modifies the `JwsService`
    - The `JwsService` was geared towards a very specific use case. I've generalized its API so it's usable for a wider range of applications.
    - All pre-existing tests and calls to the `JwsService` have been updated.

It's worth noting that I have had to add some `@ts-ignore` statements here and there to get around some incomplete types in the `OpenID4VCI-Client` library we're using. Once these issues have been resolved in the client library, they will be removed.

**Work funded by the government of Ontario**

---------

Signed-off-by: Karim Stekelenburg <karim@animo.id>
Co-authored-by: Timo Glastra <timo@animo.id>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
berendsliedrecht and others added 26 commits April 4, 2023 16:01
…ion#1422)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>
build: test large builders

Signed-off-by: Ry Jones <ry@linux.com>
Signed-off-by: DaevMithran <daevmithran1999@gmail.com>
)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: martin auer <martin.auer97@gmail.com>
)

Signed-off-by: martin auer <martin.auer97@gmail.com>
* ci: downgrade ubuntu docker image

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* use new runners

Signed-off-by: Ry Jones <ry@linux.com>

---------

Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Ry Jones <ry@linux.com>
Co-authored-by: Ry Jones <ry@linux.com>
Signed-off-by: Timo Glastra <timo@animo.id>
# Conflicts:
#	demo/package.json
#	demo/src/BaseAgent.ts
#	packages/action-menu/package.json
#	packages/anoncreds/src/protocols/credentials/v1/V1CredentialProtocol.ts
#	packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolCred.test.ts
#	packages/anoncreds/src/protocols/credentials/v1/__tests__/V1CredentialProtocolProposeOffer.test.ts
#	packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts
#	packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts
#	packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts
#	packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts
#	packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts
#	packages/anoncreds/src/protocols/proofs/v1/__tests__/V1ProofProtocol.test.ts
#	packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts
#	packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts
#	packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts
#	packages/bbs-signatures/tests/bbs-key-provider.e2e.test.ts
#	packages/bbs-signatures/tests/bbs-signatures.e2e.test.ts
#	packages/core/src/agent/AgentMessage.ts
#	packages/core/src/agent/EnvelopeService.ts
#	packages/core/src/agent/MessageHandlerRegistry.ts
#	packages/core/src/agent/MessageReceiver.ts
#	packages/core/src/agent/MessageSender.ts
#	packages/core/src/agent/TransportService.ts
#	packages/core/src/agent/__tests__/Dispatcher.test.ts
#	packages/core/src/crypto/__tests__/JwsService.test.ts
#	packages/core/src/crypto/index.ts
#	packages/core/src/crypto/signing-provider/SigningProviderRegistry.ts
#	packages/core/src/decorators/attachment/V1Attachment.ts
#	packages/core/src/decorators/service/ServiceDecoratorExtension.ts
#	packages/core/src/decorators/signature/SignatureDecoratorUtils.test.ts
#	packages/core/src/index.ts
#	packages/core/src/modules/basic-messages/messages/BasicMessage.ts
#	packages/core/src/modules/connections/ConnectionsApi.ts
#	packages/core/src/modules/connections/DidExchangeProtocol.ts
#	packages/core/src/modules/connections/__tests__/ConnectionService.test.ts
#	packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts
#	packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts
#	packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts
#	packages/core/src/modules/connections/protocols/trust-ping/v1/messages/TrustPingMessage.ts
#	packages/core/src/modules/connections/protocols/trust-ping/v1/messages/TrustPingResponseMessage.ts
#	packages/core/src/modules/connections/services/ConnectionService.ts
#	packages/core/src/modules/connections/services/TrustPingService.ts
#	packages/core/src/modules/credentials/CredentialsApi.ts
#	packages/core/src/modules/credentials/formats/CredentialFormatService.ts
#	packages/core/src/modules/credentials/formats/CredentialFormatServiceOptions.ts
#	packages/core/src/modules/credentials/formats/__tests__/IndyCredentialFormatService.test.ts
#	packages/core/src/modules/credentials/formats/indy/IndyCredentialFormatService.ts
#	packages/core/src/modules/credentials/formats/indy/models/IndyCredentialView.ts
#	packages/core/src/modules/credentials/formats/jsonld/JsonLdCredentialFormatService.ts
#	packages/core/src/modules/credentials/formats/jsonld/__tests__/JsonLdCredentialFormatService.test.ts
#	packages/core/src/modules/credentials/protocol/BaseCredentialProtocol.ts
#	packages/core/src/modules/credentials/protocol/CredentialProtocol.ts
#	packages/core/src/modules/credentials/protocol/CredentialProtocolOptions.ts
#	packages/core/src/modules/credentials/protocol/v2/V2CredentialProtocol.ts
#	packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolCred.test.ts
#	packages/core/src/modules/credentials/protocol/v2/__tests__/V2CredentialProtocolOffer.test.ts
#	packages/core/src/modules/credentials/protocol/v2/messages/V2IssueCredentialMessage.ts
#	packages/core/src/modules/credentials/protocol/v2/messages/V2OfferCredentialMessage.ts
#	packages/core/src/modules/credentials/protocol/v2/messages/V2ProposeCredentialMessage.ts
#	packages/core/src/modules/credentials/protocol/v2/messages/V2RequestCredentialMessage.ts
#	packages/core/src/modules/dids/__tests__/dids-registrar.e2e.test.ts
#	packages/core/src/modules/dids/__tests__/peer-did.test.ts
#	packages/core/src/modules/dids/methods/sov/IndySdkSovDidRegistrar.ts
#	packages/core/src/modules/dids/methods/sov/__tests__/IndySdkSovDidRegistrar.test.ts
#	packages/core/src/modules/dids/methods/sov/__tests__/IndySdkSovDidResolver.test.ts
#	packages/core/src/modules/discover-features/services/DiscoverFeaturesService.ts
#	packages/core/src/modules/ledger/__tests__/LedgerApi.test.ts
#	packages/core/src/modules/ledger/services/IndyLedgerService.ts
#	packages/core/src/modules/message-pìckup/protocol/v1/messages/V1BatchMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v1/messages/V1BatchPickupMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v2/messages/V2DeliveryRequestMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v2/messages/V2MessageDeliveryMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v2/messages/V2MessagesReceivedMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v2/messages/V2StatusMessage.ts
#	packages/core/src/modules/message-pìckup/protocol/v2/messages/V2StatusRequestMessage.ts
#	packages/core/src/modules/oob/OutOfBandApi.ts
#	packages/core/src/modules/oob/__tests__/OutOfBandService.test.ts
#	packages/core/src/modules/oob/protocols/v1/OutOfBandService.ts
#	packages/core/src/modules/oob/repository/OutOfBandRecord.ts
#	packages/core/src/modules/proofs/ProofService.ts
#	packages/core/src/modules/proofs/ProofsApi.ts
#	packages/core/src/modules/proofs/formats/ProofFormatServiceOptions.ts
#	packages/core/src/modules/proofs/formats/indy/IndyProofFormatService.ts
#	packages/core/src/modules/proofs/formats/indy/IndyProofFormatsServiceOptions.ts
#	packages/core/src/modules/proofs/formats/models/ProofAttachmentFormat.ts
#	packages/core/src/modules/proofs/formats/models/ProofFormatServiceOptions.ts
#	packages/core/src/modules/proofs/protocol/v1/V1ProofService.ts
#	packages/core/src/modules/proofs/protocol/v1/messages/V1RequestPresentationMessage.ts
#	packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts
#	packages/core/src/modules/proofs/protocol/v2/__tests__/V2ProofProtocol.test.ts
#	packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationMessage.ts
#	packages/core/src/modules/proofs/protocol/v2/messages/V2PresentationProblemReportMessage.ts
#	packages/core/src/modules/proofs/protocol/v2/messages/V2ProposalPresentationMessage.ts
#	packages/core/src/modules/proofs/protocol/v2/messages/V2RequestPresentationMessage.ts
#	packages/core/src/modules/routing/MediatorApi.ts
#	packages/core/src/modules/routing/__tests__/mediation.test.ts
#	packages/core/src/modules/routing/messages/ForwardMessage.ts
#	packages/core/src/modules/routing/protocol/pickup/v1/MessagePickupService.ts
#	packages/core/src/modules/routing/protocol/pickup/v2/V2MessagePickupService.ts
#	packages/core/src/modules/routing/services/MediationRecipientService.ts
#	packages/core/src/modules/routing/services/__tests__/MediationRecipientService.test.ts
#	packages/core/src/modules/routing/services/__tests__/V2MessagePickupService.test.ts
#	packages/core/src/modules/vc/__tests__/W3cCredentialService.test.ts
#	packages/core/src/storage/InMemoryMessageRepository.ts
#	packages/core/src/storage/didcomm/DidCommMessageRecord.ts
#	packages/core/src/storage/migration/__tests__/__snapshots__/0.1.test.ts.snap
#	packages/core/src/transport/HttpOutboundTransport.ts
#	packages/core/src/transport/WsOutboundTransport.ts
#	packages/core/src/types.ts
#	packages/core/src/utils/__tests__/indyProofRequest.test.ts
#	packages/core/src/utils/attachment.ts
#	packages/core/src/utils/messageType.ts
#	packages/core/src/wallet/IndyWallet.test.ts
#	packages/core/src/wallet/Wallet.ts
#	packages/core/tests/helpers.ts
#	packages/core/tests/multi-protocol-version.test.ts
#	packages/core/tests/oob-mediation-provision.test.ts
#	packages/core/tests/oob.test.ts
#	packages/core/tests/v1-connectionless-proofs.test.ts
#	packages/core/tests/v2-connectionless-proofs.test.ts
#	packages/indy-sdk/src/ledger/__tests__/IndySdkPoolService.test.ts
#	packages/indy-sdk/src/storage/__tests__/IndySdkStorageService.test.ts
#	packages/indy-sdk/src/wallet/IndySdkWallet.ts
#	packages/question-answer/package.json
#	packages/question-answer/src/__tests__/QuestionAnswerService.test.ts
#	yarn.lock
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Artemkaaas <artem.ivanov@dsr-corporation.com>
Signed-off-by: Artemkaaas <artem.ivanov@dsr-corporation.com>
# Conflicts:
#	packages/askar/src/wallet/AskarWallet.ts
@Artemkaaas Artemkaaas requested a review from a team as a code owner May 16, 2023 14:38
@Artemkaaas Artemkaaas changed the title DIDComm V2 messaging support feat: DIDComm V2 messaging support May 16, 2023
@TimoGlastra
Copy link
Contributor

As there's too much changes to review, I'm going to merge this and review from the didcomm v2 branch.

Thanks for all the effort @Artemkaaas

@TimoGlastra TimoGlastra merged commit d6e2b67 into openwallet-foundation:feat/didcomm-v2 May 16, 2023
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.