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

feat: add Batch Credential Endpoint #51

Merged
merged 37 commits into from
Aug 9, 2023
Merged

Conversation

nanderstabel
Copy link
Collaborator

@nanderstabel nanderstabel commented Aug 4, 2023

Description of change

Support for the OpenID4VCI Batch Credential : credential

Notable changes:

  • support for batch credential request for both Wallet and CredentialIssuer (Server).
  • Regarding the OpenID4VCI extension points: CredentialFormats now needs a generic type (default is WithParameters:
pub enum CredentialFormats<C = WithParameters>
where
    C: FormatExtension + DeserializeOwned,

This ensure that any datatype that has a format field, also includes a credentialformat-specific field(s). E.g. for jwt_vc_json there need to be a credential_definition field.

However, in the (batch) credential response, instead of this additional credentialformat-specific field(s) there needs to be a credential field with a credentialformat-specific Credential. In this case the additional generic type for CredentialFormats needs to be CredentialFormats<WithCredential>. At the moment this type is still defaulted to serde_json::Value for all credential formats, but this will change in the future.

Links to any relevant issues

fixes #50

How the change has been tested

The Batch Credential Flow is tested in oid4vc-manager/tests/oid4vci/pre_authorized_code.rs.
By using:

#[rstest::rstest]
#[case(false)]
#[case(true)]

oid4vc-manager/tests/oid4vci/pre_authorized_code.rs now test both single credential flow and batch credential flow.

Serializing is tested in: oid4vci/src/credential_response.rs

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 changed the base branch from feat/initial-vci-support to dev August 5, 2023 19:48
@nanderstabel nanderstabel changed the title Feat/batch credential feat: add Batch Credential Endpoint Aug 5, 2023
@nanderstabel nanderstabel changed the base branch from dev to feat/initial-vci-support August 5, 2023 19:50
@nanderstabel nanderstabel marked this pull request as ready for review August 7, 2023 07:17
@nanderstabel nanderstabel changed the base branch from feat/initial-vci-support to dev August 7, 2023 07:18
@nanderstabel nanderstabel merged commit b264a56 into dev Aug 9, 2023
@nanderstabel nanderstabel deleted the feat/batch-credential branch August 9, 2023 08:57
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.

Add support for Batch Credential Endpoint
2 participants