Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.23
# syntax=docker/dockerfile:1.24
FROM node:24-alpine AS builder

WORKDIR /veritable-ui
Expand Down
26 changes: 13 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
# -------------------- shared -------------------------------#
keycloak:
image: quay.io/keycloak/keycloak:26.6.1
image: quay.io/keycloak/keycloak:26.6.2
container_name: keycloak
environment:
- KC_BOOTSTRAP_ADMIN_USERNAME=admin
Expand Down Expand Up @@ -79,7 +79,7 @@ services:
- OPEN_CORPORATES_API_URL=http://wiremock:8080
- OPEN_CORPORATES_API_KEY=${OPEN_CORPORATES_API_KEY}
postgres-veritable-ui-alice:
image: postgres:18.3-alpine
image: postgres:18.4-alpine
container_name: postgres-veritable-ui-alice
ports:
- 5432:5432
Expand All @@ -91,7 +91,7 @@ services:
- POSTGRES_DB=veritable-ui
postgres-veritable-cloudagent-alice:
container_name: postgres-veritable-cloudagent-alice
image: postgres:18.3-alpine
image: postgres:18.4-alpine
restart: on-failure
volumes:
- postgres-veritable-cloudagent-alice:/var/lib/postgresql
Expand All @@ -100,7 +100,7 @@ services:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres-veritable-cloudagent
veritable-cloudagent-alice:
image: digicatapult/veritable-cloudagent:v0.18.30
image: digicatapult/veritable-cloudagent:v0.20.0
container_name: veritable-cloudagent-alice
restart: always
depends_on:
Expand Down Expand Up @@ -177,7 +177,7 @@ services:
- LOCAL_REGISTRY_COUNTRY_CODE=GB

postgres-veritable-ui-bob:
image: postgres:18.3-alpine
image: postgres:18.4-alpine
container_name: postgres-veritable-ui-bob
ports:
- 5433:5432
Expand All @@ -189,7 +189,7 @@ services:
- POSTGRES_DB=veritable-ui
postgres-veritable-cloudagent-bob:
container_name: postgres-veritable-cloudagent-bob
image: postgres:18.3-alpine
image: postgres:18.4-alpine
restart: on-failure
volumes:
- postgres-veritable-cloudagent-bob:/var/lib/postgresql
Expand All @@ -198,7 +198,7 @@ services:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres-veritable-cloudagent
veritable-cloudagent-bob:
image: digicatapult/veritable-cloudagent:v0.18.30
image: digicatapult/veritable-cloudagent:v0.20.0
container_name: veritable-cloudagent-bob
restart: always
depends_on:
Expand Down Expand Up @@ -275,7 +275,7 @@ services:
- OPEN_CORPORATES_API_KEY=${OPEN_CORPORATES_API_KEY}

postgres-veritable-ui-charlie:
image: postgres:18.3-alpine
image: postgres:18.4-alpine
container_name: postgres-veritable-ui-charlie
ports:
- 5434:5432
Expand All @@ -287,7 +287,7 @@ services:
- POSTGRES_DB=veritable-ui
postgres-veritable-cloudagent-charlie:
container_name: postgres-veritable-cloudagent-charlie
image: postgres:18.3-alpine
image: postgres:18.4-alpine
restart: on-failure
volumes:
- postgres-veritable-cloudagent-charlie:/var/lib/postgresql
Expand All @@ -296,7 +296,7 @@ services:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres-veritable-cloudagent
veritable-cloudagent-charlie:
image: digicatapult/veritable-cloudagent:v0.18.30
image: digicatapult/veritable-cloudagent:v0.20.0
container_name: veritable-cloudagent-charlie
restart: always
depends_on:
Expand All @@ -317,8 +317,8 @@ services:
image: rnwood/smtp4dev:3.15.0
container_name: smtp4dev
ports:
- '5001:80' # Port for accessing smtp4dev's web interface
- '2525:25' # Port for SMTP connections
- "5001:80" # Port for accessing smtp4dev's web interface
- "2525:25" # Port for SMTP connections
restart: always

