Skip to content

Commit

Permalink
merge: develop to qa (#870)
Browse files Browse the repository at this point in the history
* fix: create organisation changes and added geo-location attribute in response

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: send email verification issue (#823)

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: bulk issuance template list response changes (#824)

* refactor: updated schema response for get API

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema already exist logic

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema attribute while w3c schema creation

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: batch bulk issunace (#826)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* fix: constant issue for bulk issunace (#827)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

* fix: constent issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* refactor: schema endorsement flow (#828)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs (#829)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* feature:added schema details in file_upload data and fix minor changes

Signed-off-by: Ganesh Nawle <[email protected]>

* feature:added schema details in file_upload data,fix minor exception changes and resovle PR conflict

Signed-off-by: Ganesh Nawle <[email protected]>

* feat: added schema details in  table

Signed-off-by: Ganesh Nawle <[email protected]>

* refactor: endorsement flow for key and web method (#831)

* refactor: endorsement flow for key and web method

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: send email for issuance

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: prisma model issue and refactored file_upload model

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue (#835)

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: parameter and response related bugs (#837)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix:rollback statistics changes

Signed-off-by: Ganesh Nawle <[email protected]>

* Fix/bugs (#839)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue for verification process (#840)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made reuqest Id parameter optional (#841)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added temaplateId column in file_upload table (#842)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* feat: changed issuance email template for EDUCRED

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:refactored preview uploaded file api changed query Param to path param

Signed-off-by: Ganesh Nawle <[email protected]>

* added-logger statement

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:Minor fixes

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:removed all console logs

Signed-off-by: Ganesh Nawle <[email protected]>

* feat:refactored  api to add dynamic support to email template

Signed-off-by: Ganesh Nawle <[email protected]>

* feat: added holder guard

Signed-off-by: KulkarniShashank <[email protected]>

* feat: error message changes in user dto

Signed-off-by: KulkarniShashank <[email protected]>

* feat: create cloud wallet (#852)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* fix: add validation in the user role guard (#854)

* fix: add validation in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

* fix: modify validation in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

* fix: modify validation and error message changes in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* refactor: store holder role in user role mapping table

Signed-off-by: KulkarniShashank <[email protected]>

* feat: configure cloud base wallet

Signed-off-by: KulkarniShashank <[email protected]>

* fix: remove holder guard for base wallet configure API

Signed-off-by: KulkarniShashank <[email protected]>

* feat: implement proof presentation for holder (#860)

* feat: accept proof request by holder API

Signed-off-by: KulkarniShashank <[email protected]>

* feat: holder get proof presentation and get proof presentation by id

Signed-off-by: KulkarniShashank <[email protected]>

* refactor: changes in accept proof request and get proof request

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* feat: Added DID creation method for cloud wallet (#861)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* Resolve sonar cloud issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: create connection for holder (#863)

* feat: connection invitaion creation

Signed-off-by: KulkarniShashank <[email protected]>

* Merge branch 'develop' of https://github.com/credebl/platform into feat/connection-holder

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* added cloud-wallet Dockerfile

Signed-off-by: [email protected] <[email protected]>

* feat: implement credential APIs for cloud wallet (#865)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* feat: credential APIs for cloud-wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: Added basic message on cloud wallet (#868)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* feat: credential APIs for cloud-wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* feat: added baisc message implementation in cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: Ganesh Nawle <[email protected]>
Signed-off-by: bhavanakarwade <[email protected]>
Signed-off-by: tipusinghaw <[email protected]>
Signed-off-by: KulkarniShashank <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Co-authored-by: Ganesh Nawle <[email protected]>
Co-authored-by: ganesh_nawle <[email protected]>
Co-authored-by: bhavanakarwade <[email protected]>
Co-authored-by: shitrerohit <[email protected]>
Co-authored-by: KulkarniShashank <[email protected]>
Co-authored-by: Shashank Kulkarni <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: KambleSahil3 <[email protected]>
  • Loading branch information
9 people committed Jul 25, 2024
1 parent f4e3bc4 commit 824a94a
Show file tree
Hide file tree
Showing 46 changed files with 3,044 additions and 70 deletions.
43 changes: 43 additions & 0 deletions Dockerfiles/Dockerfile.cloud-wallet
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Stage 1: Build the application
FROM node:18-slim as build
RUN npm install -g pnpm

RUN apt-get update -y
RUN apt-get --no-install-recommends install -y openssl
# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json ./

# Install dependencies
RUN pnpm install

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

# Build the user service
RUN pnpm run build cloud-wallet

# Stage 2: Create the final image
FROM node:18-slim

RUN apt-get update -y
RUN apt-get --no-install-recommends install -y openssl
# Set the working directory
WORKDIR /app
RUN npm install -g pnpm

# Copy the compiled code from the build stage
COPY --from=build /app/dist/apps/cloud-wallet/ ./dist/apps/cloud-wallet/

# Copy the libs folder from the build stage
COPY --from=build /app/libs/ ./libs/
#COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules


# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/cloud-wallet/main.js"]
4 changes: 3 additions & 1 deletion apps/api-gateway/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { UtilitiesModule } from './utilities/utilities.module';
import { NotificationModule } from './notification/notification.module';
import { GeoLocationModule } from './geo-location/geo-location.module';
import { CommonConstants } from '@credebl/common/common.constant';
import { CloudWalletModule } from './cloud-wallet/cloud-wallet.module';

@Module({
imports: [
Expand Down Expand Up @@ -56,7 +57,8 @@ import { CommonConstants } from '@credebl/common/common.constant';
WebhookModule,
NotificationModule,
CacheModule.register({ store: redisStore, host: process.env.REDIS_HOST, port: process.env.REDIS_PORT }),
GeoLocationModule
GeoLocationModule,
CloudWalletModule
],
controllers: [AppController],
providers: [AppService]
Expand Down
4 changes: 4 additions & 0 deletions apps/api-gateway/src/authz/guards/org-roles.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export class OrgRolesGuard implements CanActivate {
const req = context.switchToHttp().getRequest();
const { user } = req;

if (user?.userRole && user?.userRole.includes('holder')) {
throw new ForbiddenException('This role is a holder.');
}

req.params.orgId = req.params?.orgId ? req.params?.orgId?.trim() : '';
req.query.orgId = req.query?.orgId ? req.query?.orgId?.trim() : '';
req.body.orgId = req.body?.orgId ? req.body?.orgId?.trim() : '';
Expand Down
8 changes: 7 additions & 1 deletion apps/api-gateway/src/authz/guards/user-access-guard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable, CanActivate, ExecutionContext, UnauthorizedException } from '@nestjs/common';
import { Injectable, CanActivate, ExecutionContext, UnauthorizedException, ForbiddenException } from '@nestjs/common';
import { Observable } from 'rxjs';

@Injectable()
Expand All @@ -11,6 +11,12 @@ export class UserAccessGuard implements CanActivate {
if (user.hasOwnProperty('client_id')) {
throw new UnauthorizedException('You do not have access');
}

if (user?.userRole && user?.userRole.includes('holder')) {
throw new ForbiddenException('This role is a holder.');
}


return true;
}
}
21 changes: 21 additions & 0 deletions apps/api-gateway/src/authz/guards/user-role.guard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Injectable, CanActivate, ExecutionContext, ForbiddenException } from '@nestjs/common';
import { Observable } from 'rxjs';

@Injectable()
export class UserRoleGuard implements CanActivate {
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
const request = context.switchToHttp().getRequest();

const { user } = request;

if (!user?.userRole) {
throw new ForbiddenException('This role is not a holder.');
}

if (!user?.userRole.includes('holder')) {
throw new ForbiddenException('This role is not a holder.');
}

return true;
}
}
1 change: 1 addition & 0 deletions apps/api-gateway/src/authz/jwt-payload.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export interface JwtPayload {
scope: string;
gty?: string;
permissions: string[];
email?: string
}

5 changes: 5 additions & 0 deletions apps/api-gateway/src/authz/jwt.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {

let userDetails = null;

const userInfo = await this.usersService.getUserByUserIdInKeycloak(payload.email);
if (payload.hasOwnProperty('client_id')) {
const orgDetails: IOrganization = await this.organizationService.findOrganizationOwner(payload['client_id']);

Expand Down Expand Up @@ -87,6 +88,10 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
throw new NotFoundException(ResponseMessages.user.error.notFound);
}

if (userInfo && userInfo?.['attributes'] && userInfo?.['attributes']?.userRole) {
userDetails['userRole'] = userInfo?.['attributes']?.userRole;
}

return {
...userDetails,
...payload
Expand Down
Loading

0 comments on commit 824a94a

Please sign in to comment.