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: add multi-format VP/VC verifier #3553

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

paullatzelsperger
Copy link
Member

@paullatzelsperger paullatzelsperger commented Oct 19, 2023

What this PR changes/adds

This PR adds a verifier structure, which can verify ldp_vp, ldp_vc, jwt_vp and jwt_vc objects by using a flexible delegate mechanism. It is possible to mix-and-match them, for example one could have:

  • a JWT-VP, that contains one JWT-VC and one LDP-VC
  • an LDP-VP, that contains JWT-VCs
  • etc.

NB: according to their schema, LDP-VPs can only contain LDP-VCs, even if the spec doesn't really mandate that.

Why it does that

Being able to handle different formats of VPs, and different formats of VCs.

Further notes

Due to shortcomings in its implementation I abandoned the Verifier API of the iron-verifiable-credentials library (for LDP), for example, i doesn't properly handle multiple VCs in a presentation. Instead, I re-implemented the same behaviour in the EDC code base.

Ultimately, I want to get rid of the iron-verifiable-credentials lib altogether, but that will require some more work in the following areas:

  • issuance
  • test compliance: there is significant testing to be done using the official test suite.

These endeavors will happen in subsequent PRs, once the basic functionality is there.

Linked Issue(s)

Closes #3533

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@github-actions
Copy link

github-actions bot commented Oct 19, 2023

Test Results

     625 files  +  4       625 suites  +4   18m 16s ⏱️ -35s
12 741 tests +35  12 737 ✔️ +36  4 💤 ±0  0  - 1 
13 003 runs  +35  12 999 ✔️ +36  4 💤 ±0  0  - 1 

Results for commit 7af34e4. ± Comparison against base commit cba9558.

