impierce / openid4vc

Rust implementation of the OpenID4VC standards. The library will offer implementations for SIOPv2, OpenID4VP and OpenID4VCI.
https://www.impierce.com
Apache License 2.0
28 stars 3 forks source link

feat: add Batch Credential Endpoint #51

Closed nanderstabel closed 1 year ago

nanderstabel commented 1 year ago

Description of change

Support for the OpenID4VCI Batch Credential : credential

Notable changes:

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.