Skip to content

Commit

Permalink
fix: did service endpoint while creating DID (#715)
Browse files Browse the repository at this point in the history
* feat: added logic to store W3C schema

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

* fix: Error messages

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

* fix: did endpoint

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

---------

Signed-off-by: tipusinghaw <tipu.singh@ayanworks.com>
Signed-off-by: KulkarniShashank <shashank.kulkarni@ayanworks.com>
  • Loading branch information
tipusinghaw authored and KulkarniShashank committed Sep 11, 2024
1 parent a1bf1d1 commit be9005a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions apps/agent-service/src/agent-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@ export class AgentServiceService {
try {
const { isPrimaryDid } = createDidPayload;
const agentDetails = await this.agentServiceRepository.getOrgAgentDetails(orgId);

if (createDidPayload.method === DidMethod.POLYGON) {
createDidPayload.endpoint = agentDetails.agentEndPoint;
}
const getApiKey = await this.getOrgAgentApiKey(orgId);
const getOrgAgentType = await this.agentServiceRepository.getOrgAgentType(agentDetails?.orgAgentTypeId);
let url;
Expand All @@ -940,7 +942,7 @@ export class AgentServiceService {
} else if (getOrgAgentType.agent === OrgAgentType.SHARED) {
url = `${agentDetails.agentEndPoint}${CommonConstants.URL_SHAGENT_CREATE_DID}${agentDetails.tenantId}`;
}

delete createDidPayload.isPrimaryDid;

const didDetails = await this.commonService.httpPost(url, createDidPayload, {
Expand Down
3 changes: 0 additions & 3 deletions libs/common/src/did.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export function validateDid(createDid: IDidCreate): void {
case DidMethod.POLYGON === createDid.method && createDid.privatekey && 64 !== createDid.privatekey.length:
errors.push('Private key must be exactly 64 characters long');
break;
case DidMethod.POLYGON === createDid.method && !createDid.endpoint:
errors.push('endpoint is required for polygon method');
break;
case (DidMethod.INDY === createDid.method || DidMethod.KEY === createDid.method || DidMethod.WEB === createDid.method) && (!createDid.seed):
errors.push('seed is required');
break;
Expand Down

0 comments on commit be9005a

Please sign in to comment.