-
Notifications
You must be signed in to change notification settings - Fork 61
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
Refactor #508
Conversation
2d50627
to
458561a
Compare
ssi-dids/src/document.rs
Outdated
/// | ||
/// See: <https://www.w3.org/TR/did-core/#did-controller> | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub controller: Option<OneOrMany<DIDBuf>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to move to a Vec
and deserialise as https://docs.rs/serde_with/latest/serde_with/struct.OneOrMany.html. Using OneOrMany
directly is a pain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's a good idea. Also, when None
is semantically equivalent to Some(empty_collection)
, I think we should remove the Option
wrapper. It doesn't add anything.
63a2a90
to
551370e
Compare
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
These are points we can discuss but I think overall the refactor is ready to be reviewed. |
@sbihel any ETA on merging this? |
Most libraries are disabled for now. `ssi-vc` now dedicated to VC Data Model. `ssi-vc` is mostly generated by TreeLDR. `ssi-ldr` now dedicated to Data Integrity. The dependency relation in between is reversed. Most of the code in both has been removed for now.
Remove `SignerProvider` trait. Remove `VerifierProvider` trait. Remove useless `Algorithm` type. Add `async` marker to `Verifier::verify` function.
Add safe constructor to `CompactJWS`. Add some handy methods to the `Header` type.
Add a `sec.ttl` schema for the `sec:multibase` datatype.
Align the verification method types. Impl `Verifier` for `DIDResolver`. Impl `ControllerProvider` for `DIDResolver`.
Still need to use `ssi-verification-methods`.
Added `RsaSignature2018` & `RsaVerificationKey2018` Added `JsonWebSignature2020` & `JsonWebKey2020` Added `Multikey` Added `EcdsaSecp256k1Signature2019` & `EcdsaSecp256k1VerificationKey2019` Added `EcdsaSecp256r1Signature2019` & `EcdsaSecp256r1VerificationKey2019`
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:
|
Add `NoClaim` empty type. Add documentation on `Claim` trait.
Removes the need for dedicated types for each type of claims, like `JsonVerifiableCredential` which can become `DataIntegrity<JsonCredential>`.
There are still some error types that are missing |
Also add types for the DID HTTP bindings.
Add `data_integrity::Type::new` constructor.
Use expected vm type to populate non-standard `publicKeyFormat` option in DID resolver. Use `publicKeyFormat` to select vm type in `did:key` resolver.
Also fix the tests which were mostly ignored as they were gated by features which don't exist in this crate
This is a temporary move to make it work easily with secp keys (see tests in did:key)
🎉 |
This PR aims at refactoring
ssi
to make better use of Rust traits.Verifable<Claims>
type family for verifiable claims, independent of the underlying implementation.TreeLDR integration(although it was one of the main motivation for this refactor, integration with TreeLDR will be de facto possible using the new abstractions.ssi
will not depend on TreeLDR).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
:ssi-vc-jwt
library)ssi-verification-methods
library), with VMs clearly defined.EcdsaSecp256k1RecoveryMethod2020
EcdsaSecp256k1VerificationKey2019
EcdsaSecp256r1VerificationKey2019
Ed25519VerificationKey2018
Ed25519VerificationKey2020
JsonWebKey2020
Multikey
RsaVerificationKey2018
Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021
P256PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021
TezosMethod2021
AleoMethod2021
BlockchainVerificationMethod2021
Eip712Method2021
ssi-dids
library)DIDResolver
traitssi-verification-methods
librarytz
(Tezos)jwk
pkh
(Refactorpkh
DID method implementation. #539)key
(Refactor thekey
DID method & Remove associated future types. #540)web
(Refactorweb
DID method implementation. #541)ethr
(Refactorethr
DID method implementation. #542)ion
(Refactorion
DID method implementation. #543)(deprecate)sol
(deprecate)onion
(deprecate)webkey
test
(test suite? not sure if required)ssi-vc-ldp
library)CryptographicSuite
trait designEcdsaSecp256k1Signature2019
EcdsaSecp256r1Signature2019
Ed25519Signature2018
Ed25519Signature2020
eddsa-2022
EthereumEip712Signature2021
JsonWebSignature2020
RsaSignature2018
EcdsaSecp256k1RecoverySignature2020
AleoSignature2021
Eip712Signature2021
EthereumPersonalSignature2021
SolanaSignature2021