# -------------------- wiremock ----------------------------#
Expand All @@ -328,7 +328,7 @@ services:
container_name: wiremock
# scale: 0 // TODO: remove this, only for dev
ports:
- '8443:8080' # Port for accessing wiremock
- "8443:8080" # Port for accessing wiremock
restart: always
volumes:
- ./test/wiremock/:/home/wiremock/mappings/
Expand Down
1 change: 0 additions & 1 deletion docker/cloudagent.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ IPFS_ORIGIN=http://ipfs:5001
POSTGRES_PORT=5432
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=postgres
LABEL=veritable-cloudagent
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "veritable-ui",
"version": "0.21.99",
"version": "0.21.100",
"description": "UI for Veritable",
"main": "src/index.ts",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions src/models/__tests__/credentialSchema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('credentialSchema', function () {
})
expect(getCreatedDids.callCount).to.equal(0)
expect(createDid.callCount).to.equal(1)
expect(createDid.firstCall.args).deep.equal(['key', { keyType: 'ed25519' }])
expect(createDid.firstCall.args).deep.equal(['key', { createKey: { type: { kty: 'OKP', crv: 'Ed25519' } } }])
})

test('policy = CREATE_NEW, has existing = true', async function () {
Expand All @@ -50,7 +50,7 @@ describe('credentialSchema', function () {
})
expect(getCreatedDids.callCount).to.equal(0)
expect(createDid.callCount).to.equal(1)
expect(createDid.firstCall.args).deep.equal(['key', { keyType: 'ed25519' }])
expect(createDid.firstCall.args).deep.equal(['key', { createKey: { type: { kty: 'OKP', crv: 'Ed25519' } } }])
})

