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: SchemasInputDescriptorFilter: broken deserialization renders generated clients unusable #1894

Conversation

rmnre
Copy link
Contributor

@rmnre rmnre commented Aug 11, 2022

What’s wrong?
The OpenAPI spec requires an Input Descriptor’s schema property to contain a SchemasInputDescriptorFilter object.
However, on deserialization, there is a preprocessing step which ensures that lists of URIs or a dict containing a oneof_filter property are accepted as well by transforming them into said object. (These alternative input formats are also included as examples in the InputDescriptors model.) Yet, input that already IS a SchemasInputDescriptorFilter object is not handled correctly during preprocessing and deserialization fails. This results in any client adhering to the spec being unable to create valid input descriptors and, ultimately, a presentation definition to use in a DIF proof request.

What has been changed?
I adjusted the preprocessing step such that input is forwarded as-is if it looks like a SchemasInputDescriptorFilter. I also extended the tests to cover deserializing the actual object.

rmnre added 2 commits August 10, 2022 14:15
Signed-off-by: Roman Reinert <[email protected]>
@swcurran swcurran requested a review from shaangill025 August 11, 2022 16:39
@codecov-commenter
Copy link

Codecov Report

Merging #1894 (7ed6e4b) into main (5a636d6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1894   +/-   ##
=======================================
  Coverage   93.66%   93.66%           
=======================================
  Files         540      540           
  Lines       34229    34231    +2     
=======================================
+ Hits        32062    32064    +2     
  Misses       2167     2167           

Copy link
Contributor

@andrewwhitehead andrewwhitehead left a comment

Choose a reason for hiding this comment

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

Thanks!

@andrewwhitehead andrewwhitehead merged commit 3783ee8 into openwallet-foundation:main Aug 30, 2022
@rmnre rmnre deleted the fix/SchemasInputDescriptorFilter-deserialization branch September 13, 2022 09:12
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.

3 participants