File tree Expand file tree Collapse file tree 10 files changed +221
-88
lines changed
src/modules/openid4vc/local Expand file tree Collapse file tree 10 files changed +221
-88
lines changed Original file line number Diff line number Diff line change 1+ name : runtime-oid4vc-tests
2+
3+ services :
4+ oid4vc-service :
5+ image : ghcr.io/js-soft/openid4vc-service:1.1.14@sha256:d8601d031769f2ce850bcfcea32da839c0d444ed90ad6d345d85d9d864f1620a
6+ ports :
7+ - " 9000:9000"
8+ platform : linux/amd64
9+ environment :
10+ authServer__baseUrl : " https://kc-openid4vc.is.enmeshed.eu/realms/enmeshed-openid4vci"
11+ volumes :
12+ - ./service-config.json:/usr/app/config.json
13+ extra_hosts :
14+ - " host.docker.internal:host-gateway"
15+ depends_on :
16+ - mongodb
17+ networks :
18+ - default
19+
20+ connector :
21+ image : ghcr.io/nmshd/connector:7.1.0-openid4vc.2@sha256:b8458560fa85b190485aa544d9db34ab7d0b6b7b88129eda487b723e201734f8
22+ environment :
23+ CUSTOM_CONFIG_LOCATION : " /config.json"
24+ transportLibrary__baseUrl : " http://consumer-api:8080"
25+ transportLibrary__platformClientId : test
26+ transportLibrary__platformClientSecret : test
27+ transportLibrary__addressGenerationHostnameOverride : localhost
28+ database__connectionString : mongodb://root:example@mongodb:27017
29+ infrastructure__httpServer__authentication__apiKey__keys__default__key : aVeryCoolApiKeyWith30CharactersOr+
30+ extra_hosts :
31+ - " host.docker.internal:host-gateway"
32+ depends_on :
33+ - mongodb
34+ networks :
35+ - default
36+ - local-test-backbone
37+
38+ mongodb :
39+ image : mongo@sha256:c23684919810f0341e58744987e4b1c510fb8becdae850217d2d04b6fa7605e7
40+ environment :
41+ MONGO_INITDB_ROOT_USERNAME : root
42+ MONGO_INITDB_ROOT_PASSWORD : example
43+ networks :
44+ - default
45+
46+ networks :
47+ default :
48+ name : runtime-oid4vc-tests-network
49+ local-test-backbone :
50+ name : local-test-backbone
51+ external : true
Original file line number Diff line number Diff line change 1+ {
2+ "port" : 9000 ,
3+ "baseUrl" : " http://127.0.0.1:9000" ,
4+ "mongodb" : {
5+ "host" : " mongodb" ,
6+ "port" : 27017 ,
7+ "user" : " root" ,
8+ "password" : " example"
9+ },
10+ "connector" : {
11+ "baseUrl" : " http://connector:80" ,
12+ "apiKey" : " aVeryCoolApiKeyWith30CharactersOr+"
13+ },
14+ "customizing" : {
15+ "organization" : {
16+ "displayName" : " js-soft AG" ,
17+ "logoUrl" : " http://127.0.0.1:9000/ui/img/js_soft.png"
18+ }
19+ },
20+ "cors" : {
21+ "origin" : " *"
22+ }
23+ }
Original file line number Diff line number Diff line change @@ -119,6 +119,12 @@ jobs:
119119 - uses : actions/checkout@v5
120120 - name : Start Backbone
121121 run : npm run start:backbone
122+ - name : Login to GitHub Container Registry
123+ uses : docker/login-action@v3
124+ with :
125+ registry : ghcr.io
126+ username : ${{ secrets.GHCR_USER_FOR_OID4VC_SERVICE_PULL }}
127+ password : ${{ secrets.GHCR_PAT_FOR_OID4VC_SERVICE_PULL }}
122128 - uses : actions/setup-node@v6
123129 with :
124130 node-version : current
@@ -141,6 +147,12 @@ jobs:
141147 - uses : actions/checkout@v5
142148 - name : Start Backbone
143149 run : npm run start:backbone
150+ - name : Login to GitHub Container Registry
151+ uses : docker/login-action@v3
152+ with :
153+ registry : ghcr.io
154+ username : ${{ secrets.GHCR_USER_FOR_OID4VC_SERVICE_PULL }}
155+ password : ${{ secrets.GHCR_PAT_FOR_OID4VC_SERVICE_PULL }}
144156 - uses : actions/setup-node@v6
145157 with :
146158 node-version : current
Original file line number Diff line number Diff line change 2222 "lint:prettier" : " prettier --check ." ,
2323 "lint:tsc" : " npm run --workspaces lint:tsc" ,
2424 "outdated" : " ncu -i && ncu -i --workspaces" ,
25- "start:backbone" : " docker compose -f .dev/compose.backbone.yml up -d" ,
25+ "start:backbone" : " docker compose -f .dev/compose.backbone.yml up -d --wait" ,
26+ "start:openid4vc" : " docker compose -f .dev/compose.openid4vc.yml up -d --wait" ,
2627 "teardown:backbone" : " docker compose -f .dev/compose.backbone.yml down -v" ,
28+ "teardown:openid4vc" : " docker compose -f .dev/compose.openid4vc.yml down -v" ,
2729 "test:teardown" : " docker compose -f .dev/compose.yml down -fsv" ,
2830 "postinstall" : " patch-package && echo 'Postinstall done.'"
2931 },
Original file line number Diff line number Diff line change 8686 "@nmshd/core-types" : " *" ,
8787 "@nmshd/iql" : " ^1.0.4" ,
8888 "@nmshd/transport" : " *" ,
89- "@noble/ciphers" : " ^0. 2.0" ,
90- "jose" : " ^6.0.13 " ,
89+ "@noble/ciphers" : " ^2.0.1 " ,
90+ "jose" : " ^6.1.1 " ,
9191 "libsodium-wrappers" : " ^0.7.15" ,
9292 "lodash" : " ^4.17.21" ,
9393 "sjcl" : " ^1.0.8" ,
Original file line number Diff line number Diff line change 1- /* eslint-disable @typescript-eslint/naming-convention */
21import { AgentDependencies } from "@credo-ts/core" ;
32import { EventEmitter } from "events" ;
4- import WebSocket from "ws" ;
3+ import { Agent , fetch as undiciFetch } from "undici" ;
4+ import webSocket from "ws" ;
55import { EnmeshedHolderFileSystem } from "./EnmeshedHolderFileSystem" ;
66
7- const fetchImpl = globalThis . fetch ;
8- const webSocketImpl = WebSocket ;
9-
107export const agentDependencies : AgentDependencies = {
8+ // eslint-disable-next-line @typescript-eslint/naming-convention
119 FileSystem : EnmeshedHolderFileSystem ,
10+ // eslint-disable-next-line @typescript-eslint/naming-convention
1211 EventEmitterClass : EventEmitter ,
13- fetch : fetchImpl ,
14- WebSocketClass : webSocketImpl
12+ fetch : ( async ( input , init ) => {
13+ const response = await undiciFetch ( input as any , {
14+ ...( init as any ) ,
15+ dispatcher : new Agent ( { } )
16+ } ) ;
17+
18+ return response ;
19+ } ) as typeof fetch ,
20+ // eslint-disable-next-line @typescript-eslint/naming-convention
21+ WebSocketClass : webSocket
1522} ;
Original file line number Diff line number Diff line change 2525 "test:ci:lokijs" : " USE_LOKIJS=true jest -i --coverage" ,
2626 "test:ci:mongodb" : " jest -i --coverage" ,
2727 "test:local:ferretdb" : " npm run test:local:start:ferretdb && CONNECTION_STRING='mongodb://root:example@localhost:27022' jest" ,
28- "test:local:lokijs" : " USE_LOKIJS=true jest -- openid4vc.test.ts " ,
28+ "test:local:lokijs" : " USE_LOKIJS=true jest" ,
2929 "test:local:mongodb" : " npm run test:local:start:mongodb && CONNECTION_STRING='mongodb://root:example@localhost:27021' jest" ,
3030 "test:local:start:ferretdb" : " docker compose -f ../../.dev/compose.yml up -d runtime-ferret" ,
3131 "test:local:start:mongodb" : " docker compose -f ../../.dev/compose.yml up -d runtime-mongo" ,
You can’t perform that action at this time.
0 commit comments