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

Use encoded/decoded string when serializing / deserializing #11

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

UMR1352
Copy link
Contributor

@UMR1352 UMR1352 commented Mar 4, 2024

Description of change

Calling serde::deserialize should work the same as SdJwt::parse and serde::serialize should work as SdJwt::presentation but RN they just serialize or deserialize the inner structure of SdJwt. This PR fixes this behaviour.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

  • 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

  • I have checked that new and existing unit tests pass locally with my changes

  • I have updated the CHANGELOG.md, if my changes are significant enough

@UMR1352 UMR1352 added the bug Something isn't working label Mar 4, 2024
@UMR1352 UMR1352 requested a review from abdulmth March 4, 2024 18:51
Copy link
Contributor

@abdulmth abdulmth left a comment

Choose a reason for hiding this comment

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

Looks good, it would be nice if we have a test for that

@UMR1352
Copy link
Contributor Author

UMR1352 commented Mar 6, 2024

On second thought I removed the implementation of Serialize and Deserialize from SdJwt. The problem is that they depend on the representation of the implementer of Serializer and Deserializer. For instance when using serde_json, an sd_jwt encoded value is represented by a JSON string which requires data to be enclosed in double quotes (") and we don't want that. @abdulmth @eike-hass @wulfraem any thoughts?

@UMR1352 UMR1352 merged commit b04472f into main Mar 12, 2024
7 checks passed
@UMR1352 UMR1352 deleted the fix/serialize-deserialize-as-encoder-decoder branch March 12, 2024 08:19
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