-
Notifications
You must be signed in to change notification settings - Fork 204
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: indy sdk aries askar migration script #1289
feat: indy sdk aries askar migration script #1289
Conversation
berendsliedrecht
commented
Feb 12, 2023
•
edited
Loading
edited
- feat: setup package
- feat: setup some base components
Codecov Report
@@ Coverage Diff @@
## main #1289 +/- ##
==========================================
- Coverage 85.42% 80.55% -4.88%
==========================================
Files 782 765 -17
Lines 19167 19038 -129
Branches 3116 3099 -17
==========================================
- Hits 16374 15336 -1038
- Misses 2786 3695 +909
Partials 7 7
... and 86 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
43e45cb
to
fac9efb
Compare
Signed-off-by: blu3beri <[email protected]>
"@aries-framework/core": "0.4.0-alpha.71", | ||
"@aries-framework/indy-sdk": "0.4.0-alpha.71", | ||
"@aries-framework/node": "0.4.0-alpha.71", | ||
"@hyperledger/aries-askar-shared": "file:/Users/beri/Developer/work/hyperledger/aries-askar/wrappers/javascript/aries-askar-shared" |
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.
Will replace the local files when they are released again.
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.
Shouldn't the reference to @aries-framework/*
packages point to * instead of an specific version (0.4.0-alpha.71)?
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.
I think this should use 0.3.3 (will be updated when released)
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.
Are there any blockers for a new release? Otherwise we can cut one today
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.
Yes, the. migration addition. So just releasing the wrappers would be good.
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.
Didn't do a deep review yet but left a few acid remarks regarding the scope and to :clarifying it 💥
"@aries-framework/core": "0.4.0-alpha.71", | ||
"@aries-framework/indy-sdk": "0.4.0-alpha.71", | ||
"@aries-framework/node": "0.4.0-alpha.71", | ||
"@hyperledger/aries-askar-shared": "file:/Users/beri/Developer/work/hyperledger/aries-askar/wrappers/javascript/aries-askar-shared" |
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.
Shouldn't the reference to @aries-framework/*
packages point to * instead of an specific version (0.4.0-alpha.71)?
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Show resolved
Hide resolved
* Migration class to move a wallet form the indy-sdk structure to the new | ||
* askar wallet structure. | ||
* | ||
* Right now, this is ONLY supported within React Native environments AND only sqlite. |
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.
I think this disclaimer is fine here but should be part of the README.
I understand the reasons about stating that it works in React Native because it assumes that no issuer or verifier side has been supported there officially, but I don't think it is accurate as we can also have a NodeJS holder-role agent that would be in the same situation.
Also, what about mediation records? Mediator configuration is not taken into account. In that case you assume only current Bifold case where a mediatorInvite is provided at startup and there is apparently no problem on creating the mediation coordination again. But that's not necessarily the case of every app using AFJ.
What about apps using generic records module? And those that have custom plug-ins that store custom records? 🤯
The latter case is maybe extreme (don't worry for us, as we are starting production using 0.4.0 right away 😎 ), but generic records and maybe proofs are used in some mobile wallets.
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.
I think all the cases you described should work in Node.JS, however it's not too much work to add credential definitions (the only one missing) after which it will fully work in Node.JS. We can do that in an upcoming release I think
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 we would only need to create migration for the indy records, like Indy::Key
or Indy::Credential
. Every custom afj record does not need additional conversion, just moving to a different table (which is dan with the new askar ffi function).
Node.js and postgres should be trivial, without any breaking changes, to add but not a MUST required for now.
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.
Ah good to see that all records are copied (it´s not always a good idea to review a PR at midnight). So if the only missing objects in migration are the Credential Definitions I think it makes more sense to allow migration in NodeJS as not all server deployments are used to issue credentials (we have a mediator for instance, or other services that verify but not issue credentials).
yarn.lock
Outdated
@@ -10,6 +10,88 @@ | |||
"@jridgewell/gen-mapping" "^0.1.0" | |||
"@jridgewell/trace-mapping" "^0.3.9" | |||
|
|||
"@aries-framework/[email protected]", "@aries-framework/[email protected]+a4204ef2": |
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.
These additions here can be avoided if using * for modules in package.json
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
// TODO: update with an aca-py issued revokable credential | ||
// community agent MIGHT have revocrevoc |
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.
community agent has a tails server set-up so that should work
Co-authored-by: Timo Glastra <[email protected]> Signed-off-by: Berend Sliedrecht <[email protected]>
Signed-off-by: blu3beri <[email protected]>
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
@TimoGlastra @genaris I think I will do a release of the askar wrappers and after that it should be ready for a rereview. |
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Outdated
Show resolved
Hide resolved
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Show resolved
Hide resolved
|
||
for (const row of credentials) { | ||
this.agent.config.logger.debug(`Migrating ${row.name} to the new askar format`) | ||
const data = JSON.parse(row.value as string) as { |
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.
how does this type differ from AnonCredsCredential
interface?
I see it has rev_reg and witness keys. Are those added when stored, or are those also transfered over the wire from issuer to holder?
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.
I see it has rev_reg and witness keys. Are those added when stored, or are those also transfered over the wire from issuer to holder?
I am not entirely sure what you mean here.
how does this type differ from AnonCredsCredential interface?
I think I can use the AnonCredsCredential
interface, this was just the object I saw after logging it.
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.
I see your interface contains the rev_reg
and witness
properties, but these are not in the AnonCredsCredential
. Do you know if these properties are added when storing to the credential, or is the interface we have in AFJ incorrect (and we should add those keys to that interface)
packages/indy-sdk-to-askar-migration/src/IndySdkToAskarMigrationUpdater.ts
Show resolved
Hide resolved
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>
Signed-off-by: blu3beri <[email protected]>