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

update vp token definition #18

Conversation

Ryanmtate
Copy link
Contributor

@Ryanmtate Ryanmtate commented Sep 18, 2024

This PR introduces updates to the VpToken definition:

pub enum VpToken {
    Single(Vec<u8>),
    SingleAsMap(Json),
    Many(Vec<VpToken>),
}

The PR includes a TryFrom<VerifiablePresentation> for VpToken method for convenience.

Includes a TryFrom<AnyJsonPresentation> for VpToken as a convenience method.

@Ryanmtate Ryanmtate force-pushed the skit-562-update-oid4vp-rs-vptoken-definition-per-the-specification branch 3 times, most recently from e82c109 to 168288e Compare September 18, 2024 22:43
Base automatically changed from feat/bump-ssi-version-0.8.1 to main September 19, 2024 14:15
@Ryanmtate Ryanmtate force-pushed the skit-562-update-oid4vp-rs-vptoken-definition-per-the-specification branch from 168288e to eeffa6c Compare September 19, 2024 14:21
src/core/response/parameters.rs Outdated Show resolved Hide resolved
src/core/response/parameters.rs Outdated Show resolved Hide resolved
src/core/response/parameters.rs Outdated Show resolved Hide resolved
src/core/response/parameters.rs Outdated Show resolved Hide resolved
src/core/response/parameters.rs Outdated Show resolved Hide resolved
@Ryanmtate Ryanmtate force-pushed the skit-562-update-oid4vp-rs-vptoken-definition-per-the-specification branch 3 times, most recently from 3dcdb7e to 0766bd2 Compare September 20, 2024 19:56
@Ryanmtate Ryanmtate changed the base branch from main to skit-566-bumppatch-ssi-version-pending-release September 20, 2024 19:56
src/core/response/parameters.rs Outdated Show resolved Hide resolved
src/core/response/parameters.rs Outdated Show resolved Hide resolved
type Error = Error;

fn try_from(vp: AnyJsonPresentation) -> Result<Self, Self::Error> {
Ok(VpToken::Single(serde_json::to_vec(&vp)?))
Copy link
Collaborator

Choose a reason for hiding this comment

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

A JsonPresentation is a W3C Verifiable Presentation, which is a JSON object. Therefore it should be represented as VpToken::SingleAsMap (example in the OID4VP spec).

@Ryanmtate Ryanmtate changed the base branch from skit-566-bumppatch-ssi-version-pending-release to main September 25, 2024 03:06
Ryanmtate and others added 5 commits September 24, 2024 20:07
Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>

use base64 url encoding

Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>

remove vp builder, use AnyJsonPresentation

Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>

parse VC from VerifiableCredential to SpeicalizedJsonCredential to use JsonPresentation

Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>

update comments

Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>

fix from any json presentation for vp token impl

Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>
Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>
Co-authored-by: Jacob <jacob.ward@spruceid.com>
Co-authored-by: Jacob <jacob.ward@spruceid.com>
Signed-off-by: Ryan Tate <ryan.michael.tate@gmail.com>
@Ryanmtate Ryanmtate force-pushed the skit-562-update-oid4vp-rs-vptoken-definition-per-the-specification branch from 80a5f6b to cdf2a89 Compare September 25, 2024 03:07
tests/jwt_vp.rs Outdated Show resolved Hide resolved
Signed-off-by: Ryan Tate <rmt@spruceid.local>
@Ryanmtate Ryanmtate merged commit 6516eb8 into main Sep 30, 2024
2 checks passed
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.

3 participants