Skip to content

Commit

Permalink
feat!: upgrade shared components
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <[email protected]>
  • Loading branch information
genaris committed Oct 14, 2023
1 parent 5cac2be commit 4d4fa24
Show file tree
Hide file tree
Showing 31 changed files with 597 additions and 456 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'

Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Install dependencies
Expand All @@ -84,7 +84,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- name: Checkout aries-framework-javascript
Expand Down Expand Up @@ -116,10 +116,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Add ref-napi resolution in Node18
if: matrix.node-version == '18.x'
run: node ./scripts/add-ref-napi-resolution.js

- name: Install dependencies
run: yarn install --frozen-lockfile

Expand Down Expand Up @@ -149,7 +145,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"refresh": "rm -rf ./node_modules ./yarn.lock && yarn"
},
"dependencies": {
"@hyperledger/indy-vdr-nodejs": "^0.1.0",
"@hyperledger/anoncreds-nodejs": "^0.1.0",
"@hyperledger/aries-askar-nodejs": "^0.1.0",
"@hyperledger/indy-vdr-nodejs": "^0.2.0-dev.2",
"@hyperledger/anoncreds-nodejs": "^0.2.0-dev.1",
"@hyperledger/aries-askar-nodejs": "^0.2.0-dev.1",
"inquirer": "^8.2.5"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/cors": "^2.8.10",
"@types/eslint": "^8.21.2",
"@types/express": "^4.17.13",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.5",
"@types/node": "^16.11.7",
"@types/uuid": "^9.0.1",
"@types/varint": "^6.0.0",
Expand All @@ -48,7 +48,7 @@
"eslint-plugin-workspaces": "^0.8.0",
"express": "^4.17.1",
"indy-sdk": "^1.16.0-dev-1655",
"jest": "^29.5.0",
"jest": "^29.7.0",
"lerna": "^6.5.1",
"prettier": "^2.3.1",
"rxjs": "^7.8.0",
Expand All @@ -63,6 +63,6 @@
"@types/node": "^16.11.7"
},
"engines": {
"node": "^16 || ^18"
"node": ">=18"
}
}
8 changes: 5 additions & 3 deletions packages/anoncreds-rs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@
"tsyringe": "^4.8.0"
},
"devDependencies": {
"@hyperledger/anoncreds-nodejs": "^0.1.0",
"@hyperledger/anoncreds-shared": "^0.1.0",
"@hyperledger/anoncreds-nodejs": "^0.2.0-dev.1",
"@hyperledger/anoncreds-shared": "^0.2.0-dev.1",
"@types/ref-array-di": "^1.2.6",
"@types/ref-struct-di": "^1.1.10",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.0",
"typescript": "~4.9.5"
},
"peerDependencies": {
"@hyperledger/anoncreds-shared": "^0.1.0"
"@hyperledger/anoncreds-shared": "^0.2.0-dev.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
} from '@aries-framework/anoncreds'
import { anoncreds, RevocationRegistryDefinition } from '@hyperledger/anoncreds-nodejs'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { AnonCredsCredentialDefinitionRepository } from '../../../../anoncreds/src/repository/AnonCredsCredentialDefinitionRepository'
import { AnonCredsCredentialRepository } from '../../../../anoncreds/src/repository/AnonCredsCredentialRepository'
import { AnonCredsLinkSecretRepository } from '../../../../anoncreds/src/repository/AnonCredsLinkSecretRepository'
Expand Down Expand Up @@ -65,8 +64,7 @@ const agentContext = getAgentContext({
agentConfig,
})

