Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9bce7f4
fix: update nest version and add them to catalog in pnpm
GHkrishna Sep 23, 2025
4138137
fix: nest version update changes for services
GHkrishna Sep 23, 2025
2448baa
fix: add remaining packages in catalog
GHkrishna Sep 23, 2025
130e252
fix: logging and unnecessary await
GHkrishna Sep 24, 2025
ca72d30
fix: inconsistent return type
GHkrishna Sep 24, 2025
62e850e
fix: remove toPromise in favour of firstValueFrom
GHkrishna Sep 24, 2025
b88926e
fix: toPromise to lastValuFrom
GHkrishna Sep 24, 2025
52f2d15
fix: update error message
GHkrishna Sep 24, 2025
cea5806
fix: update duplicate credDefData interface
GHkrishna Sep 24, 2025
5ddd324
fix: get all ledgers
GHkrishna Sep 24, 2025
26b5920
fix: throw error
GHkrishna Sep 24, 2025
32f5e3e
fix: proper use of params
GHkrishna Sep 24, 2025
8b5c3ce
fix: path excluded properly
GHkrishna Sep 24, 2025
378b562
fix: api-response code
GHkrishna Sep 25, 2025
aa5a0ce
fix: remove unwanted controllers, with no matching nats call available
GHkrishna Sep 25, 2025
45a68e6
fix: header setting for nats
GHkrishna Sep 25, 2025
546e746
fix: add missing roleguard
GHkrishna Sep 25, 2025
5290a2b
fix: return type is actually an object(including referenceId and the …
GHkrishna Sep 25, 2025
5c5b873
fix: update correct enum
GHkrishna Sep 25, 2025
2e48e6a
fix: min value for transformation
GHkrishna Sep 25, 2025
fae3f49
fix: parsing string as a boolean to handle boolean values correctly
GHkrishna Sep 25, 2025
a9a4902
fix: add required typing
GHkrishna Sep 25, 2025
17c9214
fix: error handling
GHkrishna Sep 25, 2025
e4215dc
fix: add dependency for loggerModule
GHkrishna Sep 25, 2025
f026820
fix: add typing and todo for the nested response issue
GHkrishna Sep 25, 2025
4be4bdb
fix: add roleguards where role level access is expected
GHkrishna Sep 25, 2025
645a0af
fix: interface type
GHkrishna Sep 25, 2025
eb9d7b7
fix: adding a todo for unsure changes regarding authguards in fido co…
GHkrishna Sep 25, 2025
f72cb89
fix: use params directly instead of through req object
GHkrishna Sep 25, 2025
661a9ae
fix: docker build issues due to pnpm catalog
GHkrishna Sep 25, 2025
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
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.agent-provisioning
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

Comment on lines 21 to 23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Include pnpm-lock.yaml for reproducible, cacheable installs.

Without the lockfile, installs may drift.

 # Copy package.json and package-lock.json
 COPY package.json ./
+COPY pnpm-lock.yaml ./
 COPY pnpm-workspace.yaml ./
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COPY package.json ./
COPY pnpm-workspace.yaml ./
# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-lock.yaml ./
COPY pnpm-workspace.yaml ./
🤖 Prompt for AI Agents
In Dockerfiles/Dockerfile.agent-provisioning around lines 21 to 23, the
Dockerfile copies package.json and pnpm-workspace.yaml but omits pnpm-lock.yaml
which prevents reproducible, cacheable installs; add a COPY instruction to
include pnpm-lock.yaml (and any workspace-level lockfiles if present) alongside
package.json and pnpm-workspace.yaml before running install so the lockfile is
used for deterministic dependency resolution and Docker layer caching.

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.agent-service
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

Comment on lines 17 to 19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Copy pnpm-lock.yaml for reproducibility.

 # Copy package.json and package-lock.json
 COPY package.json ./
+COPY pnpm-lock.yaml ./
 COPY pnpm-workspace.yaml ./
🤖 Prompt for AI Agents
In Dockerfiles/Dockerfile.agent-service around lines 17 to 19, the Dockerfile
copies package.json and pnpm-workspace.yaml but omits pnpm-lock.yaml which is
needed for reproducible installs; add a COPY pnpm-lock.yaml ./ (placed before
running pnpm install) so the lockfile is available during dependency
installation and rebuilds are deterministic.

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.api-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
# COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.cloud-wallet
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.connection
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.geolocation
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.issuance
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.ledger
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.notification
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

# Install dependencies
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.organization
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.seed
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN chmod +x /app/libs/prisma-service/prisma/scripts/geo_location_data_import.sh
RUN chmod +x /app/libs/prisma-service/prisma/scripts/update_client_credential_data.sh

ENV PUPPETEER_SKIP_DOWNLOAD=true
COPY pnpm-workspace.yaml ./
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Workspace file COPY: verify .dockerignore and layer placement

If pnpm-workspace.yaml is already included by COPY . . (Line 11), this extra COPY is redundant. If it’s excluded via .dockerignore, this is needed. Please confirm which is true.

Run to verify:


🏁 Script executed:

#!/bin/bash
rg -n '^pnpm-workspace\.yaml$' .dockerignore || echo "Not excluded"
test -f pnpm-workspace.yaml && echo "workspace file present at repo root"

Length of output: 48


Remove redundant pnpm-workspace.yaml COPY
.dockerignore doesn’t exclude pnpm-workspace.yaml, so it’s already added by COPY . . (line 11). Delete the extra COPY pnpm-workspace.yaml ./ at line 16.

🤖 Prompt for AI Agents
In Dockerfiles/Dockerfile.seed around line 16, the Dockerfile performs a
redundant COPY of pnpm-workspace.yaml (it was already included by the earlier
COPY . . at line 11 because .dockerignore does not exclude it); remove the extra
line "COPY pnpm-workspace.yaml ./" so the file is not copied twice and leave
only the initial COPY . . entry.

RUN pnpm i --ignore-scripts

# Run Prisma commands
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.user
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.utility
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.verification
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./

Comment on lines 10 to 12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Copy pnpm-lock.yaml for deterministic builds.

 COPY package.json ./
+COPY pnpm-lock.yaml ./
 COPY pnpm-workspace.yaml ./
🤖 Prompt for AI Agents
In Dockerfiles/Dockerfile.verification around lines 10 to 12, the Dockerfile
copies package.json and pnpm-workspace.yaml but omits pnpm-lock.yaml which means
non-deterministic installs; update the COPY instructions to also copy
pnpm-lock.yaml into the build context (e.g., add "COPY pnpm-lock.yaml ./")
before running install so pnpm can use the lockfile for reproducible builds.

ENV PUPPETEER_SKIP_DOWNLOAD=true

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.webhook
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-workspace.yaml ./
#COPY package-lock.json ./

ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const seedLength = 32;
@Controller()
@ApiTags('agents')
@ApiBearerAuth()
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
export class AgentController {
constructor(private readonly agentService: AgentService) {}
private readonly logger = new Logger();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable, Inject } from '@nestjs/common';
import { ClientProxy } from '@nestjs/microservices';
import { user } from '@prisma/client';
import { BaseService } from 'libs/service/base.service';
import { AgentSpinupDto } from './dto/agent-service.dto';
Expand All @@ -10,6 +9,7 @@ import { CreateDidDto } from './dto/create-did.dto';
import { CreateWalletDto } from './dto/create-wallet.dto';
import { AgentConfigureDto } from './dto/agent-configure.dto';
import { NATSClient } from '@credebl/common/NATSClient';
import { ClientProxy } from '@nestjs/microservices';

@Injectable()
export class AgentService extends BaseService {
Expand Down
144 changes: 52 additions & 92 deletions apps/api-gateway/src/agent/agent.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ import {
HttpStatus
} from '@nestjs/common';
import { AgentService } from './agent.service';
import { ApiTags, ApiResponse, ApiOperation, ApiQuery, ApiBearerAuth, ApiParam, ApiUnauthorizedResponse, ApiForbiddenResponse, ApiExcludeEndpoint } from '@nestjs/swagger';
import {
ApiTags,
ApiResponse,
ApiOperation,
ApiQuery,
ApiBearerAuth,
ApiParam,
ApiUnauthorizedResponse,
ApiForbiddenResponse,
ApiExcludeEndpoint
} from '@nestjs/swagger';
import { AuthGuard } from '@nestjs/passport';
import { WalletDetailsDto } from '../dtos/wallet-details.dto';
import { UnauthorizedErrorDto } from '../dtos/unauthorized-error.dto';
Expand All @@ -33,17 +43,19 @@ import { User } from '../authz/decorators/user.decorator';
@ApiBearerAuth()
@Controller('agent')
export class AgentController {
constructor(private readonly agentService: AgentService,
private readonly commonService: CommonService) { }
constructor(
private readonly agentService: AgentService,
private readonly commonService: CommonService
) {}

private readonly logger = new Logger();

/**
*
* @param user
* @param _public
* @param verkey
* @param did
*
* @param user
* @param _public
* @param verkey
* @param did
* @returns List of all the DID created for the current Cloud Agent.
*/
@Get('/wallet/did')
Expand All @@ -55,8 +67,8 @@ export class AgentController {
@ApiQuery({ name: 'did', required: false })
@ApiOperation({ summary: 'List of all DID', description: 'List of all the DID created for the current Cloud Agent.' })
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
getAllDid(
@User() user: any,
@Query('_public') _public: boolean,
Expand All @@ -68,8 +80,8 @@ export class AgentController {
}

/**
*
* @param user
*
* @param user
* @returns Created DID
*/
@Post('/wallet/did/create')
Expand All @@ -78,20 +90,18 @@ export class AgentController {
@SetMetadata('permissions', [CommonConstants.PERMISSION_ORG_MGMT])
@ApiOperation({ summary: 'Create a new DID', description: 'Create a new did for the current Cloud Agent wallet.' })
@ApiResponse({ status: HttpStatus.CREATED, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
createLocalDid(
@User() user: any
): Promise<object> {
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
createLocalDid(@User() user: any): Promise<object> {
this.logger.log(`**** Create Local Did...`);
return this.agentService.createLocalDid(user);
}

/**
*
* @param walletUserDetails
* @param user
* @returns
*
* @param walletUserDetails
* @param user
* @returns
*/
@Post('/wallet/provision')
@ApiTags('agent')
Expand All @@ -102,89 +112,40 @@ export class AgentController {
description: 'Create a new wallet and spin up your Aries Cloud Agent Python by selecting your desired network.'
})
@ApiResponse({ status: HttpStatus.CREATED, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
walletProvision(
@Body() walletUserDetails: WalletDetailsDto,
@User() user: object
): Promise<object> {
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
walletProvision(@Body() walletUserDetails: WalletDetailsDto, @User() user: object): Promise<object> {
this.logger.log(`**** Spin up the agent...${JSON.stringify(walletUserDetails)}`);

const regex = new RegExp('^[a-zA-Z0-9]+$');
if (!regex.test(walletUserDetails.walletName)) {
this.logger.error(`Wallet name in wrong format.`);
throw new BadRequestException(`Please enter valid wallet name, It allows only alphanumeric values`);
}
const decryptedPassword = this.commonService.decryptPassword(walletUserDetails.walletPassword);
const decryptedPassword = this.commonService.decryptPassword(walletUserDetails.walletPassword);
walletUserDetails.walletPassword = decryptedPassword;
Comment on lines +117 to 126
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid logging sensitive wallet details

Logging the entire DTO can leak credentials (even encrypted). Log non-sensitive fields only.

-    this.logger.log(`**** Spin up the agent...${JSON.stringify(walletUserDetails)}`);
+    this.logger.log(`**** Spin up the agent... walletName=${walletUserDetails.walletName}, ledgerId=${walletUserDetails.ledgerId}`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
walletProvision(@Body() walletUserDetails: WalletDetailsDto, @User() user: object): Promise<object> {
this.logger.log(`**** Spin up the agent...${JSON.stringify(walletUserDetails)}`);
const regex = new RegExp('^[a-zA-Z0-9]+$');
if (!regex.test(walletUserDetails.walletName)) {
this.logger.error(`Wallet name in wrong format.`);
throw new BadRequestException(`Please enter valid wallet name, It allows only alphanumeric values`);
}
const decryptedPassword = this.commonService.decryptPassword(walletUserDetails.walletPassword);
const decryptedPassword = this.commonService.decryptPassword(walletUserDetails.walletPassword);
walletUserDetails.walletPassword = decryptedPassword;
walletProvision(@Body() walletUserDetails: WalletDetailsDto, @User() user: object): Promise<object> {
this.logger.log(`**** Spin up the agent... walletName=${walletUserDetails.walletName}, ledgerId=${walletUserDetails.ledgerId}`);
const regex = new RegExp('^[a-zA-Z0-9]+$');
if (!regex.test(walletUserDetails.walletName)) {
this.logger.error(`Wallet name in wrong format.`);
throw new BadRequestException(`Please enter valid wallet name, It allows only alphanumeric values`);
}
const decryptedPassword = this.commonService.decryptPassword(walletUserDetails.walletPassword);
walletUserDetails.walletPassword = decryptedPassword;
🤖 Prompt for AI Agents
In apps/api-gateway/src/agent/agent.controller.ts around lines 117 to 126, the
current logger.log call prints the entire walletUserDetails DTO (which may
include sensitive fields like walletPassword); replace that with a safe log that
only includes non-sensitive fields (e.g., walletUserDetails.walletName and
optional user identifier) or a sanitized object that explicitly omits
walletPassword and any credentials, and do not log the decryptedPassword
anywhere; update the log statement accordingly (remove
JSON.stringify(walletUserDetails) and never log walletPassword or decrypted
values).

return this.agentService.walletProvision(walletUserDetails, user);
}

/**
* Description: Route for fetch public DID
*/
@Get('/wallet/did/public')
@ApiTags('agent')
@UseGuards(AuthGuard('jwt'), RolesGuard)
@SetMetadata('permissions', [CommonConstants.PERMISSION_ORG_MGMT])
@ApiOperation({ summary: 'Fetch the current public DID', description: 'Fetch the current public DID.' })
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
getPublicDid(
@User() user: any
): Promise<object> {
this.logger.log(`**** Fetch public Did...`);
return this.agentService.getPublicDid(user);
}

/**
* Description: Route for assign public DID
* @param did
*/
@Get('/wallet/did/public/:id')
@ApiTags('agent')
@UseGuards(AuthGuard('jwt'), RolesGuard)
@SetMetadata('permissions', [CommonConstants.PERMISSION_USER_MANAGEMENT])
@ApiOperation({ summary: 'Assign public DID', description: 'Assign public DID for the current use.' })
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
assignPublicDid(
@Param('id') id: number,
@User() user: any
): Promise<object> {
this.logger.log(`**** Assign public DID...`);
this.logger.log(`user: ${user.orgId} == id: ${Number(id)}`);

if (user.orgId === Number(id)) {
return this.agentService.assignPublicDid(id, user);
} else {
this.logger.error(`Cannot make DID public of requested organization.`);
throw new BadRequestException(`Cannot make DID public requested organization.`);
}
}


/**
* Description: Route for onboarding register role on ledger
* @param role
* @param alias
* @param verkey
* @param did
* @param role
* @param alias
* @param verkey
* @param did
*/
@Get('/ledger/register-nym/:id')
@ApiTags('agent')
@UseGuards(AuthGuard('jwt'), RolesGuard)
@SetMetadata('permissions', [CommonConstants.PERMISSION_ORG_MGMT])
@ApiOperation({ summary: 'Send a NYM registration to the ledger', description: 'Write the DID to the ledger to make that DID public.' })
@ApiOperation({
summary: 'Send a NYM registration to the ledger',
description: 'Write the DID to the ledger to make that DID public.'
})
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
registerNym(
@Param('id') id: string,
@User() user: IUserRequestInterface
): Promise<object> {
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
registerNym(@Param('id') id: string, @User() user: IUserRequestInterface): Promise<object> {
this.logger.log(`user: ${typeof user.orgId} == id: ${typeof Number(id)}`);

if (user.orgId !== id) {
Expand All @@ -204,8 +165,8 @@ export class AgentController {
description: 'Platform Admin can restart or stop the running Aries Agent. (Platform Admin)'
})
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
@ApiParam({ name: 'action', enum: AgentActions })
restartStopAgent(@Param('orgId') orgId: string, @Param('action') action: string): Promise<object> {
return this.agentService.restartStopAgent(action, orgId);
Expand All @@ -220,8 +181,8 @@ export class AgentController {
description: 'Fetch the status of the Aries Cloud Agent.'
})
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
getAgentServerStatus(@User() user: any): Promise<object> {
this.logger.log(`**** getPlatformConfig called...`);
return this.agentService.getAgentServerStatus(user);
Expand Down Expand Up @@ -249,8 +210,8 @@ export class AgentController {
description: 'List of all created Aries Cloud Agent status.'
})
@ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto })
@ApiUnauthorizedResponse({ status: HttpStatus.UNAUTHORIZED, description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ status: HttpStatus.FORBIDDEN, description: 'Forbidden', type: ForbiddenErrorDto })
@ApiUnauthorizedResponse({ description: 'Unauthorized', type: UnauthorizedErrorDto })
@ApiForbiddenResponse({ description: 'Forbidden', type: ForbiddenErrorDto })
@ApiQuery({ name: 'items_per_page', required: false })
@ApiQuery({ name: 'page', required: false })
@ApiQuery({ name: 'search_text', required: false })
Expand All @@ -265,7 +226,6 @@ export class AgentController {
@Query('status') status: any,
@User() user: any
): Promise<object> {

this.logger.log(`status: ${typeof status} ${status}`);

items_per_page = items_per_page || 10;
Expand Down
Loading