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

Separate generic format definitions and the format specific interfaces #76

Open
TimoGlastra opened this issue Nov 15, 2023 · 1 comment

Comments

@TimoGlastra
Copy link
Collaborator

TimoGlastra commented Nov 15, 2023

Currently the code is all a bit intertwined for different formats. This worked okay, but with different formats having different structures, it's become a bit hard to manage. This has mainly come up with adding support for the SD-JWT format, and that uses credential_definition.type , while JWT VC uses types (top level and plural), and JSON-LD uses credentialDefinition.types (camelCase and plural).

Should there have been more consistency between these types? Definitely! but it shows that we shouldn't assume the format specific fields between formats will be similar, and thus to improve maintainability of this library, I think all format specific handling should be separated form the general protocol implementation.

Thus we have the base offer/request etc.. interfaces and handling, and then for each format you need to define the specific offer/request/issuer metadata interfaces, as well as some functions that can e.g. verify a request, or transform an offer of that specific format into a request. This could be an interface that is implemented with some common methods.

This would allow adding new formats without needing to hardcode them in this library, and would make it easier to see what is base OID4VCI code, and what is custom format specific logic

Thoughts on this?

@nklomp
Copy link
Contributor

nklomp commented Nov 23, 2023

Yes, makes sense at this point.

Maybe we can nicely combine this with #75 as there will be a new version which again has different behavior for the credential offers to metadata resolution/mapping

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

No branches or pull requests

2 participants