Skip to content

Commit 9cfb001

Browse files
Merge pull request #1195 from credebl/develop
Merge: Dev to Qa (25/04/2024)
2 parents 7bf932c + d1f0679 commit 9cfb001

File tree

117 files changed

+6164
-39088
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+6164
-39088
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.env.demo

+8-8
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ AFJ_AGENT_SPIN_UP=/agent-provisioning/AFJ/scripts/docker_start_agent.sh
121121
AFJ_AGENT_ENDPOINT_PATH=/agent-provisioning/AFJ/endpoints/
122122
# Uncomment bellow three lines and comment the above to start services locally without using docker, using pnpm
123123
# AFJ_AGENT_TOKEN_PATH=/apps/agent-provisioning/AFJ/token/
124-
# AFJ_AGENT_SPIN_UP=/apps/agent-provisioning/AFJ/scripts/docker_start_agent.sh
124+
# AFJ_AGENT_SPIN_UP=/apps/agent-provisioning/AFJ/scripts/start_agent.sh
125125
# AFJ_AGENT_ENDPOINT_PATH=/apps/agent-provisioning/AFJ/endpoints/
126126

127127
AGENT_PROTOCOL=http
@@ -131,13 +131,13 @@ MAX_ORG_LIMIT=10
131131
FIDO_API_ENDPOINT=http://localhost:8000
132132

133133
IS_ECOSYSTEM_ENABLE=false
134-
CONSOLE_LOG_FLAG=true // Enable or disable console ELK logs
135-
ELK_LOG=true // ELK flag
136-
LOG_LEVEL=debug // ELK log level
137-
ELK_LOG_PATH = "http://localhost:9200/" // ELK log path
138-
ELK_USERNAME=elastic // ELK user username
139-
ELK_PASSWORD=xxxxxx // ELK user password
134+
CONSOLE_LOG_FLAG=true # Enable or disable console ELK logs
135+
ELK_LOG=false # ELK flag
136+
LOG_LEVEL=debug # ELK log level
137+
ELK_LOG_PATH= "http://localhost:9200/" # ELK log path
138+
ELK_USERNAME=elastic # ELK user username
139+
ELK_PASSWORD=xxxxxx # ELK user password
140140

141141
ORGANIZATION=credebl
142142
CONTEXT=platform
143-
APP=api
143+
APP=api
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Continuous Delivery
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
11+
jobs:
12+
build-and-push:
13+
name: Push Docker image to GitHub
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
service:
19+
- agent-provisioning
20+
- agent-service
21+
- api-gateway
22+
- cloud-wallet
23+
- connection
24+
- geolocation
25+
- issuance
26+
- ledger
27+
- notification
28+
- user
29+
- utility
30+
- verification
31+
- webhook
32+
33+
permissions:
34+
contents: read
35+
packages: write
36+
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v4
40+
41+
- name: Extract Git Tag
42+
id: get_tag
43+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
44+
45+
- name: Log in to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Build and Push Docker Image ${{ matrix.service }}
53+
uses: docker/build-push-action@v6
54+
with:
55+
context: .
56+
file: Dockerfiles/Dockerfile.${{ matrix.service }}
57+
push: true
58+
tags: |
59+
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.service }}:${{ env.TAG }}
60+
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.service }}:latest

.nvmrc

-1
This file was deleted.

Dockerfiles/Dockerfile.agent-provisioning

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY . .
2929

3030
# Generate Prisma client
3131
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
32-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
32+
RUN cd libs/prisma-service && npx prisma generate
3333
RUN ls -R /app/apps/agent-provisioning/AFJ/
3434

