diff --git a/apps/ssi-abstraction/README.md b/apps/ssi-abstraction/README.md index 192eaff4fdb4bf4f5a1d9abceaf33c887b58c6b3..b7faf251422a3b2413f598d6186984e4d3af19c2 100644 --- a/apps/ssi-abstraction/README.md +++ b/apps/ssi-abstraction/README.md @@ -51,7 +51,6 @@ $ pnpm install [.env.example](.env.example) - PORT is the port for the signing and verification interface -- AFJ_EXT_PORT is the port for the openapi documentation described in [swagger.json](swagger.json) - AGENT_AUTO_ACCEPT_CONNECTION can be either true or false - AGENT_AUTO_ACCEPT_CREDENTIAL can be either: always, contentApproved, never - AGENT_PUBLIC_DID_SEED will generate the did and verkey (32 symbols) diff --git a/apps/ssi-abstraction/deployment/helm/README.md b/apps/ssi-abstraction/deployment/helm/README.md index 7ed99e60bc8ff68d481f4ba19880902c73d54e1e..ea4296a0809a062f95638d70b776d7bf6300bfc8 100644 --- a/apps/ssi-abstraction/deployment/helm/README.md +++ b/apps/ssi-abstraction/deployment/helm/README.md @@ -44,13 +44,12 @@ ssi-abstraction deployment | security.runAsNonRoot | bool | `false` | by default, apps run as non-root | | security.runAsUid | int | `0` | User used by the apps | | service.port | int | `3009` | | -| ssiAbstraction.afjExtPort | int | `3010` | | | ssiAbstraction.agent.autoAccept.connection | bool | `true` | | | ssiAbstraction.agent.autoAccept.credential | bool | `true` | | | ssiAbstraction.agent.host | string | `"gaiax.vereign.com"` | | | ssiAbstraction.agent.ledgerId | string | `"ID_UNION"` | | | ssiAbstraction.agent.name | string | `"ssi-abstraction-agent"` | | -| ssiAbstraction.agent.peerPort | int | `443` | | +| ssiAbstraction.agent.inboundPort | int | `443` | | | ssiAbstraction.agent.protocol | string | `"http"` | | | ssiAbstraction.agent.publicDidSeed | string | `"6b8b882e2618fa5d45ee7229ca880083"` | | | ssiAbstraction.agent.urlPath | string | `"/ocm/didcomm"` | | diff --git a/apps/ssi-abstraction/deployment/helm/templates/deployment.yaml b/apps/ssi-abstraction/deployment/helm/templates/deployment.yaml index 576b94f60feb8531c7a4b455fe2366ce905d39d9..1996cf0a926437e5fbd2ed7219c6a8f3d78fd1f8 100644 --- a/apps/ssi-abstraction/deployment/helm/templates/deployment.yaml +++ b/apps/ssi-abstraction/deployment/helm/templates/deployment.yaml @@ -38,8 +38,6 @@ spec: env: - name: PORT value: {{ .Values.service.port | quote }} - - name: AFJ_EXT_PORT - value: {{ .Values.ssiAbstraction.afjExtPort | quote }} - name: DATABASE_URL value: {{ template "app.postgresql.connectionstring" (merge (dict "application" "true") .) }} - name: NATS_URL @@ -52,8 +50,8 @@ spec: value: {{ .Values.ssiAbstraction.agent.urlPath }} - name: AGENT_NAME value: {{ .Values.ssiAbstraction.agent.name }} - - name: AGENT_PEER_PORT - value: ":{{ .Values.ssiAbstraction.agent.peerPort }}" + - name: AGENT_INBOUND_PORT + value: ":{{ .Values.ssiAbstraction.agent.inboundPort }}" - name: AGENT_PUBLIC_DID_SEED value: {{ .Values.ssiAbstraction.agent.publicDidSeed | quote }} - name: AGENT_AUTO_ACCEPT_CONNECTION @@ -80,8 +78,6 @@ spec: {{- end }} - name: http containerPort: {{ .Values.service.port }} - - name: afj - containerPort: {{ .Values.ssiAbstraction.afjExtPort }} - name: peer containerPort: {{ .Values.ssiAbstraction.agent.peerPort }} readinessProbe: diff --git a/apps/ssi-abstraction/deployment/helm/templates/ingress.yaml b/apps/ssi-abstraction/deployment/helm/templates/ingress.yaml index 819267ff15e788506ab52d1773591622d8e8beae..ca39338f0d713059e93f3804a93b4c5144b28866 100644 --- a/apps/ssi-abstraction/deployment/helm/templates/ingress.yaml +++ b/apps/ssi-abstraction/deployment/helm/templates/ingress.yaml @@ -25,5 +25,5 @@ spec: service: name: {{ template "app.name" . }} port: - number: {{ .Values.ssiAbstraction.agent.peerPort }} -{{- end }} \ No newline at end of file + number: {{ .Values.ssiAbstraction.agent.inboundPort }} +{{- end }} diff --git a/apps/ssi-abstraction/deployment/helm/templates/service.yaml b/apps/ssi-abstraction/deployment/helm/templates/service.yaml index 38b78299f9191d05be3095b741399fd23ef24e37..599f9d5aa9110f977a8f1227df04e21e8f96ca7e 100644 --- a/apps/ssi-abstraction/deployment/helm/templates/service.yaml +++ b/apps/ssi-abstraction/deployment/helm/templates/service.yaml @@ -10,10 +10,7 @@ spec: - name: http port: { { .Values.service.port } } targetPort: { { .Values.service.port } } - - name: afj - port: { { .Values.ssiAbstraction.afjExtPort } } - targetPort: { { .Values.ssiAbstraction.afjExtPort } } - name: peer - port: { { .Values.ssiAbstraction.agent.peerPort } } - targetPort: { { .Values.ssiAbstraction.agent.peerPort } } + port: { { .Values.ssiAbstraction.agent.inboundPort } } + targetPort: { { .Values.ssiAbstraction.agent.inboundPort } } selector: { { - include "app.selectorLabels" . | nindent 4 } } diff --git a/apps/ssi-abstraction/deployment/helm/values.yaml b/apps/ssi-abstraction/deployment/helm/values.yaml index c9facefef067ae4df68c2323f53ae0d0f4d3b4dd..e0155a68c07984ee667d0b5e257b207e70d2b920 100644 --- a/apps/ssi-abstraction/deployment/helm/values.yaml +++ b/apps/ssi-abstraction/deployment/helm/values.yaml @@ -90,7 +90,7 @@ ssiAbstraction: name: ssi-abstraction-agent host: gaiax.vereign.com protocol: http - peerPort: 443 + inboundPort: 443 urlPath: /ocm/didcomm publicDidSeed: 6b8b882e2618fa5d45ee7229ca880083 autoAccept: @@ -100,7 +100,6 @@ ssiAbstraction: key: ssi-wallet-key id: ssi-wallet-id ledgerId: ID_UNION - afjExtPort: 3010 database: host: postgresql.infra user: root diff --git a/apps/ssi-abstraction/src/agent/agent.service.ts b/apps/ssi-abstraction/src/agent/agent.service.ts index 343e90852239e56a086d2e7200485b2c69bee7e0..fd5f69ff538b33ba16f572a5c01743b3ff743734 100644 --- a/apps/ssi-abstraction/src/agent/agent.service.ts +++ b/apps/ssi-abstraction/src/agent/agent.service.ts @@ -49,7 +49,7 @@ export class AgentService { public constructor(configService: ConfigService) { this.configService = configService; - const peerPort = this.configService.get('agent.peerPort'); + const inboundPort = this.configService.get('agent.inboundPort'); this.agent = new Agent({ config: this.config, @@ -58,7 +58,7 @@ export class AgentService { }); const httpInbound = new HttpInboundTransport({ - port: peerPort, + port: inboundPort, }); this.agent.registerInboundTransport(httpInbound); @@ -67,10 +67,10 @@ export class AgentService { } public get config(): InitConfig { - const { name, walletId, walletKey, host, peerPort, path } = + const { name, walletId, walletKey, host, inboundPort, path } = this.configService.get('agent'); - const endpoints = [`${host}${peerPort}${path}`]; + const endpoints = [`${host}${inboundPort}${path}`]; return { label: name, diff --git a/apps/ssi-abstraction/src/config/validation.ts b/apps/ssi-abstraction/src/config/validation.ts index ae47388a22280b1963287d5a3949fa4a51f1d4d5..ea1891b558c386e7ed7cab673d9d94eb9be6f102 100644 --- a/apps/ssi-abstraction/src/config/validation.ts +++ b/apps/ssi-abstraction/src/config/validation.ts @@ -8,7 +8,7 @@ export const validationSchema = Joi.object({ AGENT_WALLET_ID: Joi.string().required(), AGENT_WALLET_KEY: Joi.string().required(), AGENT_HOST: Joi.string().required(), - AGENT_PEER_PORT: Joi.string(), + AGENT_INBOUND_PORT: Joi.string(), AGENT_URL_PATH: Joi.string(), AGENT_PUBLIC_DID_SEED: Joi.string().required(), AGENT_AUTO_ACCEPT_CONNECTION: Joi.boolean().required(), diff --git a/apps/ssi-abstraction/test/setEnvVars.js b/apps/ssi-abstraction/test/setEnvVars.js index 8c0f63d52e54df1fb93a8863b247b37ef8794aef..74a71051d847e0ffb7080f294629d65356ee3e50 100644 --- a/apps/ssi-abstraction/test/setEnvVars.js +++ b/apps/ssi-abstraction/test/setEnvVars.js @@ -1,12 +1,11 @@ process.env.PORT = 3009; -process.env.AFJ_EXT_PORT = 3010; process.env.DATABASE_URL = 'postgresql://postgres:postgres@localhost:5432/postgres?schema=agent'; process.env.NATS_URL = 'nats://localhost:4222'; process.env.ECSURL = 'http://localhost:9200/'; process.env.AGENT_HOST = 'http://localhost'; process.env.AGENT_NAME = 'ssi-abstraction-agent'; -process.env.AGENT_PEER_PORT = ':4000'; +process.env.AGENT_INBOUND_PORT = ':4000'; process.env.AGENT_URL_PATH = '/ocm/abstraction'; process.env.AGENT_PUBLIC_DID_SEED = '6b8b882e2618fa5d45ee7229ca880083'; process.env.AGENT_AUTO_ACCEPT_CONNECTION = true;