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 pre-authorized code flow #44

Merged
merged 29 commits into from
Aug 9, 2023
Merged

Conversation

nanderstabel
Copy link
Collaborator

@nanderstabel nanderstabel commented Jul 3, 2023

Description of change

This PR introduces the Pre-Authorized Code Flow as described in Section 3.5 of the OpenID4VCI specification. The flow is fully implemented from the perspective of the Wallet. From the Credential Issuer side there is still work to do.

  • A CredentialIssuerManager: oid4vc-manager/src/managers/credential_issuer.rs
  • A Server for CredentialIssuerManager: oid4vc-manager/src/servers/credential_issuer.rs
  • A Storage (oid4vc-manager/src/storage.rs) trait currently functions a helper trait and sort of represents the server api logic for the Credential Issuer.
  • The Authorization Code Flow is tested in oid4vc-manager/tests/oid4vci/authorization_code.rs, however it is not feature complete yet. This will be fixed in: Support OID4VCI Authorization Code Flow #46.
  • The Pre-Authorized Code Flow is tested in oid4vc-manager/tests/oid4vci/pre_authorized_code.rs.
  • All Credential Format Profiles described in Appendix E of the OpenID4VCI spec are supported, as well as a mechanism to simple add more Profiles. This all can be found in oid4vci/src/credential_format_profiles/mod.rs.
  • The Wallet implementation can be found in oid4vci/src/wallet/mod.rs.

Links to any relevant issues

#46
closes #45

How the change has been tested

Two integration tests are added for both flows. They can be found in oid4vc-manager/tests.
All/most new oid4vci related structs are extensively unit-tested (mainly (de)serialization) with the help of the oid4vci spec provided examples here: https://bitbucket.org/openid/connect/src/master/openid-4-verifiable-credential-issuance/examples/.

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 force-pushed the feat/initial-vci-support branch from 28ef59f to 5a75380 Compare July 21, 2023 07:56
@nanderstabel nanderstabel changed the title feat: add first pre-authorized code flow feat: add pre-authorized code flow Jul 25, 2023
@nanderstabel nanderstabel marked this pull request as ready for review July 25, 2023 19:23
daniel-mader
daniel-mader previously approved these changes Aug 7, 2023
oid4vc-manager/src/managers/credential_issuer.rs Outdated Show resolved Hide resolved
@nanderstabel nanderstabel merged commit 6ccc28e into dev Aug 9, 2023
@nanderstabel nanderstabel deleted the feat/initial-vci-support branch August 9, 2023 07:32
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.

Support OID4VCI Pre-Authorized Code Flow
2 participants