3535
# Build the user service
@@ -68,6 +68,7 @@ COPY --from=build /app/apps/agent-provisioning/AFJ/port-file ./agent-provisionin
6868
RUN chmod +x /app/agent-provisioning/AFJ/scripts/start_agent.sh
6969
RUN chmod +x /app/agent-provisioning/AFJ/scripts/start_agent_ecs.sh
7070
RUN chmod +x /app/agent-provisioning/AFJ/scripts/docker_start_agent.sh
71+
RUN chmod +x /app/agent-provisioning/AFJ/scripts/fargate.sh
7172
RUN chmod 777 /app/agent-provisioning/AFJ/endpoints
7273
RUN chmod 777 /app/agent-provisioning/AFJ/agent-config
7374
RUN chmod 777 /app/agent-provisioning/AFJ/token
@@ -76,4 +77,4 @@ RUN chmod 777 /app/agent-provisioning/AFJ/token
7677
COPY libs/ ./libs/
7778

7879
# Set the command to run the microservice
79-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-provisioning/main.js"]
80+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/agent-provisioning/main.js"]

Dockerfiles/Dockerfile.agent-service

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN pnpm i --ignore-scripts
2424
# Copy the rest of the application code
2525
COPY . .
2626
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
27-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
27+
RUN cd libs/prisma-service && npx prisma generate
2828

2929
# Build the user service
3030
RUN pnpm run build agent-service
@@ -53,4 +53,4 @@ COPY --from=build /app/libs/ ./libs/
5353
COPY --from=build /app/node_modules ./node_modules
5454

5555
# Set the command to run the microservice
56-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-service/main.js"]
56+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/agent-service/main.js"]

Dockerfiles/Dockerfile.api-gateway

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the api-gateway service
2424
RUN pnpm run build api-gateway
@@ -40,4 +40,4 @@ COPY --from=build /app/node_modules ./node_modules
4040
# COPY --from=build /app/uploadedFiles ./uploadedFiles
4141

4242
# Set the command to run the microservice
43-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/api-gateway/main.js"]
43+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/api-gateway/main.js"]

Dockerfiles/Dockerfile.cloud-wallet

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN pnpm i --ignore-scripts
1919
# Copy the rest of the application code
2020
COPY . .
2121
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22+
RUN cd libs/prisma-service && npx prisma generate
2323

2424
# Build the user service
2525
RUN pnpm run build cloud-wallet
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343

4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/cloud-wallet/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/cloud-wallet/main.js"]

Dockerfiles/Dockerfile.connection

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the connection service
2424
RUN pnpm run build connection
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343
#RUN npm i --only=production
4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/connection/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/connection/main.js"]

Dockerfiles/Dockerfile.geolocation

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the connection service
2424
RUN pnpm run build geo-location
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343
#RUN npm i --only=production
4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/geo-location/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/geo-location/main.js"]

Dockerfiles/Dockerfile.issuance

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the issuance service
2424
RUN pnpm run build issuance
@@ -42,4 +42,4 @@ COPY --from=build /app/node_modules ./node_modules
4242

4343

4444
# Set the command to run the microservice
45-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/issuance/main.js"]
45+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/issuance/main.js"]

Dockerfiles/Dockerfile.ledger

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the ledger service
2424
RUN npm run build ledger
@@ -41,4 +41,4 @@ COPY --from=build /app/libs/ ./libs/
4141
COPY --from=build /app/node_modules ./node_modules
4242

4343
# Set the command to run the microservice
44-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ledger/main.js"]
44+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/ledger/main.js"]

Dockerfiles/Dockerfile.notification

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN pnpm i --ignore-scripts
1616
# Copy the rest of the application code
1717
COPY . .
1818
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
19-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
19+
RUN cd libs/prisma-service && npx prisma generate
2020

2121
# Build the notification service
2222
RUN npm run build notification
@@ -39,4 +39,4 @@ COPY --from=build /app/libs/ ./libs/
3939
COPY --from=build /app/node_modules ./node_modules
4040

4141
# Set the command to run the microservice
42-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/notification/main.js"]
42+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/notification/main.js"]

Dockerfiles/Dockerfile.organization

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ RUN pnpm i --ignore-scripts
1717
# Copy the rest of the application code
1818
COPY . .
1919
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
20-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
20+
RUN cd libs/prisma-service && npx prisma generate
2221

2322
# Build the organization service
2423
RUN pnpm run build organization
@@ -41,4 +40,4 @@ COPY --from=build /app/libs/ ./libs/
4140
COPY --from=build /app/node_modules ./node_modules
4241

