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

Fully specializable credentials. #577

Merged
merged 3 commits into from
Jul 11, 2024

Conversation

timothee-haudebourg
Copy link
Contributor

The SpecializedJsonCredential type allows an application to define a new credential type by customizing the input type parameters. However for now only the credential subject type, context and type can be customized, whereas some applications may want to customize others components like the credential status type.

This PR adds all the credential components as parameters to the SpecializedJsonCredential type, with defaults matching the current type for each component (so it does not impact existing code).

Copy link
Member

@sbihel sbihel left a comment

Choose a reason for hiding this comment

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

+1 to using full names for generic parameters instead of one-letter names 😬

Overall, I don't feel strongly about it -- but I do agree that only having subject being specialised is a bit odd. In my opinion, with this, the main and potentially only benefit is the (de)serialisation aspect, which saves a few lines of code for consumers -- but maybe I'm missing some use-cases.

crates/claims/crates/vc/src/v1/syntax/credential.rs Outdated Show resolved Hide resolved
@timothee-haudebourg timothee-haudebourg merged commit 4917d99 into main Jul 11, 2024
3 checks passed
@timothee-haudebourg timothee-haudebourg deleted the fully-specialized-credentials branch July 11, 2024 09:27
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.

2 participants