-
Notifications
You must be signed in to change notification settings - Fork 7
feat: did prinicipal #149
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: did prinicipal #149
Conversation
*/ | ||
async resolveAndVerify(payload, signature) { | ||
try { | ||
const key = await this.resolve() |
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.
What if Principal id is a non-key DID that resolves to more than one 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.
We’ll update this once we start supporting multiple keys, right now we don’t so we keep it simple
|
||
export const code = 0x1300 | ||
export const name = Verifier.name | ||
|
||
/** @type {'EdDSA'} */ |
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 type assertion could be helpfully moved into Verifier.signatureAlgorithm
(or in there you could use a /** @type {const} */
when assigning the eddsa string
- add .withDID method to principals for wrapping keys in DIDs - 💣 🚨 change output of .toArchive .from to support multikey signers
- add .withDID method to principals for wrapping keys in DIDs - 💣 🚨 change output of .toArchive .from to support multikey signers
…#246) Motivation: * second attempt at this #238 * after first was reverted #245 Warning: * the versions of ucanto we're upgrading to were backward-incompatible. storacha/ucanto#149 * Old 'SignerArchive' exports will probably no longer import using the new `@ucanto/principal@^4.0.0` `SignerArchive` * in slack, @alanshaw said he thinks this is unlikely to cause problems: "There’s no code in production that uses toArchive" Blockers * [x] Wait for these two to land first (@hugomrdias says so) * [x] @hugomrdias #207 * [x] @alanshaw #228 * [x] then will need to resolve merge conflicts on this branch * [x] @gobengo resolve conflicts after #207 * [x] @gobengo resolve conflicts after #228 Co-authored-by: Irakli Gozalishvili <[email protected]>
…#246) Motivation: * second attempt at this #238 * after first was reverted #245 Warning: * the versions of ucanto we're upgrading to were backward-incompatible. storacha/ucanto#149 * Old 'SignerArchive' exports will probably no longer import using the new `@ucanto/principal@^4.0.0` `SignerArchive` * in slack, @alanshaw said he thinks this is unlikely to cause problems: "There’s no code in production that uses toArchive" Blockers * [x] Wait for these two to land first (@hugomrdias says so) * [x] @hugomrdias #207 * [x] @alanshaw #228 * [x] then will need to resolve merge conflicts on this branch * [x] @gobengo resolve conflicts after #207 * [x] @gobengo resolve conflicts after #228 Co-authored-by: Irakli Gozalishvili <[email protected]>
This PR generalizes #139 to arbitrary DIDs and supersedes it. It also changes following things
.withDID
method is added so you could wrap did:key (or other) into e.g.did:dns
ordid:web
.{ id: DID, keys: Record<DID<'key'>, CryptoKey|Uint8Array> }
keys
it will only have one key, however it addresses feat: did:dns support #139 (comment) and provides a way to have multiple keys in the futureFixes #137