Skip to content

Commit

Permalink
fix(deps): replace @transmute/lds-ecdsa-secp256k1-recovery2020 with f…
Browse files Browse the repository at this point in the history
…ork (#953)

The fork uses `@digitalcredentials` variants of the JSON-LD libraries and upgrades some other dependencies to more maintained variants

closes #952
  • Loading branch information
mirceanis authored Jun 29, 2022
1 parent b8401f5 commit 573a0ef
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 192 deletions.
2 changes: 1 addition & 1 deletion packages/credential-ld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@digitalcredentials/vc": "^1.1.2",
"@transmute/credentials-context": "^0.7.0-unstable.60",
"@transmute/ed25519-signature-2018": "^0.7.0-unstable.60",
"@transmute/lds-ecdsa-secp256k1-recovery2020": "decentralized-identity/EcdsaSecp256k1RecoverySignature2020",
"@veramo-community/lds-ecdsa-secp256k1-recovery2020": "uport-project/EcdsaSecp256k1RecoverySignature2020",
"@veramo/core": "^3.1.0",
"@veramo/did-resolver": "^3.1.0",
"@veramo/utils": "^3.1.0",
Expand Down
38 changes: 17 additions & 21 deletions packages/credential-ld/src/ld-default-contexts.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { ContextDoc } from './types'

async function _read(_path: string): Promise<ContextDoc> {
return await import('./contexts/' + _path);
}

/**
* Provides a hardcoded map of common Linked Data `@context` definitions.
*
Expand All @@ -13,21 +9,21 @@ async function _read(_path: string): Promise<ContextDoc> {
* @beta This API may change without a BREAKING CHANGE notice.
*/
export const LdDefaultContexts = new Map([
['https://www.w3.org/2018/credentials/v1', _read('www.w3.org_2018_credentials_v1.json')],
['https://www.w3.org/ns/did/v1', _read('www.w3.org_ns_did_v1.json')],
['https://w3id.org/security/v1', _read('w3id.org_security_v1.json')],
['https://w3id.org/security/v2', _read('w3id.org_security_v2.json')],
['https://w3id.org/security/v3-unstable', _read('w3id.org_security_v3-unstable.json')],
['https://w3id.org/security/suites/ed25519-2018/v1', _read('w3id.org_security_suites_ed25519-2018_v1.json')],
['https://w3id.org/security/suites/x25519-2019/v1', _read('w3id.org_security_suites_x25519-2019_v1.json')],
// ['https://w3id.org/did/v0.11', _read('did_v0.11.json')],
// ['https://veramo.io/contexts/socialmedia/v1', _read('socialmedia-v1.json')],
// ['https://veramo.io/contexts/kyc/v1', _read('kyc-v1.json')],
['https://veramo.io/contexts/profile/v1', _read('veramo.io_contexts_profile_v1.json')],
// ['https://ns.did.ai/transmute/v1', _read('transmute_v1.json')],
['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', _read('lds-ecdsa-secp256k1-recovery2020-0.0.json')],
['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-2.0.jsonld', _read('w3id.org_security_suites_secp256k1recovery-2020_v2.json')],
['https://w3id.org/security/suites/secp256k1recovery-2020/v2', _read('w3id.org_security_suites_secp256k1recovery-2020_v2.json')],
// ['https://w3id.org/security/suites/ed25519-2018/v1', _read('ed25519-signature-2018-v1.json')],
// ['https://w3id.org/security/suites/x25519-2019/v1', _read('X25519KeyAgreementKey2019.json')],
['https://www.w3.org/2018/credentials/v1', require('./contexts/www.w3.org_2018_credentials_v1')],
['https://www.w3.org/ns/did/v1', require('./contexts/www.w3.org_ns_did_v1')],
['https://w3id.org/security/v1', require('./contexts/w3id.org_security_v1')],
['https://w3id.org/security/v2', require('./contexts/w3id.org_security_v2.json')],
['https://w3id.org/security/v3-unstable', require('./contexts/w3id.org_security_v3-unstable.json')],
['https://w3id.org/security/suites/ed25519-2018/v1', require('./contexts/w3id.org_security_suites_ed25519-2018_v1.json')],
['https://w3id.org/security/suites/x25519-2019/v1', require('./contexts/w3id.org_security_suites_x25519-2019_v1.json')],
// ['https://w3id.org/did/v0.11', require('./contexts/did_v0.11.json')],
// ['https://veramo.io/contexts/socialmedia/v1', require('./contexts/socialmedia-v1.json')],
// ['https://veramo.io/contexts/kyc/v1', require('./contexts/kyc-v1.json')],
['https://veramo.io/contexts/profile/v1', require('./contexts/veramo.io_contexts_profile_v1.json')],
// ['https://ns.did.ai/transmute/v1', require('./contexts/transmute_v1.json')],
['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', require('./contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json')],
['https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-2.0.jsonld', require('./contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json')],
['https://w3id.org/security/suites/secp256k1recovery-2020/v2', require('./contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json')],
// ['https://w3id.org/security/suites/ed25519-2018/v1', require('./contexts/ed25519-signature-2018-v1.json')],
// ['https://w3id.org/security/suites/x25519-2019/v1', require('./contexts/X25519KeyAgreementKey2019.json')],
])
4 changes: 2 additions & 2 deletions packages/credential-ld/src/module-types/jsonld/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare module '@digitalcredentials/jsonld'
declare module '@digitalcredentials/jsonld-signatures'
declare module '@digitalcredentials/vc'
declare module '@transmute/lds-ecdsa-secp256k1-recovery2020'
declare module '@veramo-community/lds-ecdsa-secp256k1-recovery2020'

declare module "*.json" {
const content: any;
export default content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@
import {
EcdsaSecp256k1RecoveryMethod2020,
EcdsaSecp256k1RecoverySignature2020,
} from '@transmute/lds-ecdsa-secp256k1-recovery2020'
} from '@veramo-community/lds-ecdsa-secp256k1-recovery2020'

import * as u8a from 'uint8arrays'
import { asArray, encodeJoseBlob } from '@veramo/utils'
Expand Down
3 changes: 3 additions & 0 deletions packages/did-provider-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"@types/debug": "4.1.7",
"typescript": "4.7.3"
},
"resolutions": {
"*/**/jsonld": "npm:@digitalcredentials/jsonld@^5.2.1"
},
"files": [
"build/**/*",
"src/**/*",
Expand Down
Loading

0 comments on commit 573a0ef

Please sign in to comment.