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

SD-JWT VC implementation #1413

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

SD-JWT VC implementation #1413

wants to merge 23 commits into from

Conversation

UMR1352
Copy link
Contributor

@UMR1352 UMR1352 commented Sep 20, 2024

Implementation of SD-JWT VC draft 5.

Todo

  • Tests, tests, tests
  • Integration with credentials created through identity_credential
  • Verification & validation
  • Properly encode Rendering Metadata

@UMR1352 UMR1352 added Enhancement New feature or improvement to an existing feature Added A new feature that requires a minor release. Part of "Added" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Sep 20, 2024
@UMR1352 UMR1352 self-assigned this Sep 20, 2024
@nanderstabel
Copy link
Collaborator

Hi I was just wondering what is the current status of this work :)

Currently when using this branch like this:

[dependencies]
identity_credential = { git = "https://github.com/iotaledger/identity.rs", branch = "feat/sd-jwt-vc", default-features = false, features = [
    "validator",
    "credential",
    "presentation",
    "domain-linkage",
    "sd-jwt-vc"
] }

which results in a couple of compilation errors:

$ cargo check 
    Checking identity_credential v1.3.1 (https://github.com/iotaledger/identity.rs?branch=feat/sd-jwt-vc#654b188e)
error[E0433]: failed to resolve: use of undeclared crate or module `futures`
 --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:1:5
  |
1 | use futures::future::BoxFuture;
  |     ^^^^^^^ use of undeclared crate or module `futures`

error[E0433]: failed to resolve: use of undeclared crate or module `futures`
 --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:2:5
  |
2 | use futures::future::FutureExt;
  |     ^^^^^^^ use of undeclared crate or module `futures`

error[E0308]: mismatched types
   --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/builder.rs:233:46
    |
233 |       .fold(builder, |builder, (key, value)| builder.insert_claim(key, value));
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `SdJwtBuilder<H>`, found `Result<SdJwtBuilder<H>, Error>`
    |
    = note: expected struct `SdJwtBuilder<_>`
                 found enum `std::result::Result<SdJwtBuilder<_>, sd_jwt_payload::Error>`
help: consider using `Result::expect` to unwrap the `std::result::Result<SdJwtBuilder<H>, sd_jwt_payload::Error>` value, panicking if the value is a `Result::Err`
    |
233 |       .fold(builder, |builder, (key, value)| builder.insert_claim(key, value).expect("REASON"));
    |                                                                              +++++++++++++++++

error[E0599]: no method named `boxed` found for `async` block `{async block@/home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:105:3: 105:13}` in the current scope
   --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:153:4
    |
105 | /   async move {
106 | |     // Check if current type has already been checked.
107 | |     let is_type_already_checked = passed_types.contains(&current_type);
108 | |     if is_type_already_checked {
...   |
152 | |   }
153 | |   .boxed()
    | |   -^^^^^ method not found in `{async block@/home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:105:3: 105:13}`
    | |___|
    |

Some errors have detailed explanations: E0308, E0433, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `identity_credential` (lib) due to 4 previous errors

I have quickly resolved them a couple of weeks ago myself just to make it work (see this).

@eike-hass
Copy link
Collaborator

Hi I was just wondering what is the current status of this work :)

Currently when using this branch like this:

[dependencies]
identity_credential = { git = "https://github.com/iotaledger/identity.rs", branch = "feat/sd-jwt-vc", default-features = false, features = [
    "validator",
    "credential",
    "presentation",
    "domain-linkage",
    "sd-jwt-vc"
] }

which results in a couple of compilation errors:

$ cargo check 
    Checking identity_credential v1.3.1 (https://github.com/iotaledger/identity.rs?branch=feat/sd-jwt-vc#654b188e)
error[E0433]: failed to resolve: use of undeclared crate or module `futures`
 --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:1:5
  |
1 | use futures::future::BoxFuture;
  |     ^^^^^^^ use of undeclared crate or module `futures`

error[E0433]: failed to resolve: use of undeclared crate or module `futures`
 --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:2:5
  |
2 | use futures::future::FutureExt;
  |     ^^^^^^^ use of undeclared crate or module `futures`

error[E0308]: mismatched types
   --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/builder.rs:233:46
    |
233 |       .fold(builder, |builder, (key, value)| builder.insert_claim(key, value));
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `SdJwtBuilder<H>`, found `Result<SdJwtBuilder<H>, Error>`
    |
    = note: expected struct `SdJwtBuilder<_>`
                 found enum `std::result::Result<SdJwtBuilder<_>, sd_jwt_payload::Error>`
help: consider using `Result::expect` to unwrap the `std::result::Result<SdJwtBuilder<H>, sd_jwt_payload::Error>` value, panicking if the value is a `Result::Err`
    |
233 |       .fold(builder, |builder, (key, value)| builder.insert_claim(key, value).expect("REASON"));
    |                                                                              +++++++++++++++++

error[E0599]: no method named `boxed` found for `async` block `{async block@/home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:105:3: 105:13}` in the current scope
   --> /home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:153:4
    |
105 | /   async move {
106 | |     // Check if current type has already been checked.
107 | |     let is_type_already_checked = passed_types.contains(&current_type);
108 | |     if is_type_already_checked {
...   |
152 | |   }
153 | |   .boxed()
    | |   -^^^^^ method not found in `{async block@/home/nander/.cargo/git/checkouts/identity.rs-3c836f09661bc7fb/654b188/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs:105:3: 105:13}`
    | |___|
    |

Some errors have detailed explanations: E0308, E0433, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `identity_credential` (lib) due to 4 previous errors

I have quickly resolved them a couple of weeks ago myself just to make it work (see this).

After solving the mentioned issues and no further comments or reviews from your side we would be ready to release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added A new feature that requires a minor release. Part of "Added" section in changelog Enhancement New feature or improvement to an existing feature Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants