-
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: support aries-askar #1063
Conversation
pub async fn create_key( | ||
&self, | ||
name: &str, | ||
alg: KeyAlg, |
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.
We will need our own type for alg
should this method become a part of public interface.
|
||
let local_key = key_entry.load_local_key()?; | ||
|
||
let did_bytes = &local_key.to_public_bytes()?[0..16]; |
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.
create_and_store_my_did
from BaseWallet
always derives did from verkey, but it might be nice to allow did to be passed in here as an argument.
use super::*; | ||
|
||
#[tokio::test] | ||
#[cfg_attr(not(feature = "askar_tests"), ignore)] |
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.
Do not run tests yet since they will require additional setup.
async fn test_should_open_askar_wallet() { | ||
let uri = "postgres://postgres:postgres@localhost/askar"; | ||
|
||
AskarWallet::open(uri, Some(StoreKeyMethod::Unprotected), None.into(), None) |
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.
We need to make sure the wallet is created first for this test. And for the following one as well.
c5fcd9d
to
9d77e41
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
========================================
- Coverage 0.05% 0.05% -0.01%
========================================
Files 471 473 +2
Lines 24009 24032 +23
Branches 4306 4303 -3
========================================
Hits 13 13
- Misses 23995 24018 +23
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9d77e41
to
d95603b
Compare
aries_vcx_core/src/errors/error.rs
Outdated
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.
Ultimately the fact that a particular wallet implementation is being used should not be visible to the rest of the codebase.
We should rather reuse existing wallet errors - those might not be covering all of our needs, so we could tweak them, rename them, extend them as need - but the general approach should be to for example use WalletCreate
error type regardless underlying wallet implementation.
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.
Some of the current types seem to be quite tied to the Indy wallet implementation, so it seems like they will need changes.
aries_vcx_core/Cargo.toml
Outdated
@@ -11,9 +11,12 @@ credx = ["dep:indy-credx"] | |||
vdr_proxy_ledger = ["credx", "dep:indy-vdr-proxy-client"] | |||
# Feature flag to allow legacy proof verification | |||
legacy_proof = [] | |||
askar_tests = [] |
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.
Not only tests, but anything Askar related in the codebase should be behind a feature flag. Given the implementation must stay hidden behind the BaseWallet trait, the rest of the codebase should not know of Askar's existence.
You might be aware of this, but keeping that constraint will "reviewlessly" assure these desired properties.
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.
For example having it feature flagged from get go would probably naturally lead you to not create Askar*
specific error kinds. It might be somewhat restrictive while POCing, but ultimately will guide you toward the optimal design/integration with the rest of the codebase
&self, | ||
xtype: &str, | ||
id: &str, | ||
value: &str, | ||
tags: Option<HashMap<String, String>>, |
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.
For completeness sake just remind of what we mentioned on the community call earlier.
The BaseWallet
method signatures were catered for the particular vdrtools
based wallet implementation. We didn't try to over-generalize for the future at the time we designed BaseWallet
.
So probably you'll find it desirable to redesign BaseWallet
trait - you can draw inspiration from this POC #1042 which didn't meant to add support for Askar
in particular, but I guess even more ambitiously tried to enable arbitrary wallet implementation in the future. That might or might not been too long shot.
8ad85b8
to
0d05eee
Compare
I added an implementation of |
0d05eee
to
c3f4169
Compare
c3f4169
to
ce14d17
Compare
Closing in favor of #1085 |
No description provided.