Skip to content

Commit

Permalink
network dispatch key changes
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw authored and amarts committed Dec 1, 2023
1 parent 97205d2 commit 0dd57a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
24 changes: 12 additions & 12 deletions demo/src/func-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ async function main() {
issuerDid.uri,
authorIdentity,
async ({ data }) => ({
signature: issuerKeys.assertionMethod.sign(data),
keyType: issuerKeys.assertionMethod.type,
signature: issuerKeys.authentication.sign(data),
keyType: issuerKeys.authentication.type,
})
)
console.dir(space, {
Expand Down Expand Up @@ -237,8 +237,8 @@ async function main() {
authorIdentity,
space.authorization,
async ({ data }) => ({
signature: issuerKeys.assertionMethod.sign(data),
keyType: issuerKeys.assertionMethod.type,
signature: issuerKeys.authentication.sign(data),
keyType: issuerKeys.authentication.type,
})
)
console.log(`✅ Schema - ${schemaId} - added!`)
Expand Down Expand Up @@ -282,8 +282,8 @@ async function main() {
authorIdentity,
space.authorization,
async ({ data }) => ({
signature: issuerKeys.assertionMethod.sign(data),
keyType: issuerKeys.assertionMethod.type,
signature: issuerKeys.authentication.sign(data),
keyType: issuerKeys.authentication.type,
})
)

Expand Down Expand Up @@ -314,8 +314,8 @@ async function main() {
authorIdentity,
delegateAuth as Cord.AuthorizationUri,
async ({ data }) => ({
signature: delegateTwoKeys.assertionMethod.sign(data),
keyType: delegateTwoKeys.assertionMethod.type,
signature: delegateTwoKeys.authentication.sign(data),
keyType: delegateTwoKeys.authentication.type,
})
)
console.log(`✅ Statement element registered - ${updatedStatement}`)
Expand Down Expand Up @@ -357,8 +357,8 @@ async function main() {
authorIdentity,
delegateAuth,
async ({ data }) => ({
signature: delegateTwoKeys.assertionMethod.sign(data),
keyType: delegateTwoKeys.assertionMethod.type,
signature: delegateTwoKeys.authentication.sign(data),
keyType: delegateTwoKeys.authentication.type,
})
)
console.log(`✅ Statement revoked!`)
Expand Down Expand Up @@ -388,8 +388,8 @@ async function main() {
authorIdentity,
delegateAuth,
async ({ data }) => ({
signature: delegateTwoKeys.assertionMethod.sign(data),
keyType: delegateTwoKeys.assertionMethod.type,
signature: delegateTwoKeys.authentication.sign(data),
keyType: delegateTwoKeys.authentication.type,
})
)
console.log(`✅ Statement revoked!`)
Expand Down
13 changes: 6 additions & 7 deletions packages/did/src/DidDetails/FullDidDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ import {
} from '../Did.chain.js'

const methodMapping: Record<string, VerificationKeyRelationship | undefined> = {
statement: 'assertionMethod',
schema: 'assertionMethod',
statement: 'authentication',
schema: 'authentication',
'chainSpace.addAdminDelegate': 'capabilityDelegation',
'chainSpace.addAuditDelegate': 'capabilityDelegation',
'chainSpace.addDelegate': 'capabilityDelegation',
'chainSpace.removeDelegate': 'capabilityDelegation',
'chainSpace.create': 'assertionMethod',
'chainSpace.archive': 'assertionMethod',
'chainSpace.restore': 'assertionMethod',
unique: 'assertionMethod',
'chainSpace.create': 'authentication',
'chainSpace.archive': 'authentication',
'chainSpace.restore': 'authentication',
did: 'authentication',
'did.create': undefined,
'did.submitDidCall': undefined,
didLookup: 'authentication',
didName: 'authentication',
score: 'assertionMethod',
score: 'authentication',
}

function getKeyRelationshipForMethod(
Expand Down

0 comments on commit 0dd57a1

Please sign in to comment.