test('policy = FIND_EXISTING, has existing = false', async function () {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('credentialSchema', function () {
expect(getCreatedDids.callCount).to.equal(1)
expect(getCreatedDids.firstCall.args).deep.equal([{ method: 'key' }])
expect(createDid.callCount).to.equal(1)
expect(createDid.firstCall.args).deep.equal(['key', { keyType: 'ed25519' }])
expect(createDid.firstCall.args).deep.equal(['key', { createKey: { type: { kty: 'OKP', crv: 'Ed25519' } } }])
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/models/credentialSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CredentialSchema {
}

if (policy === 'CREATE_NEW' || policy === 'EXISTING_OR_NEW') {
const result = await this.cloudagent.createDid('key', { keyType: 'ed25519' })
const result = await this.cloudagent.createDid('key', { createKey: { type: { kty: 'OKP', crv: 'Ed25519' } } })
return result.id
}

Expand Down
3 changes: 2 additions & 1 deletion src/models/veritableCloudagent/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export default class VeritableCloudagentInt<Config extends CloudagentConfig = De
return this.postRequest(
'/v1/oob/receive-invitation-url',
{
label: params.companyName,
alias: params.companyName,
autoAcceptConnection: true,
autoAcceptInvitation: true,
Expand Down Expand Up @@ -395,7 +396,7 @@ export default class VeritableCloudagentInt<Config extends CloudagentConfig = De

/*---------------------------- DIDs ---------------------------------*/

public async createDid(method: string, options: Record<string, string>): Promise<DidDocument> {
public async createDid(method: string, options: Record<string, unknown>): Promise<DidDocument> {
return this.postRequest('/v1/dids/create', { method, options }, this.buildParser(didCreateParser)).then(
(res) => res.didDocument
)
Expand Down
4 changes: 2 additions & 2 deletions src/services/credentialEvents/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ describe('credentialEvents', function () {
const credentialEvents = new CredentialEvents(...deps.args)
credentialEvents.start()

deps.eventMock.emit('CredentialStateChanged', {
deps.eventMock.emit('DidCommCredentialStateChanged', {
payload: {
credentialRecord,
credentialExchangeRecord: credentialRecord,
},
})

Expand Down
6 changes: 3 additions & 3 deletions src/services/credentialEvents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default class CredentialEvents {
}

public start() {
this.events.on('CredentialStateChanged', this.credentialStateChangedHandler)
this.events.on('DidCommCredentialStateChanged', this.credentialStateChangedHandler)
}

private credentialStateChangedHandler: eventData<'CredentialStateChanged'> = async (event) => {
const record = event.payload.credentialRecord
private credentialStateChangedHandler: eventData<'DidCommCredentialStateChanged'> = async (event) => {
const record = event.payload.credentialExchangeRecord
const formatData = await this.cloudagent.getCredentialFormatData(record.id)
const maybeSchema = formatData.offer?.anoncreds.schema_id
? await this.cloudagent.getSchemaById(formatData.offer.anoncreds.schema_id)
Expand Down
14 changes: 7 additions & 7 deletions src/services/veritableCloudagentEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const eventParser = z.discriminatedUnion('type', [
}),
}),
z.object({
type: z.literal('CredentialStateChanged'),
payload: z.object({ credentialRecord: credentialParser }),
type: z.literal('DidCommCredentialStateChanged'),
payload: z.object({ credentialExchangeRecord: credentialParser }),
}),
z.object({ type: z.literal('BasicMessageStateChanged'), payload: z.object({}) }),
z.object({ type: z.literal('RevocationNotificationReceived'), payload: z.object({}) }),
Expand Down Expand Up @@ -140,8 +140,8 @@ export default class VeritableCloudagentEvents extends IndexedAsyncEventEmitter<
id = data.payload.connectionRecord.id
this.logger.trace('DID rotation event on connection %s', id)
break
case 'CredentialStateChanged':
id = data.payload.credentialRecord.id
case 'DidCommCredentialStateChanged':
id = data.payload.credentialExchangeRecord.id
credentialSeen.add(id)
break
case 'DrpcRequestStateChanged':
Expand Down Expand Up @@ -170,9 +170,9 @@ export default class VeritableCloudagentEvents extends IndexedAsyncEventEmitter<

for (const credential of await this.veritable.getCredentials()) {
if (!credentialSeen.has(credential.id)) {
this.emitIndexed('CredentialStateChanged', credential.id, {
type: 'CredentialStateChanged',
payload: { credentialRecord: credential },
this.emitIndexed('DidCommCredentialStateChanged', credential.id, {
type: 'DidCommCredentialStateChanged',
payload: { credentialExchangeRecord: credential },
})
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/integration/pinVerification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ describe('pin-submission', function () {
beforeEach(async function () {
const credentialDonePromise = new Promise<void>((resolve) => {
context.cloudagentEvents.on(
'CredentialStateChanged',
'DidCommCredentialStateChanged',
({
payload: {
credentialRecord: { state },
credentialExchangeRecord: { state },
},
}) => {
if (state === 'done') {
Expand All @@ -62,7 +62,7 @@ describe('pin-submission', function () {

await Promise.race([
credentialDonePromise,
delayAndReject(1000, 'Timeout waiting for credential to reach done state'),
delayAndReject(5000, 'Timeout waiting for credential to reach done state'),
])
})

Expand Down Expand Up @@ -95,10 +95,10 @@ describe('pin-submission', function () {
beforeEach(async function () {
const credentialDonePromise = new Promise<void>((resolve) => {
context.cloudagentEvents.on(
'CredentialStateChanged',
'DidCommCredentialStateChanged',
({
payload: {
credentialRecord: { state },
credentialExchangeRecord: { state },
},
}) => {
if (state === 'done') {
Expand All @@ -115,7 +115,7 @@ describe('pin-submission', function () {

await Promise.race([
credentialDonePromise,
delayAndReject(1000, 'Timeout waiting for credential to reach done state'),
delayAndReject(5000, 'Timeout waiting for credential to reach done state'),
])
})

Expand Down
1 change: 0 additions & 1 deletion test/testcontainers/testcontainersSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export async function cloudagentContainer(name: string, hostPort: number): Promi
POSTGRES_PORT: '5432',
POSTGRES_USERNAME: 'postgres',
POSTGRES_PASSWORD: 'postgres',
LABEL: 'veritable-cloudagent',
})
.withWaitStrategy(Wait.forListeningPorts())
.withNetwork(network)
Expand Down
Loading