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: make proof_types_supported requirement optional #84

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

nanderstabel
Copy link
Collaborator

Description of change

Prior to this PR, the Wallet always expects the Credential Issuer to supply the proof_types_supported parameter to the Credential Configuration in its Credential Issuer Metadata. However, proof_types_supported is an optional field hence why this fix was needed.

In this update, the Wallet will choose its own preferred signing algorithm to sign the Proof if there is no proof_types_supported parameter present in the Credential Issuer Metadata. Only when there is a proof_types_supported parameter present AND the Wallet can not match it to its own supported signing algorithm it will throw an error.

If the Wallet can make a match, then it will use the matching signing algorithm to sign the Proof as usual.

Links to any relevant issues

https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-7.2-2.2.1

How the change has been tested

Added four unit tests:

select_signing_algorithm_returns_first_supported_signing_algorithm_when_no_proof_types_supported
select_signing_algorithm_returns_error_when_issuers_supported_proof_type_is_not_supported
select_signing_algorithm_returns_error_when_it_cannot_find_matching_signing_algorithm
select_signing_algorithm_returns_matching_signing_algorithm

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • 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
  • New and existing unit tests pass locally with my changes

@nanderstabel nanderstabel self-assigned this Dec 9, 2024
@nanderstabel nanderstabel added Enhancement New feature or improvement to an existing feature Bug Something isn't working and removed Enhancement New feature or improvement to an existing feature labels Dec 9, 2024
@nanderstabel nanderstabel merged commit 7be5b72 into dev Dec 10, 2024
1 check passed
@nanderstabel nanderstabel deleted the fix/optional-proof-types-supported branch December 10, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants