Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multi ecosystem feature to main branch #243

Merged
merged 178 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 175 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
86c7b0a
wip cli script for platform admin user
nishad-ayanworks Oct 18, 2023
0568ff7
Merge branch 'develop' of https://github.com/credebl/platform into 16…
nishad-ayanworks Oct 18, 2023
438449f
refactored cli commands file
nishad-ayanworks Oct 19, 2023
5260373
feat: get all ecosystem's schemas
tipusinghaw Oct 23, 2023
a2e1f49
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 23, 2023
c9c52c4
fix: removed commented code
tipusinghaw Oct 23, 2023
ee97135
feat: refactor api for passkey module
bhavanakarwade Oct 13, 2023
94505e5
fix: Added validation for schema and cred-def and updated payload for…
KulkarniShashank Oct 13, 2023
6dd1927
fix: removed unused orgId
tipusinghaw Oct 13, 2023
8dd6678
resolved sonar lint checks
bhavanakarwade Oct 16, 2023
4e60d56
feat: Schema and cred-def auto sign and submit endorsement transactio…
KulkarniShashank Oct 13, 2023
1d31e6e
refactor: api for passkey module
bhavanakarwade Oct 16, 2023
8008c5e
fix: decline endorsement request
tipusinghaw Oct 16, 2023
c0a0636
refactor: Implemented org validation for create and invite ecosystem
tipusinghaw Oct 16, 2023
49897b6
refactor: ecosystem lead details included ecosystem dashboard (#156)
nishad-ayanworks Oct 16, 2023
bbea365
remove unnecessary code
bhavanakarwade Oct 17, 2023
dd908a8
refactor return type
bhavanakarwade Oct 17, 2023
1c1c5ea
refactor: Implemented auto flag handling within the ecosystem and int…
KulkarniShashank Oct 17, 2023
f49d744
feat: Out-Of-Band issuance
Oct 19, 2023
afc8bcc
fix: implemented request body in credential definition request
tipusinghaw Oct 18, 2023
9a4bd28
fix: added attributes as array of string
tipusinghaw Oct 18, 2023
e0f181d
refactor: send ecosystem invitations link
bhavanakarwade Oct 18, 2023
b814757
fix: send invitation flow for organization & ecosystem (#179)
nishad-ayanworks Oct 19, 2023
d0548a0
feat: cred-def list by schemaId for verification (#180)
KulkarniShashank Oct 19, 2023
f9ba022
Request payload changes in the issuance
Oct 19, 2023
0949e94
Solved the credential-def bug in endorsement (#181)
KulkarniShashank Oct 19, 2023
878af7b
Bulk out of band issuance function
Oct 21, 2023
64b8111
Out of band verification with bulk emailIds
Oct 21, 2023
0affdf1
fixed ecosystem invitations (#182)
nishad-ayanworks Oct 19, 2023
52fcdc5
Support indicio:demonet and indicio:testnet
Oct 21, 2023
3ee0eec
Add API for Organization profile
Oct 23, 2023
e6403c3
Error handling in the org profile
Oct 23, 2023
62e775c
Connection image url add
Oct 23, 2023
919234b
Orgnization logo setup in the connection service
Oct 23, 2023
0f29ee8
Added the emailId and attribute in the issuance oob payload
Oct 23, 2023
2249606
Added the API for get oob verification qr code
Oct 25, 2023
450c999
feat: download CSV template for bulk-issuance
tipusinghaw Oct 25, 2023
1079435
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 25, 2023
1007a4f
Removed duplication error in the issuance and verification service
Oct 25, 2023
9ca8dcb
Removed duplication error in the issuance and verification service
Oct 25, 2023
e2dc8c9
Added await for natsCall function and solved the error in sona cloud
Oct 25, 2023
6375a1c
Merge pull request #189 from credebl/shell-script-modifications
Sheetal-ayanworks Oct 25, 2023
5b503f7
feat: made CREDEBL white label
bhavanakarwade Oct 25, 2023
0b69046
Merge branch 'develop' of https://github.com/credebl/platform into ap…
bhavanakarwade Oct 25, 2023
095e59e
fix: implemented request body in credential definition request
tipusinghaw Oct 18, 2023
81896bb
fix: added attributes as array of string
tipusinghaw Oct 18, 2023
d9b2b82
refactor: send ecosystem invitations link
bhavanakarwade Oct 18, 2023
5e99324
fix: send invitation flow for organization & ecosystem (#179)
nishad-ayanworks Oct 19, 2023
437205c
feat: cred-def list by schemaId for verification (#180)
KulkarniShashank Oct 19, 2023
e1effef
Solved the credential-def bug in endorsement (#181)
KulkarniShashank Oct 19, 2023
a5f7be8
Modify the shell script for the spi-up the agent
Oct 25, 2023
45e45ce
fixed ecosystem invitations (#182)
nishad-ayanworks Oct 19, 2023
becf066
Support indicio:demonet and indicio:testnet
Oct 21, 2023
6ace6af
Add API for Organization profile
Oct 23, 2023
01bafb9
Error handling in the org profile
Oct 23, 2023
ec02377
Connection image url add
Oct 23, 2023
7d7d046
Orgnization logo setup in the connection service
Oct 23, 2023
080fc21
Solved connection image url
Oct 25, 2023
d415d8a
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 25, 2023
43601a1
Merge pull request #191 from credebl/shell-script-modifications
Sheetal-ayanworks Oct 25, 2023
5d8d5bd
feat: fetch cred-def and schema details based on orgId
tipusinghaw Oct 25, 2023
915157a
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 25, 2023
8d14505
Merge branch 'main' of https://github.com/credebl/credebl-platform in…
Oct 25, 2023
9de2b42
refactor: removed commented code
tipusinghaw Oct 25, 2023
5ed6220
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 25, 2023
f359a98
Merge branch 'develop' of https://github.com/credebl/platform into ap…
bhavanakarwade Oct 25, 2023
dad1609
Solved fixes in the issuance and verification
Oct 25, 2023
214990e
resolved sonarlint checks
bhavanakarwade Oct 25, 2023
6d0ea0a
Merge pull request #192 from credebl/184-bulk-issuance
KulkarniShashank Oct 25, 2023
a0819c7
Merge branch 'develop' of https://github.com/credebl/platform into ap…
bhavanakarwade Oct 26, 2023
9bc7771
Solved qr code image url in issuance and verification
Oct 26, 2023
f6a38bc
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 26, 2023
ba611fb
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 26, 2023
0b26784
Merge pull request #188 from credebl/out-of-band
bhavanakarwade Oct 26, 2023
19765e4
Merge branch 'develop' of https://github.com/credebl/platform into ap…
bhavanakarwade Oct 26, 2023
b73a039
added logo image class in oob email template
bhavanakarwade Oct 26, 2023
f25f222
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 26, 2023
c16935b
added class to image tag
bhavanakarwade Oct 26, 2023
b42367c
Merge pull request #193 from credebl/app-white-labelling
KulkarniShashank Oct 26, 2023
47de9b8
Worked on the multi ecosystem support feature
nishad-ayanworks Oct 26, 2023
6248426
Merge branch 'develop' of https://github.com/credebl/platform into 16…
nishad-ayanworks Oct 26, 2023
2b9d3d7
Merge pull request #194 from credebl/169-multi-ecosystem-support
KulkarniShashank Oct 26, 2023
af16a00
fix: fixed credDef tag name
tipusinghaw Oct 27, 2023
1fd925c
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 27, 2023
abbe548
feat: Import existing did in wallet
Oct 27, 2023
fb060a2
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 27, 2023
41eb967
Solved the role guard in connection
Oct 27, 2023
92972d0
Merge pull request #195 from credebl/184-bulk-issuance
KulkarniShashank Oct 27, 2023
298af2e
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 27, 2023
218cc30
feat: implemented import existing DID on wallet (#196)
KulkarniShashank Oct 27, 2023
88e85ef
Solved base64 qr code API in issuance and verification
Oct 27, 2023
01610c6
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
Oct 27, 2023
78af292
fix: Solved display base64 qr code URL in issuance and verification (…
KulkarniShashank Oct 27, 2023
af3853e
Solved connection image url
Oct 27, 2023
70d0d3d
Merge pull request #199 from credebl/import-existing-did
bhavanakarwade Oct 27, 2023
91a291e
updated platform admin script
nishad-ayanworks Oct 27, 2023
0356c69
updated schema prisma for the pooler database url (#200)
nishad-ayanworks Oct 27, 2023
1ef2370
refactor: revert schema prisma pooling (#201)
nishad-ayanworks Oct 27, 2023
a80f974
Worked on the platform admin script and stored role details
nishad-ayanworks Oct 30, 2023
18243b2
Merge branch 'develop' of https://github.com/credebl/platform into 16…
nishad-ayanworks Oct 30, 2023
a1147b3
Merge pull request #206 from credebl/168-platform-admin-script
KulkarniShashank Oct 30, 2023
601b88f
feat: upload csv file for bulk-issuance
tipusinghaw Oct 30, 2023
7e7da6d
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 30, 2023
7babe0e
fix: changed sucess message
tipusinghaw Oct 30, 2023
61497ee
fix: added auth Use guard
tipusinghaw Oct 30, 2023
d28bf6d
fix: changed search parameter
tipusinghaw Oct 30, 2023
36bd811
Merge pull request #183 from credebl/159-develop-display-all-schema-list
KulkarniShashank Oct 30, 2023
b766208
feat: decryption of password (#207)
bhavanakarwade Oct 30, 2023
ba07c9f
worked on the public org profile for credentials list
nishad-ayanworks Oct 30, 2023
86b5711
Merge branch 'develop' of https://github.com/credebl/platform into re…
nishad-ayanworks Oct 30, 2023
d49ebc2
included schemaas in the public org details
nishad-ayanworks Oct 30, 2023
565aadd
fix: added orgId in download csv
tipusinghaw Oct 30, 2023
8b3af87
fix changed migration for resource Id
tipusinghaw Oct 30, 2023
98758cb
Changes done in issuance docker file for decrease prisma connections
nishad-ayanworks Oct 30, 2023
bc8502c
Merge pull request #208 from credebl/refactor-public-org-profile
KulkarniShashank Oct 30, 2023
ad74a9a
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 30, 2023
9ee0fd5
Merge pull request #209 from credebl/159-develop-display-all-schema-list
nishad-ayanworks Oct 30, 2023
09a7ff4
fix: orgId parameter for ecosystem schema
tipusinghaw Oct 30, 2023
75c317d
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 30, 2023
605caaa
Merge pull request #210 from credebl/159-develop-display-all-schema-list
nishad-ayanworks Oct 30, 2023
71bc913
fix: added condition for empty resouceId
tipusinghaw Oct 30, 2023
23bbb1d
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 30, 2023
f741a17
Merge pull request #211 from credebl/159-develop-display-all-schema-list
KulkarniShashank Oct 31, 2023
6f63f6e
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Oct 31, 2023
dbd915b
feat: added csv upload folder
tipusinghaw Oct 31, 2023
2844c28
feat: added csv upload folder
tipusinghaw Oct 31, 2023
fcf6f14
Merge pull request #213 from credebl/159-develop-display-all-schema-list
KulkarniShashank Oct 31, 2023
0432348
fix: eocosystem schema list
tipusinghaw Oct 31, 2023
b77192a
Merge pull request #214 from credebl/159-develop-display-all-schema-list
KulkarniShashank Oct 31, 2023
818bda2
feat: update platform and ecosystem settings
bhavanakarwade Oct 31, 2023
6cb2756
Merge branch 'develop' of https://github.com/credebl/platform into up…
bhavanakarwade Oct 31, 2023
164af92
resolved sonar lint checks
bhavanakarwade Oct 31, 2023
4dd4ac8
resolved sonar cloud errors
bhavanakarwade Oct 31, 2023
06c7929
removed extra logo file
bhavanakarwade Oct 31, 2023
916d55e
Merge pull request #215 from credebl/update-platform-ecosystem-settings
nishad-ayanworks Oct 31, 2023
916889b
Fixed the issue of endorsement request for the specific ecosystem (#216)
nishad-ayanworks Oct 31, 2023
c12f320
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Nov 1, 2023
e878af0
feat: preview csv details API
tipusinghaw Nov 1, 2023
52ef8ac
Connection bug fixes if connection is exist
Nov 1, 2023
c09b102
worked on the auto-endorsement flag settings of ecosystem
nishad-ayanworks Nov 1, 2023
250a807
Merge pull request #220 from credebl/connection-fixes
nishad-ayanworks Nov 1, 2023
877d2c6
Merge pull request #221 from credebl/219-auto-endorsement-ecosystem-lead
KulkarniShashank Nov 2, 2023
a96e26f
feat: bulk issuance using nest queues
tipusinghaw Nov 2, 2023
441a826
fix: deleted unused docker file
tipusinghaw Nov 2, 2023
633a416
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Nov 2, 2023
7e9e044
refactor: added file size limit
tipusinghaw Nov 2, 2023
1b1f62b
Merge pull request #222 from credebl/184-bulk-issuance-start-issuance
KulkarniShashank Nov 2, 2023
ad17bd0
fix: added multer config
tipusinghaw Nov 2, 2023
8d3961a
Merge pull request #223 from credebl/184-bulk-issuance-start-issuance
KulkarniShashank Nov 2, 2023
e9c6c51
fix: multer issue
tipusinghaw Nov 2, 2023
65b92ca
Merge pull request #224 from credebl/184-bulk-issuance-start-issuance
KulkarniShashank Nov 2, 2023
40d0cb8
Copy upload files in api-gateway dockerfile
Nov 3, 2023
2597143
Merge pull request #226 from credebl/184-bulk-issuance-start-issuance
Sheetal-ayanworks Nov 3, 2023
3d68586
Changes the upload file path on api-gateway
Nov 3, 2023
32186ca
Merge pull request #227 from credebl/184-bulk-issuance-start-issuance
Sheetal-ayanworks Nov 3, 2023
f0e19c2
Added the logs for the csv upload file
Nov 6, 2023
4241f25
Merge pull request #231 from credebl/184-bulk-issuance-start-issuance
Sheetal-ayanworks Nov 6, 2023
92149c0
worked on the get platform settings and ecosystem name conflict
nishad-ayanworks Nov 7, 2023
56aa8ef
Merge pull request #235 from credebl/ecosystem-service-fixes
KulkarniShashank Nov 7, 2023
4c74218
fix: test file upload
tipusinghaw Nov 7, 2023
1243841
Merge pull request #236 from credebl/upload-csv-issue
Sheetal-ayanworks Nov 7, 2023
8be234c
feat: file rename issue
tipusinghaw Nov 7, 2023
ecdbdaf
Merge pull request #237 from credebl/upload-csv-issue
KulkarniShashank Nov 7, 2023
22087b5
Fixes:added helmet configuration i.e security vulnerablity mitigatio…
pallavighule Nov 7, 2023
f7b49e9
Merge pull request #238 from credebl/Security-vulnerability-fix-v1
nishad-ayanworks Nov 7, 2023
977eff6
refactor: changed upload file loction to libs folder
tipusinghaw Nov 8, 2023
f2842fb
Merge branch 'develop' of https://github.com/credebl/credebl-platform…
tipusinghaw Nov 8, 2023
7aaf398
refactor: added common method for read file data
tipusinghaw Nov 8, 2023
f1cdec9
refactor: changed multer logic
tipusinghaw Nov 8, 2023
aff7e42
added static path in main file
tipusinghaw Nov 8, 2023
03e315f
Merge pull request #239 from credebl/upload-csv-issue
nishad-ayanworks Nov 8, 2023
ff78da8
added PWD path
tipusinghaw Nov 8, 2023
a877588
added PWD path (#240)
tipusinghaw Nov 8, 2023
1be4da1
refactor: add API to read file data
tipusinghaw Nov 8, 2023
f7982bd
Merge pull request #241 from credebl/upload-csv-issue
nishad-ayanworks Nov 8, 2023
8314d87
removed bulk issuance feature
nishad-ayanworks Nov 9, 2023
2136392
cosmetic changes
nishad-ayanworks Nov 9, 2023
6a41e66
removed multer configs
nishad-ayanworks Nov 9, 2023
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 .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PLATFORM_ID=

AFJ_AGENT_ENDPOINT_PATH=/apps/agent-provisioning/AFJ/endpoints/
DATABASE_URL="postgresql://postgres:xxxxxx@localhost:5432/postgres?schema=public" #Provide supabase postgres url and Use the correct user/pwd, IP Address
POOL_DATABASE_URL="" #Provide pooler supabase postgres url
CLUSTER_NAME="" # ecs cluster
TESKDEFINITION_FAMILY="" # ecs task-definition
AGENT_PROTOCOL=http
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
dist
uploadedFiles
.env
sonar-project.properties
.scannerwork/*
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.api-gateway
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COPY --from=build /app/dist/apps/api-gateway/ ./dist/apps/api-gateway/
# Copy the libs folder from the build stage
COPY --from=build /app/libs/ ./libs/
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/uploadedFiles ./uploadedFiles

# Set the command to run the microservice
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/api-gateway/main.js"]
1 change: 1 addition & 0 deletions Dockerfiles/Dockerfile.issuance
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ COPY --from=build /app/dist/apps/issuance/ ./dist/apps/issuance/
COPY --from=build /app/libs/ ./libs/
#COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/uploadedFiles ./uploadedFiles


# Set the command to run the microservice
Expand Down
7 changes: 6 additions & 1 deletion apps/agent-service/src/agent-service.controller.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller } from '@nestjs/common';
import { MessagePattern } from '@nestjs/microservices';
import { AgentServiceService } from './agent-service.service';
import { GetCredDefAgentRedirection, GetSchemaAgentRedirection, IAgentSpinupDto, IIssuanceCreateOffer, ITenantCredDef, ITenantDto, ITenantSchema } from './interface/agent-service.interface';
import { GetCredDefAgentRedirection, GetSchemaAgentRedirection, IAgentSpinupDto, IIssuanceCreateOffer, ITenantCredDef, ITenantDto, ITenantSchema, OutOfBandCredentialOffer } from './interface/agent-service.interface';
import { IConnectionDetails, IUserRequestInterface } from './interface/agent-service.interface';
import { ISendProofRequestPayload } from './interface/agent-service.interface';
import { user } from '@prisma/client';
Expand Down Expand Up @@ -124,4 +124,9 @@ export class AgentServiceController {
async submitTransaction(payload: { url: string, apiKey: string, submitEndorsementPayload:object }): Promise<object> {
return this.agentServiceService.sumbitTransaction(payload.url, payload.apiKey, payload.submitEndorsementPayload);
}

@MessagePattern({ cmd: 'agent-out-of-band-credential-offer' })
async outOfBandCredentialOffer(payload: { outOfBandIssuancePayload: OutOfBandCredentialOffer, url: string, apiKey: string }): Promise<object> {
return this.agentServiceService.outOfBandCredentialOffer(payload.outOfBandIssuancePayload, payload.url, payload.apiKey);
}
}
38 changes: 25 additions & 13 deletions apps/agent-service/src/agent-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as dotenv from 'dotenv';
import * as fs from 'fs';
import { catchError, map } from 'rxjs/operators';
dotenv.config();
import { GetCredDefAgentRedirection, IAgentSpinupDto, IStoreOrgAgentDetails, ITenantCredDef, ITenantDto, ITenantSchema, IWalletProvision, ISendProofRequestPayload, IIssuanceCreateOffer } from './interface/agent-service.interface';
import { GetCredDefAgentRedirection, IAgentSpinupDto, IStoreOrgAgentDetails, ITenantCredDef, ITenantDto, ITenantSchema, IWalletProvision, ISendProofRequestPayload, IIssuanceCreateOffer, OutOfBandCredentialOffer } from './interface/agent-service.interface';
import { AgentType, OrgAgentType } from '@credebl/enum/enum';
import { IConnectionDetails, IUserRequestInterface } from './interface/agent-service.interface';
import { AgentServiceRepository } from './repositories/agent-service.repository';
Expand Down Expand Up @@ -133,7 +133,7 @@ export class AgentServiceService {

agentSpinupDto.agentType = agentSpinupDto.agentType ? agentSpinupDto.agentType : 1;
agentSpinupDto.tenant = agentSpinupDto.tenant ? agentSpinupDto.tenant : false;
agentSpinupDto.ledgerId = !agentSpinupDto.ledgerId || 0 === agentSpinupDto.ledgerId.length ? [3] : agentSpinupDto.ledgerId;
agentSpinupDto.ledgerId = !agentSpinupDto.ledgerId || 0 === agentSpinupDto.ledgerId?.length ? [3] : agentSpinupDto.ledgerId;


const platformConfig: platform_config = await this.agentServiceRepository.getPlatformConfigDetails();
Expand Down Expand Up @@ -289,7 +289,8 @@ export class AgentServiceService {
orgId: orgData.id,
walletName: agentSpinupDto.walletName,
clientSocketId: agentSpinupDto.clientSocketId,
ledgerId
ledgerId,
did: agentSpinupDto.did
};

if (agentEndPoint && agentSpinupDto.clientSocketId) {
Expand Down Expand Up @@ -338,21 +339,20 @@ export class AgentServiceService {


const agentDidWriteUrl = `${payload.agentEndPoint}${CommonConstants.URL_AGENT_WRITE_DID}`;
const { seed, ledgerId } = payload;
const { apiKey } = payload;
const { seed, ledgerId, did, apiKey } = payload;
const writeDid = 'write-did';
const ledgerDetails: ledgers[] = await this.agentServiceRepository.getGenesisUrl(ledgerId);
const agentDid = await this._retryAgentSpinup(agentDidWriteUrl, apiKey, writeDid, seed, ledgerDetails[0].indyNamespace);
const agentDid = await this._retryAgentSpinup(agentDidWriteUrl, apiKey, writeDid, seed, ledgerDetails[0].indyNamespace, did);
if (agentDid) {

const getDidMethodUrl = `${payload.agentEndPoint}${CommonConstants.URL_AGENT_GET_DIDS}`;
const getDidMethodUrl = `${payload.agentEndPoint}${CommonConstants.URL_AGENT_GET_DID}`.replace('#', agentDid['did']);
const getDidDic = 'get-did-doc';
const getDidMethod = await this._retryAgentSpinup(getDidMethodUrl, apiKey, getDidDic);


const storeOrgAgentData: IStoreOrgAgentDetails = {
did: getDidMethod[0]?.did,
verkey: getDidMethod[0]?.didDocument?.verificationMethod[0]?.publicKeyBase58,
did: getDidMethod['didDocument']?.id,
verkey: getDidMethod['didDocument']?.verificationMethod[0]?.publicKeyBase58,
isDidPublic: true,
agentSpinUpStatus: 2,
walletName: payload.walletName,
Expand Down Expand Up @@ -389,14 +389,14 @@ export class AgentServiceService {
}
}

async _retryAgentSpinup(agentUrl: string, apiKey: string, agentApiState: string, seed?: string, indyNamespace?: string): Promise<object> {
async _retryAgentSpinup(agentUrl: string, apiKey: string, agentApiState: string, seed?: string, indyNamespace?: string, did?: string): Promise<object> {
return retry(
async () => {

if ('write-did' === agentApiState) {

const agentDid = await this.commonService
.httpPost(agentUrl, { seed, method: indyNamespace }, { headers: { 'x-api-key': apiKey } })
.httpPost(agentUrl, { seed, method: indyNamespace, did: did ? did : undefined }, { headers: { 'x-api-key': apiKey } })
.then(async response => response);
return agentDid;
} else if ('get-did-doc' === agentApiState) {
Expand Down Expand Up @@ -487,7 +487,7 @@ export class AgentServiceService {
async _createTenant(payload: ITenantDto, user: IUserRequestInterface): Promise<void> {
try {

payload.ledgerId = !payload.ledgerId || 0 === payload.ledgerId.length ? [3] : payload.ledgerId;
payload.ledgerId = !payload.ledgerId || 0 === payload.ledgerId?.length ? [3] : payload.ledgerId;

const ledgerDetails: ledgers[] = await this.agentServiceRepository.getGenesisUrl(payload.ledgerId);
const sharedAgentSpinUpResponse = new Promise(async (resolve, _reject) => {
Expand Down Expand Up @@ -520,12 +520,13 @@ export class AgentServiceService {
let tenantDetails;
const url = `${platformAdminSpinnedUp.org_agents[0].agentEndPoint}${CommonConstants.URL_SHAGENT_CREATE_TENANT}`;
for (const iterator of ledgerDetails) {
const { label, seed } = payload;
const { label, seed, did } = payload;
const createTenantOptions = {
config: {
label
},
seed,
did: did ? did : undefined,
method: iterator.indyNamespace
};
const apiKey = '';
Expand Down Expand Up @@ -944,5 +945,16 @@ export class AgentServiceService {
}
}

async outOfBandCredentialOffer(outOfBandIssuancePayload: OutOfBandCredentialOffer, url: string, apiKey: string): Promise<object> {
try {
const sendOutOfbandCredentialOffer = await this.commonService
.httpPost(url, outOfBandIssuancePayload, { headers: { 'x-api-key': apiKey } })
.then(async response => response);
return sendOutOfbandCredentialOffer;
} catch (error) {
this.logger.error(`Error in out-of-band credential in agent service : ${JSON.stringify(error)}`);
throw new RpcException(error);
}
}
}

17 changes: 14 additions & 3 deletions apps/agent-service/src/interface/agent-service.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@ export interface IAgentSpinupDto {
walletPassword: string;
seed: string;
orgId: number;
did?: string;
ledgerId?: number[];
agentType?: AgentType;
transactionApproval?: boolean;
clientSocketId?: string
tenant?: boolean;
}

export interface OutOfBandCredentialOffer {
emailId: string;
attributes: Attributes[];
credentialDefinitionId: string;
comment: string;
protocolVersion?: string;
orgId: number;
}

export interface ITenantDto {
label: string;
seed: string;
ledgerId?: number[];
method: string;
orgId: number;
did?: string;
ledgerId?: number[];
tenantId?: string;
clientSocketId?: string;
}
Expand Down Expand Up @@ -231,10 +242,10 @@ export interface ICredentialFormats {
}

export interface IIndy {
attributes: IAttributes[];
attributes: Attributes[];
}

export interface IAttributes {
export interface Attributes {
name: string;
value: string;
}
Expand Down
6 changes: 5 additions & 1 deletion apps/api-gateway/src/agent-service/dto/agent-service.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class AgentSpinupDto {
@IsNotEmpty({ message: 'Password is required.' })
walletPassword: string;


@ApiProperty()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'seed is required' })
Expand All @@ -35,6 +34,11 @@ export class AgentSpinupDto {
})
seed: string;

@ApiProperty()
@IsOptional()
@IsString({ message: 'did must be in string format.' })
did?: string;

@ApiProperty({ example: [1] })
@IsOptional()
@IsArray({ message: 'ledgerId must be an array' })
Expand Down
5 changes: 5 additions & 0 deletions apps/api-gateway/src/agent-service/dto/create-tenant.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export class CreateTenantDto {

orgId: number;

@ApiProperty()
@IsOptional()
@IsString({ message: 'did must be in string format.' })
did?: string;

@ApiProperty()
@IsOptional()
@ApiPropertyOptional()
Expand Down
9 changes: 8 additions & 1 deletion apps/api-gateway/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { commonNatsOptions } from 'libs/service/nats.options';
import { UserModule } from './user/user.module';
import { ConnectionModule } from './connection/connection.module';
import { EcosystemModule } from './ecosystem/ecosystem.module';
import { BullModule } from '@nestjs/bull';

@Module({
imports: [
Expand All @@ -42,7 +43,13 @@ import { EcosystemModule } from './ecosystem/ecosystem.module';
UserModule,
ConnectionModule,
IssuanceModule,
EcosystemModule
EcosystemModule,
BullModule.forRoot({
redis: {
host: process.env.REDIS_HOST,
port: parseInt(process.env.REDIS_PORT)
}
})
],
controllers: [AppController],
providers: [AppService]
Expand Down
33 changes: 4 additions & 29 deletions apps/api-gateway/src/authz/authz.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
BadRequestException,
Body,
Controller,
Get,
Expand Down Expand Up @@ -83,37 +82,17 @@ export class AuthzController {
@Post('/signup')
@ApiOperation({ summary: 'Register new user to platform', description: 'Register new user to platform' })
async addUserDetails(@Body() userInfo: AddUserDetails, @Res() res: Response): Promise<Response> {
let finalResponse;
let userDetails;

if (false === userInfo.isPasskey) {

const decryptedPassword = this.commonService.decryptPassword(userInfo.password);
if (8 <= decryptedPassword.length && 50 >= decryptedPassword.length) {
this.commonService.passwordValidation(decryptedPassword);
userInfo.password = decryptedPassword;
userDetails = await this.authzService.addUserDetails(userInfo);
finalResponse = {
statusCode: HttpStatus.CREATED,
message: ResponseMessages.user.success.create,
data: userDetails.response
};
} else {
throw new BadRequestException('Password name must be between 8 to 50 Characters');
}
} else {

userDetails = await this.authzService.addUserDetails(userInfo);
finalResponse = {
const userDetails = await this.authzService.addUserDetails(userInfo);
const finalResponse = {
statusCode: HttpStatus.CREATED,
message: ResponseMessages.user.success.create,
data: userDetails.response
};
}
return res.status(HttpStatus.CREATED).json(finalResponse);

}


/**
*
* @param loginUserDto
Expand All @@ -130,11 +109,7 @@ export class AuthzController {
async login(@Body() loginUserDto: LoginUserDto, @Res() res: Response): Promise<Response> {

if (loginUserDto.email) {
let decryptedPassword;
if (loginUserDto.password) {
decryptedPassword = this.commonService.decryptPassword(loginUserDto.password);
}
const userData = await this.authzService.login(loginUserDto.email, decryptedPassword, loginUserDto.isPasskey);
const userData = await this.authzService.login(loginUserDto.email, loginUserDto.password, loginUserDto.isPasskey);
const finalResponse: IResponseType = {
statusCode: HttpStatus.OK,
message: ResponseMessages.user.success.login,
Expand Down
15 changes: 15 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 @@ -51,6 +51,21 @@ export class OrgRolesGuard implements CanActivate {
}
});

} else if (requiredRolesNames.includes(OrgRoles.PLATFORM_ADMIN)) {

// eslint-disable-next-line array-callback-return
const isPlatformAdmin = user.userOrgRoles.find((orgDetails) => {
if (orgDetails.orgRole.name === OrgRoles.PLATFORM_ADMIN) {
return true;
}
});

if (isPlatformAdmin) {
return true;
}

return false;

} else {
throw new HttpException('organization is required', HttpStatus.BAD_REQUEST);
}
Expand Down
1 change: 1 addition & 0 deletions apps/api-gateway/src/config/multer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as fs from 'fs';
export const multerCSVOptions = {
storage: diskStorage({
destination: (req, file, cb) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { id } = req.body;
const path = `./uploadedFiles/import`;
fs.mkdirSync(path, { recursive: true });
Expand Down
2 changes: 1 addition & 1 deletion apps/api-gateway/src/connection/connection.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class ConnectionController {
@Post('/orgs/:orgId/connections')
@ApiOperation({ summary: 'Create outbound out-of-band connection (Legacy Invitation)', description: 'Create outbound out-of-band connection (Legacy Invitation)' })
@UseGuards(AuthGuard('jwt'), OrgRolesGuard)
@Roles(OrgRoles.OWNER, OrgRoles.ADMIN)
@Roles(OrgRoles.OWNER, OrgRoles.ADMIN, OrgRoles.ISSUER, OrgRoles.VERIFIER, OrgRoles.MEMBER)
@ApiResponse({ status: 201, description: 'Success', type: AuthTokenResponse })
async createLegacyConnectionInvitation(
@Param('orgId') orgId: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,25 @@ export class CredentialDefinitionController {
};
return res.status(HttpStatus.CREATED).json(credDefResponse);
}

@Get('/orgs/:orgId/bulk/cred-defs')
@ApiOperation({
summary: 'Fetch all credential definition for bulk opeartion',
description: 'Fetch all credential definition from metadata saved in database for bulk opeartion.'
})
@ApiResponse({ status: 200, description: 'Success', type: ApiResponseDto })
@Roles(OrgRoles.OWNER, OrgRoles.ADMIN, OrgRoles.ISSUER, OrgRoles.VERIFIER)
@UseGuards(AuthGuard('jwt'), OrgRolesGuard)
async getAllCredDefAndSchemaForBulkOperation(
@Param('orgId') orgId: number,
@Res() res: Response
): Promise<object> {
const credentialsDefinitionDetails = await this.credentialDefinitionService.getAllCredDefAndSchemaForBulkOperation(orgId);
const credDefResponse: IResponseType = {
statusCode: HttpStatus.OK,
message: ResponseMessages.credentialDefinition.success.fetch,
data: credentialsDefinitionDetails.response
};
return res.status(HttpStatus.CREATED).json(credDefResponse);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ export class CredentialDefinitionService extends BaseService {
const payload = { schemaId };
return this.sendNats(this.credDefServiceProxy, 'get-all-credential-definitions-by-schema-id', payload);
}

getAllCredDefAndSchemaForBulkOperation(orgId:number): Promise<{ response: object }> {
const payload = { orgId };
return this.sendNats(this.credDefServiceProxy, 'get-all-schema-cred-defs-for-bulk-operation', payload);
}
}
Loading
Loading