// FIXME: Re-include in tests when NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'AnonCredsRsHolderService', () => {
describe('AnonCredsRsHolderService', () => {
const getByCredentialIdMock = jest.spyOn(anoncredsCredentialRepositoryMock, 'getByCredentialId')
const findByQueryMock = jest.spyOn(anoncredsCredentialRepositoryMock, 'findByQuery')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { anoncreds } from '@hyperledger/anoncreds-nodejs'
import { Subject } from 'rxjs'

import { InMemoryStorageService } from '../../../../../tests/InMemoryStorageService'
import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { encodeCredentialValue } from '../../../../anoncreds/src/utils/credential'
import { InMemoryAnonCredsRegistry } from '../../../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { agentDependencies, getAgentConfig, getAgentContext } from '../../../../core/tests/helpers'
Expand Down Expand Up @@ -58,8 +57,7 @@ const agentContext = getAgentContext({
agentConfig,
})

// FIXME: Re-include in tests when NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'AnonCredsRsServices', () => {
describe('AnonCredsRsServices', () => {
test('issuance flow without revocation', async () => {
const issuerId = 'did:indy:pool:localtest:TL1EaPFCZ8Si5aUrqScBDt'

Expand Down
6 changes: 5 additions & 1 deletion packages/anoncreds-rs/src/services/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export function createCredentialForHolder(options: {

const timeCreateRevStatusList = 12
const revocationStatusList = RevocationStatusList.create({
credentialDefinition,
revocationRegistryDefinitionPrivate: new RevocationRegistryDefinitionPrivate(
revocationRegistryDefinitionPrivate.handle
),
issuerId: credentialDefinition.issuerId as string,
timestamp: timeCreateRevStatusList,
issuanceByDefault: true,
Expand All @@ -143,10 +147,10 @@ export function createCredentialForHolder(options: {
revocationRegistryId: revocationRegistryDefinitionId,
revocationStatusList,
revocationConfiguration: new CredentialRevocationConfig({
statusList: revocationStatusList,
registryDefinition: new RevocationRegistryDefinition(revocationRegistryDefinition.handle),
registryDefinitionPrivate: new RevocationRegistryDefinitionPrivate(revocationRegistryDefinitionPrivate.handle),
registryIndex: 9,
tailsPath,
}),
})

Expand Down
4 changes: 1 addition & 3 deletions packages/anoncreds-rs/tests/anoncreds-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
import { Subject } from 'rxjs'

import { InMemoryStorageService } from '../../../tests/InMemoryStorageService'
import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { AnonCredsRegistryService } from '../../anoncreds/src/services/registry/AnonCredsRegistryService'
import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { agentDependencies, getAgentConfig, getAgentContext } from '../../core/tests/helpers'
Expand Down Expand Up @@ -71,8 +70,7 @@ const anoncredsProofFormatService = new AnonCredsProofFormatService()

const indyDid = 'did:indy:local:LjgpST2rjsoxYegQDRm7EL'

// FIXME: Re-include in tests when NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'AnonCreds format services using anoncreds-rs', () => {
describe('AnonCreds format services using anoncreds-rs', () => {
test('issuance and verification flow starting from proposal without negotiation and without revocation', async () => {
const schema = await anonCredsIssuerService.createSchema(agentContext, {
attrNames: ['name', 'age'],
Expand Down
3 changes: 1 addition & 2 deletions packages/anoncreds-rs/tests/indy-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
import { Subject } from 'rxjs'

import { InMemoryStorageService } from '../../../tests/InMemoryStorageService'
import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { AnonCredsRegistryService } from '../../anoncreds/src/services/registry/AnonCredsRegistryService'
import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { agentDependencies, getAgentConfig, getAgentContext } from '../../core/tests/helpers'
Expand Down Expand Up @@ -77,7 +76,7 @@ const legacyIndyProofFormatService = new LegacyIndyProofFormatService()
const indyDid = 'did:indy:bcovrin:test:LjgpST2rjsoxYegQDRm7EL'

// FIXME: Re-include in tests when NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'Legacy indy format services using anoncreds-rs', () => {
describe('Legacy indy format services using anoncreds-rs', () => {
test('issuance and verification flow starting from proposal without negotiation and without revocation', async () => {
const schema = await anonCredsIssuerService.createSchema(agentContext, {
attrNames: ['name', 'age'],
Expand Down
8 changes: 5 additions & 3 deletions packages/askar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
"tsyringe": "^4.8.0"
},
"devDependencies": {
"@hyperledger/aries-askar-nodejs": "^0.1.0",
"@hyperledger/aries-askar-shared": "^0.1.0",
"@hyperledger/aries-askar-nodejs": "^0.2.0-dev.1",
"@hyperledger/aries-askar-shared": "^0.2.0-dev.1",
"@types/bn.js": "^5.1.0",
"@types/ref-array-di": "^1.2.6",
"@types/ref-struct-di": "^1.1.10",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.0",
"typescript": "~4.9.5"
},
"peerDependencies": {
"@hyperledger/aries-askar-shared": "^0.1.0"
"@hyperledger/aries-askar-shared": "^0.2.0-dev.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from '@aries-framework/core'
import { ariesAskar } from '@hyperledger/aries-askar-nodejs'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { TestRecord } from '../../../../core/src/storage/__tests__/TestRecord'
import { agentDependencies, getAgentConfig, getAgentContext } from '../../../../core/tests/helpers'
import { AskarWallet } from '../../wallet/AskarWallet'
Expand All @@ -17,7 +16,7 @@ import { askarQueryFromSearchQuery } from '../utils'

const startDate = Date.now()

describeRunInNodeVersion([18], 'AskarStorageService', () => {
describe('AskarStorageService', () => {
let wallet: AskarWallet
let storageService: AskarStorageService<TestRecord>
let agentContext: AgentContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
KeyDerivationMethod,
} from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { testLogger, agentDependencies } from '../../../../core/tests'
import { AskarProfileWallet } from '../AskarProfileWallet'
import { AskarWallet } from '../AskarWallet'
Expand All @@ -20,7 +19,7 @@ const rootWalletConfig: WalletConfig = {
keyDerivationMethod: KeyDerivationMethod.Raw,
}

describeRunInNodeVersion([18], 'AskarWallet management', () => {
describe('AskarWallet management', () => {
let rootAskarWallet: AskarWallet
let profileAskarWallet: AskarProfileWallet

Expand Down
5 changes: 2 additions & 3 deletions packages/askar/src/wallet/__tests__/AskarWallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
} from '@aries-framework/core'
import { Store } from '@hyperledger/aries-askar-shared'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { encodeToBase58 } from '../../../../core/src/utils/base58'
import { agentDependencies } from '../../../../core/tests/helpers'
import testLogger from '../../../../core/tests/logger'
Expand All @@ -36,7 +35,7 @@ const walletConfig: WalletConfig = {
keyDerivationMethod: KeyDerivationMethod.Raw,
}

describeRunInNodeVersion([18], 'AskarWallet basic operations', () => {
describe('AskarWallet basic operations', () => {
let askarWallet: AskarWallet

const seed = TypedArrayEncoder.fromString('sample-seed-min-of-32-bytes-long')
Expand Down Expand Up @@ -229,7 +228,7 @@ describe.skip('Currently, all KeyTypes are supported by Askar natively', () => {
})
})

describeRunInNodeVersion([18], 'AskarWallet management', () => {
describe('AskarWallet management', () => {
let askarWallet: AskarWallet

afterEach(async () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/askar/src/wallet/__tests__/packing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
KeyDerivationMethod,
} from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { agentDependencies } from '../../../../core/tests/helpers'
import testLogger from '../../../../core/tests/logger'
import { AskarWallet } from '../AskarWallet'
Expand All @@ -21,7 +20,7 @@ const walletConfig: WalletConfig = {
keyDerivationMethod: KeyDerivationMethod.Raw,
}

describeRunInNodeVersion([18], 'askarWallet packing', () => {
describe('askarWallet packing', () => {
let askarWallet: AskarWallet

beforeEach(async () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/askar/tests/askar-inmemory.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { SubjectMessage } from '../../../tests/transport/SubjectInboundTran
import { Agent } from '@aries-framework/core'
import { Subject } from 'rxjs'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { SubjectInboundTransport } from '../../../tests/transport/SubjectInboundTransport'
import { SubjectOutboundTransport } from '../../../tests/transport/SubjectOutboundTransport'

Expand All @@ -25,8 +24,7 @@ const bobInMemoryAgentOptions = getSqliteAgentOptions(
true
)

// FIXME: Re-include in tests when Askar NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'Askar In Memory agents', () => {
describe('Askar In Memory agents', () => {
let aliceAgent: Agent
let bobAgent: Agent

Expand Down
4 changes: 1 addition & 3 deletions packages/askar/tests/askar-postgres.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { AskarWalletPostgresStorageConfig } from '../src/wallet'
import { Agent } from '@aries-framework/core'
import { Subject } from 'rxjs'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { SubjectInboundTransport } from '../../../tests/transport/SubjectInboundTransport'
import { SubjectOutboundTransport } from '../../../tests/transport/SubjectOutboundTransport'

Expand All @@ -29,8 +28,7 @@ const bobPostgresAgentOptions = getPostgresAgentOptions('AgentsBob', storageConf
endpoints: ['rxjs:bob'],
})

// FIXME: Re-include in tests when Askar NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'Askar Postgres agents', () => {
describe('Askar Postgres agents', () => {
let aliceAgent: Agent
let bobAgent: Agent

Expand Down
5 changes: 1 addition & 4 deletions packages/askar/tests/askar-sqlite.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ import { Store } from '@hyperledger/aries-askar-shared'
import { tmpdir } from 'os'
import path from 'path'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'

import { getSqliteAgentOptions } from './helpers'

const aliceAgentOptions = getSqliteAgentOptions('AgentsAlice')
const bobAgentOptions = getSqliteAgentOptions('AgentsBob')

// FIXME: Re-include in tests when Askar NodeJS wrapper performance is improved
describeRunInNodeVersion([18], 'Askar SQLite agents', () => {
describe('Askar SQLite agents', () => {
let aliceAgent: Agent
let bobAgent: Agent

Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/crypto/__tests__/JwsService.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { AgentContext } from '../../agent'
import type { Key, Wallet } from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../../../tests/runInVersion'
import { RegisteredAskarTestWallet } from '../../../../askar/tests/helpers'
import { agentDependencies, getAgentConfig, getAgentContext } from '../../../tests/helpers'
import { DidKey } from '../../modules/dids'
Expand All @@ -16,8 +15,7 @@ import * as didJwsz6Mkf from './__fixtures__/didJwsz6Mkf'
import * as didJwsz6Mkv from './__fixtures__/didJwsz6Mkv'
import * as didJwszDnaey from './__fixtures__/didJwszDnaey'

// Only runs in Node18 because test uses Askar, which doesn't work well in Node16
describeRunInNodeVersion([18], 'JwsService', () => {
describe('JwsService', () => {
let wallet: Wallet
let agentContext: AgentContext
let jwsService: JwsService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { describeRunInNodeVersion } from '../../../../../../../tests/runInVersion'
import { RegisteredAskarTestWallet } from '../../../../../../askar/tests/helpers'
import { agentDependencies, getAgentConfig, getAgentContext, testLogger } from '../../../../../tests'
import { InjectionSymbols } from '../../../../constants'
Expand Down Expand Up @@ -42,7 +41,7 @@ const jwsService = new JwsService()
const w3cJwtCredentialService = new W3cJwtCredentialService(jwsService)

// Runs in Node 18 because of usage of Askar
describeRunInNodeVersion([18], 'W3cJwtCredentialService', () => {
describe('W3cJwtCredentialService', () => {
let issuerDidJwk: DidJwk
let holderDidKey: DidKey

Expand Down
Loading

0 comments on commit 4d4fa24

Please sign in to comment.