-
Notifications
You must be signed in to change notification settings - Fork 83
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) Implement AnoncredsLedgerRead for cheqd #1306 #1308
base: main
Are you sure you want to change the base?
(feat) Implement AnoncredsLedgerRead for cheqd #1306 #1308
Conversation
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
…er than generate at build time) Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
impl AnoncredsLedgerRead for Reader { | ||
type RevocationRegistryDefinitionAdditionalMetadata = Value; | ||
|
||
fn get_schema<'life0,'life1,'life2,'async_trait>(&'life0 self,schema_id: &'life1 SchemaId,submitter_did:Option< &'life2 Did> ,) -> ::core::pin::Pin<Box<dyn ::core::future::Future<Output = VcxLedgerResult<Schema> > + ::core::marker::Send+'async_trait> >where 'life0:'async_trait,'life1:'async_trait,'life2:'async_trait,Self:'async_trait; |
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.
sorry for ugliness in this test code! - sometimes mock!
macro has trouble when combined with the async_trait
macro, so the easiest fix is to insert the expanded async_trait
contents for the methods it struggles with (async fn get_schema
, async fn get_cred_def
& async fn get_rev_status_list
in this case).
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
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.
consumers could write this wrapper themselves (i was about to do it as a consumer @anonyome ), but figured it could go here too. If you think it's overkill for the vcx repo i'm happy to remove.
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
@JamesKEbert pls forgive me for some rust sins i committed in latest commit: 06f9afd particularly in |
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Signed-off-by: George Mulhearn <[email protected]>
Closes #1306
Additions
AnoncredsLedgerRead
trait to thearies_vcx_ledger
crate (hidden behind a feature flag)CheqdAnoncredsLedgerRead
. This implementation uses cheqd resource resolution, and is largely inspired by credo-ts https://github.com/openwallet-foundation/credo-ts/blob/main/packages/cheqd/src/anoncreds/services/CheqdAnonCredsRegistry.tsresolve_resource
method to the cheqd DID resolver, allowing DLRs to be resolved directly or via a name+type+time? DLR query. The implementation is largely inspired by credo-ts https://github.com/openwallet-foundation/credo-ts/blob/main/packages/cheqd/src/dids/CheqdDidResolver.ts#L69 . Note that the implementation for resolving DLR by name+type+time? query is not very efficient - it involves resolves the full set of DLR metadatas for a DID (collection) and then filtering in memory. This is a current limitation of the cheqd gRPC as pagination is not functioning as expected - this will need to be fixed once the gRPC is updated, however for now we ignore pagination (like credo)MultiLedgerAnoncredsRead
implementation of theAnoncredsLedgerRead
trait. This is similar to the DID resolver registry, it allows you to add multipleAnoncredsLedgerRead
implementations and automatically switch between them depending on the requested schema/cred-def/rev-reg ID.Refactors
get_rev_status_list
, which directly queries for the revocation status list - this is now the preferred method, instead ofget_rev_reg_delta_json
and then leaving the delta -> status list conversion elsewhere.get_rev_status_list
instead ofget_rev_reg_delta_json
, however issuer & verifier is still a bit tied to it (issue moved to (refactor) Transition from revocation registry deltas to revocation status lists #1309 )Anoncreds
trait refactored to take in a statuslist instead of delta, this allows some junk & conversions to be cut from the implementation: https://github.com/hyperledger/aries-vcx/pull/1308/files#diff-0c817a2ecd6c1ff01c6fc49b9c82add42df79bdbebc03a864fdf6d2566fc5aa1R936url
).Testing