spruceid / ssi

Core library for decentralized identity.
https://spruceid.dev
Apache License 2.0
187 stars 59 forks source link

Refactor #508

Closed timothee-haudebourg closed 2 months ago

timothee-haudebourg commented 1 year ago

This PR aims at refactoring ssi to make better use of Rust traits.

This is a work in early progress.

Status

Most of the work is completed. There are still some DID methods that needs to be reintroduced. Most of the remaining work is testing everything (and that's a lot).

Below are all the parts that needs to be added or changed in ssi:

timothee-haudebourg commented 6 months ago

This is finally happening! Everything compiles, every test, doc test, example can run fine, no warnings, no broken doc links. I've fixed, tested and documented features. Now it is not perfect, there are a lot of ugly things living in ssi_jwk, ssi_jws for instance, but I'll consider it out of scope. Other issues are directly related to the refactor:

These are points we can discuss but I think overall the refactor is ready to be reviewed.

itsbalamurali commented 5 months ago

@sbihel any ETA on merging this?

timothee-haudebourg commented 5 months ago

rustfmt is failing because the crates/multicodec/src/table.rs file is not found. This file is generated by the build.rs script of ssi_multicodec from the crates/multicodec/src/table.csv file. I'll try to find a way to run the build script before rustfmt.

sbihel commented 4 months ago

For context I'm in the process of rewriting the VC API in DIDKit https://github.com/spruceid/didkit/pull/384, and I'm currently stuck with lifetime bound issues, but if you could have a look to see if I'm doing anything wrong that would be great.

ianhamilton87 commented 4 months ago

@timothee-haudebourg @clehner @sbihel - any ETA on the completion of this PR? Reason I ask is because merging this PR is blocking one of mine: https://github.com/spruceid/ssi/pull/545

Thanks.

sbihel commented 4 months ago

There's is no ETA but we're hoping to get it merged and published within two months.

timothee-haudebourg commented 3 months ago

I've made some changes to follow the reviews. With a few days away from ssi I had some fresh eyes, so I've fixed some other issues that were necessary in my opinion:

sbihel commented 3 months ago

There are still some error types that are missing Send and would probably benefit from moving to a String or anyhow::Error -- at least MessageSignatureError. Have you tried compiling the VC API in DIDKit in https://github.com/spruceid/didkit/pull/384?

jceb commented 2 months ago

🎉