This pull request removes 110 and adds 145 tests. Note that renamed tests count towards both.
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [10] ACCEPTING, TERMINATED, java.util.concurrent.CompletableFuture@3dd2b9c1[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$643/0x00007fe83c384a60@6a1d1467
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [11] VERIFYING, TERMINATED, java.util.concurrent.CompletableFuture@3c27f72[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$644/0x00007fe83c384cc0@5cbe95b1
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [12] TERMINATING, TERMINATED, java.util.concurrent.CompletableFuture@11ad095c[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$645/0x00007fe83c384400@2c2a903f
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [1] REQUESTING, REQUESTING, java.util.concurrent.CompletableFuture@5ca22e19[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$634/0x00007fe83c387550@29d3d0fb
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [2] ACCEPTING, ACCEPTING, java.util.concurrent.CompletableFuture@3f6f9cef[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$635/0x00007fe83c3877b0@61dd1c3d
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [3] VERIFYING, VERIFYING, java.util.concurrent.CompletableFuture@343db2f6[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$636/0x00007fe83c387a10@2c815fdc
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [4] TERMINATING, TERMINATING, java.util.concurrent.CompletableFuture@2b1a901d[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$637/0x00007fe83c387c70@11bdab37
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [5] REQUESTING, TERMINATING, java.util.concurrent.CompletableFuture@222d9d4f[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$638/0x00007fe83c385000@4269aad7
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [6] ACCEPTING, TERMINATING, java.util.concurrent.CompletableFuture@38ef1a0a[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$639/0x00007fe83c385260@56f9de3b
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [7] VERIFYING, TERMINATING, java.util.concurrent.CompletableFuture@1ed9d173[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$640/0x00007fe83c3854c0@6e981e78
…
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [10] ACCEPTING, TERMINATED, java.util.concurrent.CompletableFuture@3dd2b9c1[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$643/0x00007efe603816a0@6a1d1467
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [11] VERIFYING, TERMINATED, java.util.concurrent.CompletableFuture@3c27f72[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$644/0x00007efe60381900@5cbe95b1
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [12] TERMINATING, TERMINATED, java.util.concurrent.CompletableFuture@11ad095c[Completed normally], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$645/0x00007efe60381b60@2c2a903f
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [1] REQUESTING, REQUESTING, java.util.concurrent.CompletableFuture@5ca22e19[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$634/0x00007efe60382c38@29d3d0fb
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [2] ACCEPTING, ACCEPTING, java.util.concurrent.CompletableFuture@3f6f9cef[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$635/0x00007efe60382e98@61dd1c3d
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [3] VERIFYING, VERIFYING, java.util.concurrent.CompletableFuture@343db2f6[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$636/0x00007efe603830f8@2c815fdc
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [4] TERMINATING, TERMINATING, java.util.concurrent.CompletableFuture@2b1a901d[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$637/0x00007efe60383358@11bdab37
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [5] REQUESTING, TERMINATING, java.util.concurrent.CompletableFuture@222d9d4f[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$638/0x00007efe603835b8@4269aad7
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [6] ACCEPTING, TERMINATING, java.util.concurrent.CompletableFuture@38ef1a0a[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$639/0x00007efe60383818@56f9de3b
org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest ‑ [7] VERIFYING, TERMINATING, java.util.concurrent.CompletableFuture@1ed9d173[Completed exceptionally: org.eclipse.edc.spi.EdcException: error], org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImplTest$DispatchFailureArguments$$Lambda$640/0x00007efe60383a78@6e981e78
…

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2023

Codecov Report

Attention: 107 lines in your changes are missing coverage. Please review.

Comparison is base (cba9558) 72.49% compared to head (7af34e4) 72.27%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3553      +/-   ##
==========================================
- Coverage   72.49%   72.27%   -0.22%     
==========================================
  Files         877      880       +3     
  Lines       17474    17687     +213     
  Branches      994     1019      +25     
==========================================
+ Hits        12667    12784     +117     
- Misses       4391     4466      +75     
- Partials      416      437      +21     
Files Coverage Δ
...dc/verification/jwt/SelfIssuedIdTokenVerifier.java 75.00% <ø> (ø)
...ipse/edc/security/signature/jws2020/JwkMethod.java 55.55% <100.00%> (ø)
.../edc/security/signature/jws2020/Jws2020Schema.java 89.28% <100.00%> (ø)
...edc/iam/identitytrust/IdentityAndTrustService.java 97.87% <100.00%> (+0.04%) ⬆️
...tytrust/validation/SelfIssuedIdTokenValidator.java 93.10% <ø> (ø)
...m/identitytrust/validation/rules/IsNotExpired.java 100.00% <100.00%> (ø)
.../verification/MultiFormatPresentationVerifier.java 100.00% <100.00%> (+100.00%) ⬆️
.../edc/identitytrust/model/VerifiableCredential.java 50.00% <ø> (ø)
...entitytrust/core/IatpDefaultServicesExtension.java 88.88% <0.00%> (-5.23%) ⬇️
...fiablecredentials/jwt/JwtPresentationVerifier.java 78.04% <82.14%> (ø)
... and 4 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paullatzelsperger paullatzelsperger force-pushed the feat/3533_verify_consumer_ldp-vp-vc branch 8 times, most recently from 30fe45f to 2ed8214 Compare October 21, 2023 14:49
@paullatzelsperger paullatzelsperger marked this pull request as ready for review October 21, 2023 14:49
@paullatzelsperger paullatzelsperger force-pushed the feat/3533_verify_consumer_ldp-vp-vc branch 2 times, most recently from 24845a5 to f0498cb Compare October 23, 2023 13:58
Copy link
Contributor

@bscholtes1A bscholtes1A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge work!
Few comments and questions

Copy link
Contributor

@bscholtes1A bscholtes1A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

added LDP verifier, added SignatureSuiteRegistry to host multiple SignatureSuites, made the TestDocumentLoader more generally available,

BREAKING CHANGE: the TestResourceLoader was renamed to TestDocumentLoader, and moved
@paullatzelsperger paullatzelsperger force-pushed the feat/3533_verify_consumer_ldp-vp-vc branch from a32887b to 7af34e4 Compare October 24, 2023 06:55
Copy link
Contributor

@wolf4ood wolf4ood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@paullatzelsperger paullatzelsperger merged commit e5a7685 into main Oct 24, 2023
28 checks passed
@ndr-brt ndr-brt deleted the feat/3533_verify_consumer_ldp-vp-vc branch July 24, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IATP: Verify consumer VP
4 participants