Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update OpenID4VCI to WG Draft 13 (#64)
* fix: remove `iota_method` * test: add test-utils feature, bump ed25519-dalek dep * feat: add `JsonObject` * refactor: remove `serialize_unit_struct`, use `#[serde(tag = ...)]` instead * style: use `JsonObject` * feat: add `Extension` trait * feat: implement `Extension` trait for `siopv2` * feat: implement `Extension` trait for `oid4vp` * fix: update manager * fix: use `MustBe` macro to enforce `response_type` values * style: sort dependencies * fix: remove `siopv2_oid4vp` * feat: derive `Clone` trait for request handlers * feat: change `authorization_server` to `authoriation_servers` As described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.2 * feat: add `credential_response_encryption_alg_values_supported` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.6 * feat: add `credential_response_encryption_enc_values_supported` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.7 * feat: add `require_credential_response_encryption` as defined here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.8 * feat: add `credential_identifiers_supported` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.9 * tests: update example files for `CredentialIssuerMetadata` The example files are taken from here: https://github.com/openid/OpenID4VCI/tree/4ae490afd6955829b4769cb1b547e9e62c824659/examples `oid4vci/tests/examples/issuer_metadata.json` is removed as it does not comply anymore with the new `CredentialIssuerMetadata` struct. * feat: removed `id` field from `CredentialsSupportedObject` struct as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.11.1 Also changed `Option<Vec<T>>` to `Vec<T>` for simplicity since `#[serde(skip_serializing_if = "Vec::is_empty", default)]` ensures the field is not serialized if it's empty. * test: fix unit tests * feat: change `credentials_supported` to a hashmap as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-10.2.3-2.11.1 * test: update tests files test files are taken from here: https://github.com/openid/OpenID4VCI/tree/1b7cd7426c42dd8d78db3261ed2e85a520ec7041/examples * feat: change `credentials` to a vector of Strings as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-4.1.1-2.2 * test: update integration tests * feat: add `authorization_server` to `authorization_code` Grant Type as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-4.1.1-4.1.2.2 * feat: add `authorization_server` to `pre-authorized_code` Grant Type as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-4.1.1-4.2.2.4 * chore: add TODO's for adding `authorization_details` to `TokenResponse` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-6.2-4.3.1 and for `credential_identifier` here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-7.2-2.3 * chore: add TODO for adding fields to CredentialRequest related to JWE as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#section-7.2-2.4 * fix: add `type` field to `AuthorizationDetailsObject` struct In the previous solution using: `#[serde(tag = "type", rename = "openid_credential")]`. instances of this struct were correctly serialized, but deserialization was not working as expected. This was due to the fact that serde(tag) does not work when deserializing. * chore: update description links, rename types * chore: apply cargo clippy warnings * docs: README files with links to the OID4VCI WG Draft 12 * test: update example files for OID4VCI WG Draft 13 example files are taken from here: https://github.com/openid/OpenID4VCI/tree/ade0793a988dc1aafb3907643113ebf67396970b/examples * feat: rename `credentials` to `credential_configuration_ids` in `CredentialOfferParameters` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-4.1.1-2.2 * feat: add support for `TransactionCode` * `user_pin_required` is replaced for `tx_code` in the `pre-authorized_code` grant type. * Corresponding changes are made in the unit tests * feat: rename `user_pin` to `tx_code` in `TokenRequest` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-6.1-3.2 * chore: update TODO as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-7.2-2.4.1 * feat: remove `format` field from `CredentialResponse` struct the `format` field is not used anymore in the `CredentialResponse` struct, as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#name-credential-response * feat: add optional `notification_id` field to `CredentialResponse` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-7.3-6.5 * feat: add optional `notification_endpoint` field to `CredentialIssuerMetadata` struct as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.6 * feat: add `CredentialResponseEncryption` struct This replaces some encryption related fields in `CredentialIssuerMetadata` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.7.1 * feat: add optional `signed_metadata` field to `CredentialIssuerMetata` struct as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.9 * feat: rename `credentials_supported` to `credential_configurations_supported` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.11.1 * feat: rename `cryptographic_suites_supported` to `credential_signing_alg_values_supported` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.11.2.4 * feat: change `proof_types_supported` to a `HashMap<ProofType, KeyProofMetadata>` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.11.2.5.1 * feat: rename `CredentialsSupportedObject` to `CredentialConfigurationSupportedObject` as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#section-11.2.3-2.11.1 * test: update testfiles to reflect the new `CredentialConfigurationsSupportedObject` struct * test: remove deleted testfiles and test that is not supported yet. * test: update tests in `credential_configurations_supported.rs` to match with testfiles * test: update test in `credential_issuer_metadata.rs` to match corresponding test file * feat: add optional `credential_configuration_id` field to `AuthorizationRequestDetails` * fix testfiles * as described here: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-13.html#name-request-issuance-of-a-certa * chore: update links to OpenID4VCI WG Draft 13 * chore: update links to example files * chore: remove periods behind URLs in comments
- Loading branch information