Skip to content

Commit

Permalink
merge: DEV to QA (#951)
Browse files Browse the repository at this point in the history
* refactor: applied validations on issuance date  (#934)

* fix: fetch schema details

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: applied validations for issuance using connection

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: encrypt clientId and client secret

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>

* fix:collect reuse connection events

Signed-off-by: pallavicoder <pallavi.ghule@ayanworks.com>

* feat: reuse connection usinginvitation DID (#940)

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: unable to use platform archieved schema

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: solved the clientId dcryption in verification email

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>

* feat: basic message (#848)

* WIP : Implementation of basic message protocol wrapper

Signed-off-by: Ankita Patidar <ankita.patidar@ayanworks.com>

* feat: basic message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* changed response message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: sonar lint

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: seperated URL creation logic

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: changed error message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

---------

Signed-off-by: Ankita Patidar <ankita.patidar@ayanworks.com>
Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
Co-authored-by: Ankita Patidar <ankita.patidar@ayanworks.com>

* refactor: fetch proof details function (#943)

* fix: fetch schema details

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: applied validations for issuance using connection

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: multiple schemas in verified proof details api

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: description

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: basic message url (#944)

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: add no_ledger type in seed file

Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>

* feat: migration logic for `org_dids` and schema type (#946)

* feat:migration script for did list

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat:schema support for W3C

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

---------

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: migration did for organization DIDs (#948)

* feat:migration script for did list

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat:schema support for W3C

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: validation for null and empty string for did migration

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

---------

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: changed message pattern for basic-message (#950)

* feat:migration script for did list

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat:schema support for W3C

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: validation for null and empty string for did migration

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* fix: changed message pattern for basic message

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

---------

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>

* feat: reuse connection for issuance (#949)

* feat: reuse connection for issuance

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: property name

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: argument name

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: dto name

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: added certificate template

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
Signed-off-by: pallavicoder <pallavi.ghule@ayanworks.com>
Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Ankita Patidar <ankita.patidar@ayanworks.com>
Co-authored-by: Ganesh Nawle <ganesh.nawle@ayanworks.com>
Co-authored-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
Co-authored-by: pallavicoder <pallavi.ghule@ayanworks.com>
Co-authored-by: Shashank Kulkarni <44693969+KulkarniShashank@users.noreply.github.com>
Co-authored-by: pallavighule <61926403+pallavighule@users.noreply.github.com>
Co-authored-by: tipusinghaw <126460794+tipusinghaw@users.noreply.github.com>
Co-authored-by: Krishna Waske <krishna.waske@ayanworks.com>
Co-authored-by: Krishna <74084119+GHkrishna@users.noreply.github.com>
Co-authored-by: Ankita Patidar <ankita.patidar@ayanworks.com>
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
  • Loading branch information
10 people committed Sep 11, 2024
1 parent 2cd1afa commit e2c8d39
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/api-gateway/src/connection/connection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class ConnectionService extends BaseService {
basicMessageDto: BasicMessageDto
): Promise<object> {
try {
return this.sendNatsMessage(this.connectionServiceProxy, 'send-basic-message', basicMessageDto);
return this.sendNatsMessage(this.connectionServiceProxy, 'send-basic-message-on-connection', basicMessageDto);
} catch (error) {
throw new RpcException(error.response);
}
Expand Down
1 change: 1 addition & 0 deletions apps/issuance/interfaces/issuance.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export interface IQueuePayload{
certificate?: string;
size?: string;
orientation?: string;
isReuseConnection?: boolean;
}

interface FileDetails {
Expand Down
5 changes: 3 additions & 2 deletions apps/issuance/src/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1566,8 +1566,8 @@ return newCacheKey;
schemaLedgerId,
credentialData: jobDetails.credential_data,
orgDid,
orgId

orgId,
isReuseConnection: true
};

prettyVc = {
Expand All @@ -1578,6 +1578,7 @@ return newCacheKey;

oobIssuancepayload = await createOobJsonldIssuancePayload(JsonldCredentialDetails, prettyVc);
}

const oobCredentials = await this.outOfBandCredentialOffer(
oobIssuancepayload, jobDetails?.platformName, jobDetails?.organizationLogoUrl, prettyVc);
if (oobCredentials) {
Expand Down
2 changes: 1 addition & 1 deletion libs/common/src/cast.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const validateEmail = (email: string): boolean => {

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
export const createOobJsonldIssuancePayload = (JsonldCredentialDetails: IJsonldCredential, prettyVc: IPrettyVc) => {
const {credentialData, orgDid, orgId, schemaLedgerId, schemaName} = JsonldCredentialDetails;
const {credentialData, orgDid, orgId, schemaLedgerId, schemaName, isReuseConnection} = JsonldCredentialDetails;
const credentialSubject = { };

for (const key in credentialData) {
Expand Down
75 changes: 75 additions & 0 deletions libs/prisma-service/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,81 @@ const createUserRole = async (): Promise<void> => {
}
};

const migrateOrgAgentDids = async (): Promise<void> => {
try {
const orgAgents = await prisma.org_agents.findMany({
where: {
walletName: {
not: 'platform-admin'
}
}
});

const orgDids = orgAgents.map((agent) => agent.orgDid).filter((did) => null !== did && '' !== did);
const existingDids = await prisma.org_dids.findMany({
where: {
did: {
in: orgDids
}
}
});

// If there are org DIDs that do not exist in org_dids table
if (orgDids.length !== existingDids.length) {
const newOrgAgents = orgAgents.filter(
(agent) => !existingDids.some((did) => did.did === agent.orgDid)
);

const newDidRecords = newOrgAgents.map((agent) => ({
orgId: agent.orgId,
did: agent.orgDid,
didDocument: agent.didDocument,
isPrimaryDid: true,
createdBy: agent.createdBy,
lastChangedBy: agent.lastChangedBy,
orgAgentId: agent.id
}));

const didInsertResult = await prisma.org_dids.createMany({
data: newDidRecords
});

logger.log(didInsertResult);
} else {
logger.log('No new DIDs to migrate in migrateOrgAgentDids');
}
} catch (error) {
logger.error('An error occurred during migrateOrgAgentDids:', error);
}
};

const addSchemaType = async (): Promise<void> => {
try {
const emptyTypeSchemaList = await prisma.schema.findMany({
where: {
OR: [
{ type: null },
{ type: '' }
]
}
});
if (0 < emptyTypeSchemaList.length) {
const updatePromises = emptyTypeSchemaList.map((schema) => prisma.schema.update({
where: { id: schema.id },
data: { type: 'indy' }
})
);
await Promise.all(updatePromises);

logger.log('Schemas updated successfully');
} else {
logger.log('No schemas to update');
}
} catch (error) {
logger.error('An error occurred during addSchemaType:', error);
}
};

async function main(): Promise<void> {

await createPlatformConfig();
Expand Down

0 comments on commit e2c8d39

Please sign in to comment.