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

fix: integratin presentation exchange SDJWT verification with disclosures #388

Closed

Conversation

elribonazo
Copy link
Contributor

Description:

We are integrating the SDJWT disclosure frames back from the pollux plugins migration.
Our tests are now able to create the presentation submission and validate the disclosed attributes accordingly.

I've left a comment in the code so that we remember the following:
Our library provider for SDJWT, uses requiredClaims attribute in the verify function to throw an error if the claim is not disclosed by the user.
In our case, we won't be passing any required claim, our process relies on:

 const claims = await ctx.SDJWT.reveal(
      presentation.core.jwt?.payload ?? {},
      presentation.core.disclosures ?? [],
    );

To disclose any available field and then we will process and validate it through the validateInputDescriptor function in PresentationVerify task.

Checklist:

  • My PR follows the contribution guidelines of this project
  • My PR is free of third-party dependencies that don't comply with the Allowlist
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked the PR title to follow the conventional commit specification

…ure frames

Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
@elribonazo elribonazo linked an issue Feb 24, 2025 that may be closed by this pull request
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
@coveralls
Copy link

coveralls commented Feb 24, 2025

Pull Request Test Coverage Report for Build 13570729507

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 25 of 41 (60.98%) changed or added relevant lines in 3 files are covered.
  • 27 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.08%) to 73.705%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/pollux/utils/jwt/CreateSDJWT.ts 13 18 72.22%
src/pollux/utils/jwt/SDJWT.ts 10 21 47.62%
Files with Coverage Reduction New Missed Lines %
src/edge-agent/protocols/proofPresentation/RequestPresentation.ts 4 81.58%
src/edge-agent/protocols/proofPresentation/Presentation.ts 5 67.74%
src/edge-agent/protocols/proofPresentation/ProposePresentation.ts 5 67.74%
src/edge-agent/helpers/ProtocolHelpers.ts 13 12.9%
Totals Coverage Status
Change from base Build 13454539723: -0.08%
Covered Lines: 3374
Relevant Lines: 4349

💛 - Coveralls

@@ -73,7 +73,7 @@ export class CreateJWT extends Task<string, Args> {
* @param privateKey
* @returns {string} kid (key identifier)
*/
private async getSigningKid(ctx: Task.Context, did: Domain.DID, privateKey: Domain.PrivateKey) {
async getSigningKid(ctx: Task.Context, did: Domain.DID, privateKey: Domain.PrivateKey) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should remain private

Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
@elribonazo elribonazo requested a review from a team as a code owner February 27, 2025 16:03
Signed-off-by: Francisco Javier Ribo Labrador <[email protected]>
@elribonazo
Copy link
Contributor Author

Closing this PR as will be doing all the work for PresentationVerify in another PR

@elribonazo elribonazo closed this Feb 27, 2025
@elribonazo elribonazo deleted the 366-presentation-verification---sdjwt-required-claims branch February 27, 2025 16:26
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.

Presentation Verification - SDJWT Required Claims
3 participants