Skip to content

Commit

Permalink
fix(data-store): add support for entityPrefix (#725)
Browse files Browse the repository at this point in the history
* fix(data-store): add support for db ConnectionOptions with entityPrefix

fixes #724

* chore: use different infuraProjectId in tests

* docs(core): simplify type definitions for VC/VP and link to spec

* fix: private key migration

Co-authored-by: Simonas Karuzas <simonas@not.cat>
  • Loading branch information
mirceanis and simonas-notcat authored Oct 25, 2021
1 parent d4a29a2 commit 801bb95
Show file tree
Hide file tree
Showing 23 changed files with 353 additions and 438 deletions.
Binary file not shown.
Binary file modified __tests__/fixtures/local-database-before-migration.sqlite
Binary file not shown.
327 changes: 191 additions & 136 deletions __tests__/initial.migration.test.ts

Large diffs are not rendered by default.

141 changes: 0 additions & 141 deletions __tests__/keyMigration.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/localAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import messageHandler from './shared/messageHandler'
import didDiscovery from './shared/didDiscovery'
import dbInitOptions from './shared/dbInitOptions'

const infuraProjectId = '5ffc47f65c4042ce847ef66a3fa70d4c'
const infuraProjectId = '3586660d179141e3801c3895de1c2eba'
const secretKey = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c'

let agent: TAgent<
Expand Down
2 changes: 1 addition & 1 deletion __tests__/localMemoryStoreAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import didComm from './shared/didcomm'
import messageHandler from './shared/messageHandler'

const databaseFile = 'local-database2.sqlite'
const infuraProjectId = '5ffc47f65c4042ce847ef66a3fa70d4c'
const infuraProjectId = '3586660d179141e3801c3895de1c2eba'

let agent: TAgent<
IDIDManager &
Expand Down
2 changes: 1 addition & 1 deletion __tests__/restAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ import messageHandler from './shared/messageHandler'
import didDiscovery from './shared/didDiscovery'

const databaseFile = 'rest-database.sqlite'
const infuraProjectId = '5ffc47f65c4042ce847ef66a3fa70d4c'
const infuraProjectId = '3586660d179141e3801c3895de1c2eba'
const secretKey = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c'
const port = 3002
const basePath = '/agent'
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/default/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ didResolver:
ethr-did-resolver:
$require: ethr-did-resolver?t=function&p=/ethr#getResolver
$args:
- infuraProjectId: 5ffc47f65c4042ce847ef66a3fa70d4c
- infuraProjectId: 3586660d179141e3801c3895de1c2eba

web-did-resolver:
$require: web-did-resolver?t=function&p=/web#getResolver
Expand Down Expand Up @@ -223,39 +223,39 @@ didManager:
$args:
- defaultKms: local
network: mainnet
rpcUrl: https://mainnet.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
rpcUrl: https://mainnet.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:ethr:rinkeby:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: rinkeby
rpcUrl: https://rinkeby.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
rpcUrl: https://rinkeby.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:ethr:ropsten:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: ropsten
rpcUrl: https://ropsten.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
rpcUrl: https://ropsten.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:ethr:kovan:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: kovan
rpcUrl: https://kovan.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
rpcUrl: https://kovan.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:ethr:goerli:
$require: '@veramo/did-provider-ethr#EthrDIDProvider'
$args:
- defaultKms: local
network: goerli
rpcUrl: https://goerli.infura.io/v3/5ffc47f65c4042ce847ef66a3fa70d4c
rpcUrl: https://goerli.infura.io/v3/3586660d179141e3801c3895de1c2eba
gas: 1000001
ttl: 31104001
did:web:
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function createSchema(generator: TJS.SchemaGenerator, symbol: string) {
schemaStr = schemaStr.replace(/Where\<(.*)\>/gm, 'Where-$1')
schemaStr = schemaStr.replace(/Order\<(.*)\>/gm, 'Order-$1')
schemaStr = schemaStr.replace(/FindArgs\<(.*)\>/gm, 'FindArgs-$1')
schemaStr = schemaStr.replace(/https \:\/\//gm, 'https://')
return JSON.parse(schemaStr)
}

Expand Down
44 changes: 22 additions & 22 deletions packages/core/plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"properties": {
"didDocument": {
"$ref": "#/components/schemas/DIDDocument",
"description": "the DID document from which to extract the fragment. This MUST be the document resolved by {@link resolveDid }"
"description": "the DID document from which to extract the fragment. This MUST be the document resolved by {@link resolveDid }"
},
"didUrl": {
"type": "string",
Expand Down Expand Up @@ -1479,7 +1479,7 @@
"required": [
"hash"
],
"description": "Input arguments for {@link IDataStore.IDataStoreDeleteVerifiableCredentialArgs| IDataStoreDeleteVerifiableCredentialArgs }"
"description": "Input arguments for {@link IDataStore.IDataStoreDeleteVerifiableCredentialArgs | IDataStoreDeleteVerifiableCredentialArgs }"
},
"IDataStoreGetMessageArgs": {
"type": "object",
Expand Down Expand Up @@ -1584,7 +1584,7 @@
"id",
"type"
],
"description": "DIDComm message"
"description": "Represents a DIDComm v1 message payload, with optionally decoded credentials and presentations."
},
"IMetaData": {
"type": "object",
Expand Down Expand Up @@ -1672,13 +1672,13 @@
},
"required": [
"@context",
"type",
"issuer",
"issuanceDate",
"credentialSubject",
"proof"
"issuanceDate",
"issuer",
"proof",
"type"
],
"description": "Verifiable Credential {@link https://github.com/decentralized-identifier/did-jwt-vc }"
"description": "Represents a signed Verifiable Credential payload (includes proof). See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model }"
},
"VerifiablePresentation": {
"type": "object",
Expand Down Expand Up @@ -1729,13 +1729,13 @@
}
},
"required": [
"holder",
"@context",
"holder",
"proof",
"type",
"verifier",
"proof"
"verifier"
],
"description": "Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc }"
"description": "Represents a signed Verifiable Presentation (includes proof). See {@link https://www.w3.org/TR/vc-data-model/#presentations | VP data model }"
},
"IDataStoreGetVerifiableCredentialArgs": {
"type": "object",
Expand Down Expand Up @@ -2004,7 +2004,7 @@
"id",
"type"
],
"description": "DIDComm message"
"description": "Represents a DIDComm v1 message payload, with optionally decoded credentials and presentations."
},
"VerifiableCredential": {
"type": "object",
Expand Down Expand Up @@ -2075,13 +2075,13 @@
},
"required": [
"@context",
"type",
"issuer",
"issuanceDate",
"credentialSubject",
"proof"
"issuanceDate",
"issuer",
"proof",
"type"
],
"description": "Verifiable Credential {@link https://github.com/decentralized-identifier/did-jwt-vc }"
"description": "Represents a signed Verifiable Credential payload (includes proof). See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model }"
},
"VerifiablePresentation": {
"type": "object",
Expand Down Expand Up @@ -2132,13 +2132,13 @@
}
},
"required": [
"holder",
"@context",
"holder",
"proof",
"type",
"verifier",
"proof"
"verifier"
],
"description": "Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc }"
"description": "Represents a signed Verifiable Presentation (includes proof). See {@link https://www.w3.org/TR/vc-data-model/#presentations | VP data model }"
}
},
"methods": {
Expand Down
Loading

0 comments on commit 801bb95

Please sign in to comment.