Skip to content

Commit

Permalink
Merge pull request #745 from uport-project/next
Browse files Browse the repository at this point in the history
chore: feature release
  • Loading branch information
mirceanis authored Nov 12, 2021
2 parents 4086ea7 + 6884b28 commit 2011702
Show file tree
Hide file tree
Showing 81 changed files with 2,575 additions and 1,958 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: setup npm registry
run: |
echo "@veramo:registry=http://registry.npmjs.org/" > .npmrc
echo "@veramo:registry=https://registry.npmjs.org/" > .npmrc
echo "registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:17
WORKDIR /usr/src/app
COPY . .
RUN yarn
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Veramo runs on Node, Browsers, and React Native straight out of the box. Save ti
See the full docs on [veramo.io](https://veramo.io)

- Agent
- [Intro](https://veramo.io/docs/agent/introduction)
- [Plugins](https://veramo.io/docs/agent/plugins)
- [Plugins Directory](https://veramo.io/docs/agent/plugins_list)
- [Intro](https://veramo.io/docs/veramo_agent/introduction)
- [Plugins](https://veramo.io/docs/veramo_agent/plugins)
- [Plugins Directory](https://veramo.io/docs/veramo_agent/plugins_list)
- Guides
- [CLI](https://veramo.io/docs/guides/cli)
- [Node](https://veramo.io/docs/guides/nodejs)
Expand Down
Binary file not shown.
Binary file modified __tests__/fixtures/local-database-before-migration.sqlite
Binary file not shown.
332 changes: 196 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.

38 changes: 33 additions & 5 deletions __tests__/localAgent.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* This runs a suite of ./shared tests using an agent configured for local operations,
* using a SQLite db for storage of credentials, presentations, messages as well as keys and DIDs.
*
* This suite also runs a ganache local blockchain to run through some examples of DIDComm using did:ethr identifiers.
*/

import {
createAgent,
TAgent,
Expand Down Expand Up @@ -41,6 +48,7 @@ import {
import { createConnection, Connection } from 'typeorm'

import { FakeDidProvider, FakeDidResolver } from './utils/fake-did'
import { createGanacheProvider } from './utils/ganache-provider'
import { Resolver } from 'did-resolver'
import { getResolver as ethrDidResolver } from 'ethr-did-resolver'
import { getResolver as webDidResolver } from 'web-did-resolver'
Expand All @@ -57,12 +65,13 @@ import saveClaims from './shared/saveClaims'
import documentationExamples from './shared/documentationExamples'
import keyManager from './shared/keyManager'
import didManager from './shared/didManager'
import didComm from './shared/didcomm'
import didCommPacking from './shared/didCommPacking'
import messageHandler from './shared/messageHandler'
import didDiscovery from './shared/didDiscovery'
import dbInitOptions from './shared/dbInitOptions'
import didCommWithEthrDidFlow from './shared/didCommWithEthrDidFlow'

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

let agent: TAgent<
Expand All @@ -81,7 +90,7 @@ let dbConnection: Promise<Connection>
let databaseFile: string

const setup = async (options?: IAgentOptions): Promise<boolean> => {
databaseFile = options?.context?.databaseFile || 'local-database.sqlite'
databaseFile = options?.context?.databaseFile || `./tmp/local-database-${Math.random().toPrecision(5)}.sqlite`
dbConnection = createConnection({
name: options?.context?.['dbName'] || 'test',
type: 'sqlite',
Expand All @@ -95,6 +104,8 @@ const setup = async (options?: IAgentOptions): Promise<boolean> => {
...options?.context?.dbConnectionOptions,
})

const { provider, registry } = await createGanacheProvider()

agent = createAgent<
IDIDManager &
IKeyManager &
Expand Down Expand Up @@ -142,6 +153,12 @@ const setup = async (options?: IAgentOptions): Promise<boolean> => {
rpcUrl: 'https://arbitrum-rinkeby.infura.io/v3/' + infuraProjectId,
registry: '0x8f54f62CA28D481c3C30b1914b52ef935C1dF820',
}),
'did:ethr:ganache': new EthrDIDProvider({
defaultKms: 'local',
network: 1337,
web3Provider: provider,
registry,
}),
'did:web': new WebDIDProvider({
defaultKms: 'local',
}),
Expand All @@ -153,7 +170,17 @@ const setup = async (options?: IAgentOptions): Promise<boolean> => {
}),
new DIDResolverPlugin({
resolver: new Resolver({
...ethrDidResolver({ infuraProjectId }),
...ethrDidResolver({
infuraProjectId,
networks: [
{
name: 'ganache',
chainId: 1337,
provider,
registry,
},
],
}),
...webDidResolver(),
...getDidKeyResolver(),
...new FakeDidResolver(() => agent).getDidFakeResolver(),
Expand Down Expand Up @@ -210,7 +237,8 @@ describe('Local integration tests', () => {
keyManager(testContext)
didManager(testContext)
messageHandler(testContext)
didComm(testContext)
didCommPacking(testContext)
didDiscovery(testContext)
dbInitOptions(testContext)
didCommWithEthrDidFlow(testContext)
})
13 changes: 9 additions & 4 deletions __tests__/localMemoryStoreAgent.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* This runs a suite of ./shared tests using an agent configured for local operations,
* using a SQLite db for storage of credentials and an in-memory store for keys and DIDs.
*
*/
import {
createAgent,
TAgent,
Expand Down Expand Up @@ -45,11 +50,11 @@ import saveClaims from './shared/saveClaims'
import documentationExamples from './shared/documentationExamples'
import keyManager from './shared/keyManager'
import didManager from './shared/didManager'
import didComm from './shared/didcomm'
import didCommPacking from './shared/didCommPacking'
import messageHandler from './shared/messageHandler'

const databaseFile = 'local-database2.sqlite'
const infuraProjectId = '5ffc47f65c4042ce847ef66a3fa70d4c'
const databaseFile = `./tmp/local-database2-${Math.random().toPrecision(5)}.sqlite`
const infuraProjectId = '3586660d179141e3801c3895de1c2eba'

let agent: TAgent<
IDIDManager &
Expand Down Expand Up @@ -187,5 +192,5 @@ describe('Local in-memory integration tests', () => {
keyManager(testContext)
didManager(testContext)
messageHandler(testContext)
didComm(testContext)
didCommPacking(testContext)
})
19 changes: 13 additions & 6 deletions __tests__/restAgent.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* This runs a suite of ./shared tests using an agent configured for remote operations.
* There is a local agent that only uses @veramo/remove-client and a remote agent that provides the actual functionality.
*
* This suite also runs a messaging server to run through some examples of DIDComm using did:fake identifiers.
* See didWithFakeDidFlow() for more details.
*/
import 'cross-fetch/polyfill'
import {
Agent,
Expand Down Expand Up @@ -62,13 +69,13 @@ import webDidFlow from './shared/webDidFlow'
import documentationExamples from './shared/documentationExamples'
import keyManager from './shared/keyManager'
import didManager from './shared/didManager'
import didComm from './shared/didcomm'
import didCommRemote from './shared/didcommRemote'
import didCommPacking from './shared/didCommPacking'
import didWithFakeDidFlow from './shared/didCommWithFakeDidFlow'
import messageHandler from './shared/messageHandler'
import didDiscovery from './shared/didDiscovery'

const databaseFile = 'rest-database.sqlite'
const infuraProjectId = '5ffc47f65c4042ce847ef66a3fa70d4c'
const databaseFile = `./tmp/rest-database-${Math.random().toPrecision(5)}.sqlite`
const infuraProjectId = '3586660d179141e3801c3895de1c2eba'
const secretKey = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c'
const port = 3002
const basePath = '/agent'
Expand Down Expand Up @@ -234,7 +241,7 @@ describe('REST integration tests', () => {
keyManager(testContext)
didManager(testContext)
messageHandler(testContext)
didComm(testContext)
didCommRemote(testContext)
didCommPacking(testContext)
didWithFakeDidFlow(testContext)
didDiscovery(testContext)
})
File renamed without changes.
Loading

0 comments on commit 2011702

Please sign in to comment.