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: Trusted certificates hook for presentations #2052

Conversation

Tommylans
Copy link
Contributor

Gives the ability to dynamically set the trusted Certificates for a specific proof request.

Signed-off-by: Tom Lanser <tom@devv.nl>
Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: 9d1e18c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Signed-off-by: Tom Lanser <tom@devv.nl>
@Tommylans Tommylans force-pushed the feature/trusted-certificates-hook-for-presentations branch from caa7b80 to 0fddb85 Compare October 7, 2024 14:09
@@ -181,6 +181,8 @@ interface W3cVerifyPresentationOptionsBase {

export interface W3cJwtVerifyPresentationOptions extends W3cVerifyPresentationOptionsBase {
Copy link
Contributor

Choose a reason for hiding this comment

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

I had to think for a bit on what I think of this API. And I think it may be a bit confusing. Especially since correlationId is something internal to sphereon libraries, and proofRecordId it's not obvious this is for DIDcomm.

So.. what if we make it a verificationContext, which is optional, and has a unified interface that can be reused.

interface VerificationContext {
  /**
   * The `id` of the `ProofRecord` that this verification is bound to.
   */
  didcommProofRecordId?: string

  /**
   * The `id` of the `OpenId4VcVerificationSessionRecord` that this verification is bound to.
   */
   openId4VcVerificationSessionId?: string
}

I think we could also extract the trustedCertificates, but it would be good to also add these, as then you can pass them when calling the top-level APIs (w3c verification) (i think Sd-JWT is already possible right?)

And we will only call the get trusted certificates method if you didn't provide certificates (so if you call sdJWt.verify with certificates we won't call it). But otherwise we will

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can also add the already given trustedCertificates here so it's the choice by the user to combine it with the hook ones or completely override them

@TimoGlastra
Copy link
Contributor

I like the general appraoch. Just some commetns to make it a bit more specific / unified and so we can extend it with other records as well in the future (e.g. issuance will also need this probably)

@TimoGlastra
Copy link
Contributor

one final remark, otherwise LGTM!

@TimoGlastra TimoGlastra mentioned this pull request Oct 8, 2024
Signed-off-by: Tom Lanser <tom@devv.nl>
@TimoGlastra TimoGlastra merged commit 08a485b into openwallet-foundation:main Oct 8, 2024
13 of 14 checks passed
@Tommylans Tommylans deleted the feature/trusted-certificates-hook-for-presentations branch October 8, 2024 16:36
auer-martin pushed a commit to auer-martin/aries-framework-javascript that referenced this pull request Oct 15, 2024
…ion#2052)

Signed-off-by: Tom Lanser <tom@devv.nl>
Signed-off-by: Martin Auer <martin.auer97@gmail.com>
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.

2 participants