4342
# Set the command to run the microservice
44-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/organization/main.js"]
43+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/organization/main.js"]

Dockerfiles/Dockerfile.user

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN pnpm install
3131
# Copy the rest of the application code
3232
COPY . .
3333
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
34-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
34+
RUN cd libs/prisma-service && npx prisma generate
3535

3636
# Build the user service
3737
RUN pnpm run build user
@@ -66,4 +66,4 @@ COPY --from=build /app/node_modules ./node_modules
6666

6767

6868
# Set the command to run the microservice
69-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/user/main.js"]
69+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/user/main.js"]

Dockerfiles/Dockerfile.utility

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN pnpm i --ignore-scripts
1919
# Copy the rest of the application code
2020
COPY . .
2121
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22+
RUN cd libs/prisma-service && npx prisma generate
2323

2424
# Build the user service
2525
RUN pnpm run build utility
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343

4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/utility/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/utility/main.js"]

Dockerfiles/Dockerfile.verification

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN pnpm i --ignore-scripts
1717
# Copy the rest of the application code
1818
COPY . .
1919
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
20-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
20+
RUN cd libs/prisma-service && npx prisma generate
2121

2222
# Build the user service
2323
RUN npm run build verification
@@ -39,4 +39,4 @@ COPY --from=build /app/libs/ ./libs/
3939
COPY --from=build /app/node_modules ./node_modules
4040

4141
# Set the command to run the microservice
42-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/verification/main.js"]
42+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/verification/main.js"]

Dockerfiles/Dockerfile.webhook

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the webhook service
2424
RUN pnpm run build webhook
@@ -42,4 +42,4 @@ COPY --from=build /app/node_modules ./node_modules
4242

4343

4444
# Set the command to run the microservice
45-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/webhook/main.js"]
45+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/webhook/main.js"]

apps/agent-provisioning/AFJ/scripts/start_agent.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ if [ $? -eq 0 ]; then
209209

210210
docker rm -f "${PROJECT_NAME}" || true
211211

212-
docker-compose -f $FILE_NAME --project-name "${PROJECT_NAME}" up -d
212+
docker compose -f $FILE_NAME --project-name "${PROJECT_NAME}" up -d
213213
if [ $? -eq 0 ]; then
214214

215215
n=0
@@ -271,4 +271,4 @@ else
271271
echo "ERROR : Failed to execute!" && exit 125
272272
fi
273273

274-
echo "Total time elapsed: $(date -ud "@$(($(date +%s) - $START_TIME))" +%T) (HH:MM:SS)"
274+
echo "Total time elapsed: $(date -ud "@$(($(date +%s) - $START_TIME))" +%T) (HH:MM:SS)"

apps/api-gateway/src/credential-definition/dto/create-cred-defs.dto.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import { IsBoolean, IsDefined, IsNotEmpty, IsOptional, IsString } from 'class-validator';
2-
32
import { ApiProperty } from '@nestjs/swagger';
3+
import { Transform } from 'class-transformer';
4+
import { trim } from '@credebl/common/cast.helper';
45

56
export class CreateCredentialDefinitionDto {
67

78
@ApiProperty({ 'example': 'default' })
8-
@IsDefined({ message: 'Tag is required.' })
9+
@IsDefined({ message: 'Tag is required' })
910
@IsNotEmpty({ message: 'Please provide a tag' })
10-
@IsString({ message: 'Tag id should be string' })
11+
@IsString({ message: 'Tag should be string' })
1112
tag: string;
1213

1314
@ApiProperty({ 'example': 'WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0' })
14-
@IsDefined({ message: 'schemaLedgerId is required.' })
15-
@IsNotEmpty({ message: 'Please provide a schema id' })
15+
@IsDefined({ message: 'schemaLedgerId is required' })
16+
@IsNotEmpty({ message: 'Please provide valid schema ledger Id' })
17+
@Transform(({ value }) => trim(value))
1618
@IsString({ message: 'Schema id should be string' })
1719
schemaLedgerId: string;
1820

0 commit comments

Comments
 (0)