Skip to content

Commit dddc4be

Browse files
RinkalBhojanitipusinghaw
authored andcommitted
fix: fixed coderabbitai suggestions and PR comments
Signed-off-by: Rinkal Bhojani <[email protected]>
1 parent 9fe4486 commit dddc4be

File tree

16 files changed

+380
-382
lines changed

16 files changed

+380
-382
lines changed

Dockerfiles/Dockerfile.oid4vc-issuance

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ WORKDIR /app
99
# Copy package.json and package-lock.json
1010
COPY package.json ./
1111
COPY pnpm-workspace.yaml ./
12-
#COPY package-lock.json ./
1312

1413
ENV PUPPETEER_SKIP_DOWNLOAD=true
1514

@@ -18,7 +17,6 @@ RUN pnpm i --ignore-scripts
1817

1918
# Copy the rest of the application code
2019
COPY . .
21-
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
2220
RUN cd libs/prisma-service && npx prisma generate
2321

2422
# Build the oid4vc-issuance service
@@ -29,7 +27,7 @@ RUN npm run build oid4vc-issuance
2927
FROM node:18-alpine
3028
# Install OpenSSL
3129
RUN apk add --no-cache openssl
32-
# RUN npm install -g pnpm
30+
3331
# Set the working directory
3432
WORKDIR /app
3533

@@ -38,7 +36,7 @@ COPY --from=build /app/dist/apps/oid4vc-issuance/ ./dist/apps/oid4vc-issuance/
3836

3937
# Copy the libs folder from the build stage
4038
COPY --from=build /app/libs/ ./libs/
41-
#COPY --from=build /app/package.json ./
39+
4240
COPY --from=build /app/node_modules ./node_modules
4341

4442
# Set the command to run the microservice

Dockerfiles/Dockerfile.oid4vc-verification

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ WORKDIR /app
99
# Copy package.json and package-lock.json
1010
COPY package.json ./
1111
COPY pnpm-workspace.yaml ./
12-
#COPY package-lock.json ./
1312

1413
ENV PUPPETEER_SKIP_DOWNLOAD=true
1514

@@ -18,7 +17,7 @@ RUN pnpm i --ignore-scripts
1817

1918
# Copy the rest of the application code
2019
COPY . .
21-
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
20+
2221
RUN cd libs/prisma-service && npx prisma generate
2322

2423
# Build the oid4vc-verification service
@@ -29,7 +28,7 @@ RUN npm run build oid4vc-verification
2928
FROM node:18-alpine
3029
# Install OpenSSL
3130
RUN apk add --no-cache openssl
32-
# RUN npm install -g pnpm
31+
3332
# Set the working directory
3433
WORKDIR /app
3534

@@ -38,7 +37,7 @@ COPY --from=build /app/dist/apps/oid4vc-verification/ ./dist/apps/oid4vc-verific
3837

3938
# Copy the libs folder from the build stage
4039
COPY --from=build /app/libs/ ./libs/
41-
#COPY --from=build /app/package.json ./
40+
4241
COPY --from=build /app/node_modules ./node_modules
4342

4443
# Set the command to run the microservice

apps/agent-service/src/agent-service.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export class AgentServiceController {
372372

373373
@MessagePattern({ cmd: 'agent-service-oid4vc-get-credential-offer-by-id' })
374374
// eslint-disable-next-line @typescript-eslint/no-explicit-any
375-
async oidcGetCredentialOfferById(payload: { url: string; orgId: string; offerId: string }): Promise<any> {
375+
async oidcGetCredentialOfferById(payload: { url: string; orgId: string }): Promise<any> {
376376
return this.agentServiceService.oidcGetCredentialOfferById(payload.url, payload.orgId);
377377
}
378378

apps/agent-service/src/agent-service.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,12 @@ export class AgentServiceService {
22012201

22022202
private async tokenEncryption(token: string): Promise<string> {
22032203
try {
2204-
const encryptedToken = CryptoJS.AES.encrypt(JSON.stringify(token), process.env.CRYPTO_PRIVATE_KEY).toString();
2204+
const secret = process.env.CRYPTO_PRIVATE_KEY;
2205+
if (!secret) {
2206+
this.logger.error('CRYPTO_PRIVATE_KEY is not configured');
2207+
throw new InternalServerErrorException('Encryption key is not configured');
2208+
}
2209+
const encryptedToken = CryptoJS.AES.encrypt(JSON.stringify(token), secret).toString();
22052210

22062211
return encryptedToken;
22072212
} catch (error) {
@@ -2312,6 +2317,7 @@ export class AgentServiceService {
23122317
this.logger.error(
23132318
`[getOid4vpVerifierSession] Error in getting oid4vp verifier session in agent service : ${JSON.stringify(error)}`
23142319
);
2320+
throw error;
23152321
}
23162322
}
23172323

apps/api-gateway/src/agent-service/dto/create-schema.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class CreateTenantSchemaDto {
2525
attributes: string[];
2626

2727
@ApiProperty()
28+
@IsString({ message: 'orgId must be a string' })
2829
@IsNotEmpty({ message: 'please provide orgId' })
2930
orgId: string;
3031
}

apps/api-gateway/src/connection/connection.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class ConnectionService extends BaseService {
4444
basicMessageDto
4545
);
4646
} catch (error) {
47-
throw new RpcException(error.response);
47+
throw new RpcException(error?.response ?? error);
4848
}
4949
}
5050

@@ -60,7 +60,7 @@ export class ConnectionService extends BaseService {
6060
const connectionDetails = { referenceId };
6161
return this.natsClient.sendNats(this.connectionServiceProxy, 'get-connection-url', connectionDetails);
6262
} catch (error) {
63-
throw new RpcException(error.response);
63+
throw new RpcException(error?.response ?? error);
6464
}
6565
}
6666

0 commit comments

Comments
 (0)