From 55c1e5b880e933ff14511405891c85df27fefbca Mon Sep 17 00:00:00 2001 From: pranalidhanavade <137780597+pranalidhanavade@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:57:38 +0530 Subject: [PATCH] merge: develop to qa (#873) * fix: create organisation changes and added geo-location attribute in response Signed-off-by: Ganesh Nawle * fix: send email verification issue (#823) Signed-off-by: bhavanakarwade * refactor: bulk issuance template list response changes (#824) * refactor: updated schema response for get API Signed-off-by: tipusinghaw * fix: schema already exist logic Signed-off-by: tipusinghaw * fix: schema attribute while w3c schema creation Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * feat: batch bulk issunace (#826) * feat: batch bulk issuance Signed-off-by: tipusinghaw * stoped queue to remove issuance data Signed-off-by: tipusinghaw * feat: added delay for 1 min Signed-off-by: tipusinghaw * refactor: changed batch config Signed-off-by: tipusinghaw * feat: changed delay time for batch Signed-off-by: tipusinghaw * feat: added batch for retry Signed-off-by: tipusinghaw * refactor: added common constant in libs Signed-off-by: tipusinghaw * refactor: removed duplicate value from schema DTO Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * fix: constant issue for bulk issunace (#827) * feat: batch bulk issuance Signed-off-by: tipusinghaw * stoped queue to remove issuance data Signed-off-by: tipusinghaw * feat: added delay for 1 min Signed-off-by: tipusinghaw * refactor: changed batch config Signed-off-by: tipusinghaw * feat: changed delay time for batch Signed-off-by: tipusinghaw * feat: added batch for retry Signed-off-by: tipusinghaw * refactor: added common constant in libs Signed-off-by: tipusinghaw * refactor: removed duplicate value from schema DTO Signed-off-by: tipusinghaw * fix: constent issue Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * refactor: schema endorsement flow (#828) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * fix: delete organization bugs (#829) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * feature:added schema details in file_upload data and fix minor changes Signed-off-by: Ganesh Nawle * feature:added schema details in file_upload data,fix minor exception changes and resovle PR conflict Signed-off-by: Ganesh Nawle * feat: added schema details in table Signed-off-by: Ganesh Nawle * refactor: endorsement flow for key and web method (#831) * refactor: endorsement flow for key and web method Signed-off-by: bhavanakarwade * refactor: send email for issuance Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * fix: prisma model issue and refactored file_upload model Signed-off-by: Ganesh Nawle * fix: prisma migration issue Signed-off-by: Ganesh Nawle * fix: prisma migration issue (#835) Signed-off-by: Ganesh Nawle * fix: prisma migration issue Signed-off-by: Ganesh Nawle * fix: parameter and response related bugs (#837) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade * fix: cred def id space fixes Signed-off-by: bhavanakarwade * fix: create organization bug Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * fix:rollback statistics changes Signed-off-by: Ganesh Nawle * Fix/bugs (#839) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade * fix: cred def id space fixes Signed-off-by: bhavanakarwade * fix: create organization bug Signed-off-by: bhavanakarwade * fix: pagination issue for preview file Signed-off-by: bhavanakarwade * fix: pagination issue Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * fix: imageurl issue for verification process (#840) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade * fix: cred def id space fixes Signed-off-by: bhavanakarwade * fix: create organization bug Signed-off-by: bhavanakarwade * fix: pagination issue for preview file Signed-off-by: bhavanakarwade * fix: pagination issue Signed-off-by: bhavanakarwade * fix: imageurl issue in verification Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * fix: made reuqest Id parameter optional (#841) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade * fix: cred def id space fixes Signed-off-by: bhavanakarwade * fix: create organization bug Signed-off-by: bhavanakarwade * fix: pagination issue for preview file Signed-off-by: bhavanakarwade * fix: pagination issue Signed-off-by: bhavanakarwade * fix: imageurl issue in verification Signed-off-by: bhavanakarwade * fix: made request if parameter optional Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * refactor: added temaplateId column in file_upload table (#842) * fix: send email verification issue Signed-off-by: bhavanakarwade * refcator: schema endorsement flow Signed-off-by: bhavanakarwade * fix: resolved sonar lint issues Signed-off-by: bhavanakarwade * fix: worked on sonarcloud issues Signed-off-by: bhavanakarwade * fix: delete organization bugs Signed-off-by: bhavanakarwade * fix: cred def id space fixes Signed-off-by: bhavanakarwade * fix: create organization bug Signed-off-by: bhavanakarwade * fix: pagination issue for preview file Signed-off-by: bhavanakarwade * fix: pagination issue Signed-off-by: bhavanakarwade * fix: imageurl issue in verification Signed-off-by: bhavanakarwade * fix: made request if parameter optional Signed-off-by: bhavanakarwade * refactor: added templateId mapping in file upload functionality Signed-off-by: bhavanakarwade * refactor: interface types Signed-off-by: bhavanakarwade --------- Signed-off-by: bhavanakarwade * feat: changed issuance email template for EDUCRED Signed-off-by: Ganesh Nawle * fix:refactored preview uploaded file api changed query Param to path param Signed-off-by: Ganesh Nawle * added-logger statement Signed-off-by: Ganesh Nawle * fix:Minor fixes Signed-off-by: Ganesh Nawle * fix:removed all console logs Signed-off-by: Ganesh Nawle * feat:refactored api to add dynamic support to email template Signed-off-by: Ganesh Nawle * feat: added holder guard Signed-off-by: KulkarniShashank * feat: error message changes in user dto Signed-off-by: KulkarniShashank * feat: create cloud wallet (#852) * feat: creat cloud wallet Signed-off-by: tipusinghaw * fix: added error handling logic in common file Signed-off-by: tipusinghaw * fix: changed nkey veriable Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * fix: add validation in the user role guard (#854) * fix: add validation in the user role guard Signed-off-by: KulkarniShashank * fix: modify validation in the user role guard Signed-off-by: KulkarniShashank * fix: modify validation and error message changes in the user role guard Signed-off-by: KulkarniShashank --------- Signed-off-by: KulkarniShashank * refactor: store holder role in user role mapping table Signed-off-by: KulkarniShashank * feat: configure cloud base wallet Signed-off-by: KulkarniShashank * fix: remove holder guard for base wallet configure API Signed-off-by: KulkarniShashank * feat: implement proof presentation for holder (#860) * feat: accept proof request by holder API Signed-off-by: KulkarniShashank * feat: holder get proof presentation and get proof presentation by id Signed-off-by: KulkarniShashank * refactor: changes in accept proof request and get proof request Signed-off-by: KulkarniShashank --------- Signed-off-by: KulkarniShashank * feat: Added DID creation method for cloud wallet (#861) * feat: creat cloud wallet Signed-off-by: tipusinghaw * fix: added error handling logic in common file Signed-off-by: tipusinghaw * fix: changed nkey veriable Signed-off-by: tipusinghaw * feat: creat DID for wallet Signed-off-by: tipusinghaw * resolve conflicts Signed-off-by: tipusinghaw * Resolve sonar cloud issue Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * feat: create connection for holder (#863) * feat: connection invitaion creation Signed-off-by: KulkarniShashank * Merge branch 'develop' of https://github.com/credebl/platform into feat/connection-holder Signed-off-by: KulkarniShashank --------- Signed-off-by: KulkarniShashank * added cloud-wallet Dockerfile Signed-off-by: sahil.kamble@ayanworks.com * feat: implement credential APIs for cloud wallet (#865) * feat: creat cloud wallet Signed-off-by: tipusinghaw * fix: added error handling logic in common file Signed-off-by: tipusinghaw * fix: changed nkey veriable Signed-off-by: tipusinghaw * feat: creat DID for wallet Signed-off-by: tipusinghaw * resolve conflicts Signed-off-by: tipusinghaw * feat: credential APIs for cloud-wallet Signed-off-by: tipusinghaw * fix: changed create DID route Signed-off-by: tipusinghaw * fix: changed create DID route Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * feat: Added basic message on cloud wallet (#868) * feat: creat cloud wallet Signed-off-by: tipusinghaw * fix: added error handling logic in common file Signed-off-by: tipusinghaw * fix: changed nkey veriable Signed-off-by: tipusinghaw * feat: creat DID for wallet Signed-off-by: tipusinghaw * resolve conflicts Signed-off-by: tipusinghaw * feat: credential APIs for cloud-wallet Signed-off-by: tipusinghaw * fix: changed create DID route Signed-off-by: tipusinghaw * fix: changed create DID route Signed-off-by: tipusinghaw * feat: added baisc message implementation in cloud wallet Signed-off-by: tipusinghaw --------- Signed-off-by: tipusinghaw * fix: client id and client secret encrypt and decrypt Signed-off-by: KulkarniShashank * fix: dcrypted the clientId and client secret Signed-off-by: KulkarniShashank --------- Signed-off-by: Ganesh Nawle Signed-off-by: bhavanakarwade Signed-off-by: tipusinghaw Signed-off-by: KulkarniShashank Signed-off-by: sahil.kamble@ayanworks.com Signed-off-by: pranalidhanavade Co-authored-by: Ganesh Nawle Co-authored-by: ganesh_nawle <155989339+ganeshawle25@users.noreply.github.com> Co-authored-by: bhavanakarwade <137506897+bhavanakarwade@users.noreply.github.com> Co-authored-by: tipusinghaw <126460794+tipusinghaw@users.noreply.github.com> Co-authored-by: shitrerohit <37360542+shitrerohit@users.noreply.github.com> Co-authored-by: KulkarniShashank Co-authored-by: Shashank Kulkarni <44693969+KulkarniShashank@users.noreply.github.com> Co-authored-by: sahil.kamble@ayanworks.com Co-authored-by: KambleSahil3 <157386770+KambleSahil3@users.noreply.github.com> --- apps/user/src/user.service.ts | 12 +++++++++--- libs/common/src/response-messages/index.ts | 3 ++- libs/prisma-service/prisma/schema.prisma | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/user/src/user.service.ts b/apps/user/src/user.service.ts index 43934c1a5..832595b30 100644 --- a/apps/user/src/user.service.ts +++ b/apps/user/src/user.service.ts @@ -113,16 +113,20 @@ export class UserService { const verifyCode = uuidv4(); let sendVerificationMail: boolean; + const decryptClientId = await this.commonService.decryptPassword(clientId); + const decryptClientSecret = await this.commonService.decryptPassword(clientSecret); + try { - const token = await this.clientRegistrationService.getManagementToken(clientId, clientSecret); - const getClientData = await this.clientRegistrationService.getClientRedirectUrl(clientId, token); + const token = await this.clientRegistrationService.getManagementToken(decryptClientId, decryptClientSecret); + const getClientData = await this.clientRegistrationService.getClientRedirectUrl(decryptClientId, token); + const [redirectUrl] = getClientData[0]?.redirectUris || []; if (!redirectUrl) { throw new NotFoundException(ResponseMessages.user.error.redirectUrlNotFound); } - sendVerificationMail = await this.sendEmailForVerification(email, verifyCode, redirectUrl, clientId, brandLogoUrl, platformName); + sendVerificationMail = await this.sendEmailForVerification(email, verifyCode, redirectUrl, decryptClientId, brandLogoUrl, platformName); } catch (error) { throw new InternalServerErrorException(ResponseMessages.user.error.emailSend); } @@ -130,6 +134,8 @@ export class UserService { if (sendVerificationMail) { const uniqueUsername = await this.createUsername(email, verifyCode); userEmailVerification.username = uniqueUsername; + userEmailVerification.clientId = decryptClientId; + userEmailVerification.clientSecret = decryptClientSecret; const resUser = await this.userRepository.createUser(userEmailVerification, verifyCode); return resUser; } diff --git a/libs/common/src/response-messages/index.ts b/libs/common/src/response-messages/index.ts index 44cc512b4..f26edb774 100644 --- a/libs/common/src/response-messages/index.ts +++ b/libs/common/src/response-messages/index.ts @@ -549,4 +549,5 @@ export const ResponseMessages = { walletRecordNotFound: 'Wallet record not found.' } } -}; \ No newline at end of file +}; + diff --git a/libs/prisma-service/prisma/schema.prisma b/libs/prisma-service/prisma/schema.prisma index f11ad5679..2d6dc1487 100644 --- a/libs/prisma-service/prisma/schema.prisma +++ b/libs/prisma-service/prisma/schema.prisma @@ -483,7 +483,7 @@ model file_upload { organisation organisation? @relation(fields: [orgId], references: [id]) orgId String? @db.Uuid credential_type String? - templateId String? @db.VarChar + templateId String? @db.VarChar } model file_data {