-
Notifications
You must be signed in to change notification settings - Fork 134
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: add signOnly flag and logic for add/remove key/service #1389
Conversation
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.
This looks much better than before!
I think we are missing a couple of things before we can merge this:
- tests to validate the new behavior
- (optional, but highly recommended) even more simplification of the code:
We now have 3 paths for adding/removing an attribute:
- a. sign and send a transaction directly. (default case)
- b. sign a message using one key and sign and/or send a transaction using another key (metaIdentifierKeyId)
- c. sign a message using one key (signOnly param)
Ideally, we would use the functionality from c. as a first step in b.
Hi @mirceanis. I have pushed some tests up which cover the introduced
|
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.
This looks much better!
I suggested a key to safely include and after that, I think we can merge this
kms: KMS, | ||
}) satisfies MinimalImportableKey | ||
|
||
const INFURA_API_KEY = '' |
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.
// this key is safe to hardcode as it's limited to some did:ethr contract addresses
const INFURA_API_KEY = '' | |
const INFURA_API_KEY = '3586660d179141e3801c3895de1c2eba' |
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.
Thanks! I have added the key.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #1389 +/- ##
==========================================
+ Coverage 89.95% 89.97% +0.01%
==========================================
Files 176 176
Lines 27695 27730 +35
Branches 2201 2204 +3
==========================================
+ Hits 24912 24949 +37
+ Misses 2783 2781 -2 ☔ View full report in Codecov by Sentry. |
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.
looks good!
What issue is this PR fixing
Closes #1373
What is being changed
Due to constraints within the secure MetaMask Snap context, it is not possible to invoke the
didManagerAdd(Remove)Service
ordidManagerAdd(Remove)Key
methods on thedid-manager
successfully. Refer here for the list of blocked RPC methods.As outlined in the referenced issue, the changes proposed herein allow for the transaction to be signed only, through the addition of a new
signOnly
flag within one agent (in the demonstration case, by an agent in the constrained MetaMask Snap environment), and then submitted from another context (for example via theethers.InfuraProvider
in another context).Quality
Check all that apply:
pnpm i
,pnpm build
,pnpm test
,pnpm test:browser
locally.Details
I have successfully tested this (with the
did-ethr-provider
on thesepolia
testnet).