Skip to content

Commit

Permalink
Hotfix 2.14.1 code into main (#2373)
Browse files Browse the repository at this point in the history
* Display validation error when entered passwords do not match

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

* Add whitespace validation for create account and login forms

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

* Add show/hide functionality for Create account/Login forms

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

* Remove error from server from UI, fix error message for the existing username

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

* Fix confirm password validation, restore data flow

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

* Remove console logs

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

* Fix control name

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

* Add filtering for standard registries and policies lists

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

* Add text for the case when there is no standard registries

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

* Fix issues, refactor code

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

* Fix issue when the user is unable to distinguish the schema policy based on version

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

* Disable action buttons when the form is invalid

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

* Mark required fields in forms

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

* Add disableClose attribute to modal dialogs, cross icon to some of them

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

* Update the UX of Registrant Application form

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

* update

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

* swagger

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

* fix PORT in use issue
fix build ussues
remove unnesessary credentials

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

* fix port generation
remove unnesessary credentials

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

* fix mongodb issue
remove unnesessary credentials

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

* update

* add swagger package
remove unnesessary credentials

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

* add swagger package
remove unnesessary credentials

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

* GITBOOK-362: Updated Installation guide

* update

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

* update

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

* added policy syntax highlighting

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

* added policy suggestion mechanism

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

* fix

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

* added policy syntax groups constant

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

* improving perfomance of suggestion algorithm

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

* added legend for suggestion configuration

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

* missing mint block tip

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

* added swagger docs

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

* changed suggestion algorithm and response

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

* added syntax highlighting to json block config

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

* changed suggestion to suggestions

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

* fix response codes

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

* change type to blockType

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

* fix comments

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

* added missing message memo

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

* update

* fix

* fix

* fix

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

* added auto-generated swagger docs

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

* fix

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

* fix

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

* update

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

* remove api-docs
remove unnesessary credentials

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

* fix

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

* Fix issues found during QA testing

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

* fix module editing in json

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

* fix

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

* fix perfomance on select block issue

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

* fix text

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

* fix text

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

* Create readMe.md

* Update readMe.md

* Update readMe.md

* Add files via upload

* Rename Methodology Library/CDM/readme.md to Methodology Library/CDM/CDM AR-ACM0003/readme.md

* Add files via upload

* Delete CDM.policy

* Add files via upload

* policy.ts
remove unnesessary credentials

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

* fix 2280
remove unnesessary credentials

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

* fix 2242
remove unnesessary credentials

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

* feat: preview and adjustments

* Fix issue with action button disabling in token dialog

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

* Change filtering by username to geography

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

* Change the style of Generate button for SR, Registrant users

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

* GITBOOK-364: Separated sections from Installation guide

* Add hover state for the generate button

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

* enable config view of published modules
remove unnesessary credentials

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

* fix module "save as"
remove unnesessary credentials

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

* merge develop
remove unnesessary credentials

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

* fix bugs
remove unnesessary credentials

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

* fix get accounts
remove unnesessary credentials

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

* fix status codes
remove unnesessary credentials

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

* added ghgp policy [skip ci]

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

* Updates main ICP policy to v.2.6.1.

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

* fix accounts
remove unnesessary credentials

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

* GITBOOK-366: Separating Installation methods

* fix status codes
remove unnesessary credentials

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

* fix permissions
remove unnesessary credentials

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

* GITBOOK-369: Corrected manuaaly process

* GITBOOK-371: Added Auto Suggestion docs

* GITBOOK-372: Added syntax section in themes

* docs generation test
remove unnesessary credentials

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

* docs generation test
remove unnesessary credentials

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

* fix filter in report blocks

* added NEW status for vc-document

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

* fix filter in report blocks

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

* fix invalid status codes
remove unnesessary credentials

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

* Solve #1695
AWS Env secret
HCP Env secret
AZURE Env secret
Documentation
solve conflicts
api-docs

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

* six send VP

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

* fix lint
remove unnesessary credentials

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

* update cdm policy [skip ci]

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

* added cdm ams policy [skip ci]

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

* GITBOOK-373: added messagesReportBlock

* fix status codes
remove unnesessary credentials

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

* fix modules
remove unnesessary credentials

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

* fix profiles
remove unnesessary credentials

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

* fix module states

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

* fix validation

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

* up hedera sdk version
add network name in logs

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

* fix style

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

* fix swagger.yaml generation

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

* fix swagger.yaml generation

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

* fix swagger.yaml generation

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

* Add swagger.yaml

* fix swagger.yaml generation

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

* fix swagger.yaml generation

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

* test fix swagger.yaml generation

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

* test fix swagger.yaml generation

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

* test fix swagger.yaml generation

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

* test fix swagger.yaml generation

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

* test fix swagger.yaml generation

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

* Add swagger.yaml

* test fix swagger.yaml generation

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

* [skip ci] Add swagger.yaml

* save serials

* ignore main brunch

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

* GITBOOK-374: Ux in selecting standards update

* fix error codes

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

* [skip ci] Add swagger.yaml

* add missing keywords for policy syntax

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

* refactor syntax groups theme storage

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

* update

* fix preset readonly nested schemas

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

* update

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

* auto fill suggestions config

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

* fix error codes

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

* fix

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

* fix permissions

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

* update

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

* fix errors

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

* fix errors

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

* fix error

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

* fix errors

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

* fix error

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

* fix error

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

* fix error

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

* compare modules

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

* [skip ci] Add swagger.yaml

* disable vault in api-tests

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

* update policies

* compare module

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

* update compare ui

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

* fix search btn

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

* fixes

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

* fix lint

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

* [skip ci] Add swagger.yaml

* fix permission

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

* fix permission

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

* fix

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

* #2064 fix mobile menu

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

* merge main

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

* fix

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

* remove latest tags

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

* update serials column [skip ci]

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

* updated Irec timestamps

* fix docker start

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

* updated iREC10 recipient timestamp

* GITBOOK-376: Updated iREC timestamps

* added copy button to new versions

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

* fix createDate\updateDate in db

* fix navigate

* fix disable btn in request block

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

* fix schema cache

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

* hotfix/form-scroll-buttons

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

* Update the initial isShown array value

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

* add swagger descriptions

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

* [skip ci] Add swagger.yaml

* fix suggestions on deleting policy/module

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

* use static swagger descriptions if need

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

* [skip ci] Add swagger.yaml

* bump version

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

* bump version

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

* [skip ci] Add swagger.yaml

* fix lock file

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

* GITBOOK-377: api-architecture-customization

* fix update policy

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

* fix any policy change

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

* fix any policy change

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

* bump version

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

* [skip ci] Add swagger.yaml

---------

Signed-off-by: Iryna Telesheva <[email protected]>
Signed-off-by: Stepan Kiryakov <[email protected]>
Signed-off-by: simvalery <[email protected]>
Signed-off-by: artembuslaev <[email protected]>
Signed-off-by: Artem Buslaev <[email protected]>
Signed-off-by: AlexIvanHoward <[email protected]>
Signed-off-by: otherNet <[email protected]>
Co-authored-by: Iryna Telesheva <[email protected]>
Co-authored-by: Artem Buslaev <[email protected]>
Co-authored-by: Stepan Kiryakov <[email protected]>
Co-authored-by: prernaa.agarwal <[email protected]>
Co-authored-by: Felipe Neuhauss <[email protected]>
Co-authored-by: AlexIvanHoward <[email protected]>
Co-authored-by: otherNet <[email protected]>
Co-authored-by: envision-ci-agent <[email protected]>
Co-authored-by: Vanessa Lopes <[email protected]>
Co-authored-by: E. Santiago <[email protected]>
Co-authored-by: Serg Metelin <[email protected]>
  • Loading branch information
12 people authored Jul 3, 2023
1 parent cd288d6 commit 9c87706
Show file tree
Hide file tree
Showing 18 changed files with 125 additions and 106 deletions.
6 changes: 3 additions & 3 deletions api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.0",
"@guardian/interfaces": "^2.14.0",
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@nestjs/common": "^9.4.1",
"@nestjs/core": "^9.4.1",
"@nestjs/jwt": "^10.0.3",
Expand Down Expand Up @@ -66,5 +66,5 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.14.0"
"version": "2.14.1"
}
66 changes: 37 additions & 29 deletions api-gateway/src/api/service/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class PolicyApi {
pageSize
});
}
const {policies, count} = result;
const { policies, count } = result;
return res.setHeader('X-Total-Count', count).json(policies);
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
Expand Down Expand Up @@ -157,17 +157,17 @@ export class PolicyApi {
async createPolicyAsync(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Create policy');
const { taskId, expectation } = taskManager.start('Create policy');
const model = req.body;
const user = req.user;
RunFunctionAsync<ServiceError>(async () => {
const engineService = new PolicyEngine();
await engineService.createPolicyAsync(model, user, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: error.message});
taskManager.addError(taskId, { code: 500, message: error.message });
});
return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({})
Expand All @@ -190,7 +190,7 @@ export class PolicyApi {
async updatePolicyAsync(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Clone policy');
const { taskId, expectation } = taskManager.start('Clone policy');
const policyId = req.params.policyId;
const model = req.body;
const user = req.user;
Expand Down Expand Up @@ -220,9 +220,9 @@ export class PolicyApi {
await engineService.deletePolicyAsync(policyId, user, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: error.message});
taskManager.addError(taskId, { code: 500, message: error.message });
});
return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({
Expand Down Expand Up @@ -285,10 +285,18 @@ export class PolicyApi {
async updatePolicy(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const engineService = new PolicyEngine();
let model: any;
try {
model = await engineService.getPolicy({filters: req.params.policyId}) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
}
if (!model) {
throw new HttpException('Policy does not exist.', HttpStatus.NOT_FOUND)
}
try {
const model = await engineService.getPolicy({filters: req.params.policyId}) as any;
const policy = req.body;

model.config = policy.config;
model.name = policy.name;
model.version = policy.version;
Expand Down Expand Up @@ -360,7 +368,7 @@ export class PolicyApi {
async publishPolicyAsync(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Publish policy');
const { taskId, expectation } = taskManager.start('Publish policy');

const model = req.body;
const user = req.user;
Expand All @@ -370,10 +378,10 @@ export class PolicyApi {
await engineService.publishPolicyAsync(model, user, policyId, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: error.message || error});
taskManager.addError(taskId, { code: 500, message: error.message || error });
});

return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({
Expand Down Expand Up @@ -757,7 +765,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
try {
const policyFile: any = await engineService.exportFile(req.user, req.params.policyId);
const policy: any = await engineService.getPolicy({filters: req.params.policyId});
const policy: any = await engineService.getPolicy({ filters: req.params.policyId });
res.setHeader('Content-disposition', `attachment; filename=${policy.name}`);
res.setHeader('Content-type', 'application/zip');
return res.send(policyFile);
Expand Down Expand Up @@ -854,7 +862,7 @@ export class PolicyApi {
async importPolicyFromMessageAsync(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Import policy message');
const { taskId, expectation } = taskManager.start('Import policy message');

const user = req.user;
const messageId = req.body.messageId;
Expand All @@ -864,9 +872,9 @@ export class PolicyApi {
await engineService.importMessageAsync(user, messageId, versionOfTopicId, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: 'Unknown error: ' + error.message});
taskManager.addError(taskId, { code: 500, message: 'Unknown error: ' + error.message });
});
return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({
Expand Down Expand Up @@ -925,7 +933,7 @@ export class PolicyApi {
async importPolicyFromFileAsync(@Req() req, @Response() res): Promise<any> {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Import policy file');
const { taskId, expectation } = taskManager.start('Import policy file');

const user = req.user;
const zip = req.body;
Expand All @@ -935,9 +943,9 @@ export class PolicyApi {
await engineService.importFileAsync(user, zip, versionOfTopicId, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: 'Unknown error: ' + error.message});
taskManager.addError(taskId, { code: 500, message: 'Unknown error: ' + error.message });
});
return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({
Expand Down Expand Up @@ -994,7 +1002,7 @@ export class PolicyApi {
async importFromMessagePreview(@Req() req, @Response() res) {
await checkPermission(UserRole.STANDARD_REGISTRY)(req.user);
const taskManager = new TaskManager();
const {taskId, expectation} = taskManager.start('Preview policy message');
const { taskId, expectation } = taskManager.start('Preview policy message');

const user = req.user;
const messageId = req.body.messageId;
Expand All @@ -1003,10 +1011,10 @@ export class PolicyApi {
await engineService.importMessagePreviewAsync(user, messageId, taskId);
}, async (error) => {
new Logger().error(error, ['API_GATEWAY']);
taskManager.addError(taskId, {code: 500, message: 'Unknown error: ' + error.message});
taskManager.addError(taskId, { code: 500, message: 'Unknown error: ' + error.message });
});

return res.status(202).send({taskId, expectation});
return res.status(202).send({ taskId, expectation });
}

@ApiOperation({
Expand Down Expand Up @@ -1060,7 +1068,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand All @@ -1086,7 +1094,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand All @@ -1112,7 +1120,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand All @@ -1138,7 +1146,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand All @@ -1164,7 +1172,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down Expand Up @@ -1197,7 +1205,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down Expand Up @@ -1231,7 +1239,7 @@ export class PolicyApi {
const engineService = new PolicyEngine();
let policy;
try {
policy = await engineService.getPolicy({filters: req.params.policyId}) as any;
policy = await engineService.getPolicy({ filters: req.params.policyId }) as any;
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
throw new HttpException(error.message, HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down
24 changes: 12 additions & 12 deletions api-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "api-tests",
"version": "2.14.0",
"description": "API Tests",
"main": "index.js",
"scripts": {
"test": "mocha index.js",
"test:ci": "mocha index.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/api-tests.xml"
},
"author": "Envision Blockchain Solutions <[email protected]>",
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.5",
"name": "api-tests",
"version": "2.14.1",
"description": "API Tests",
"main": "index.js",
"scripts": {
"test": "mocha index.js",
"test:ci": "mocha index.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/api-tests.xml"
},
"author": "Envision Blockchain Solutions <[email protected]>",
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.5",
"mocha": "^9.2.0",
"mocha-junit-reporter": "^2.0.2",
"tree-kill": "^1.2.2"
Expand Down
6 changes: 3 additions & 3 deletions auth-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.0",
"@guardian/interfaces": "^2.14.0",
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@mikro-orm/core": "~5.7.12",
"@mikro-orm/mongodb": "~5.7.12",
"@nestjs/common": "^9.4.1",
Expand Down Expand Up @@ -53,5 +53,5 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.14.0"
"version": "2.14.1"
}
4 changes: 2 additions & 2 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@aws-sdk/client-secrets-manager": "^3.319.0",
"@azure/identity": "^3.2.2",
"@azure/keyvault-secrets": "^4.7.0",
"@guardian/interfaces": "^2.14.0",
"@guardian/interfaces": "^2.14.1",
"@hashgraph/sdk": "2.24.2",
"@mattrglobal/jsonld-signatures-bbs": "^1.1.2",
"@meeco/cryppo": "^2.0.2",
Expand Down Expand Up @@ -65,5 +65,5 @@
"test:local": "mocha tests/**/*.test.js --exit",
"test:stability": "mocha tests/stability.test.js"
},
"version": "2.14.0"
"version": "2.14.1"
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@
"test": "ng test",
"watch": "ng build --watch --configuration development --output-path ../www-data"
},
"version": "2.14.0"
"version": "2.14.1"
}
6 changes: 3 additions & 3 deletions guardian-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.0",
"@guardian/interfaces": "^2.14.0",
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@hashgraph/sdk": "2.24.2",
"@mattrglobal/jsonld-signatures-bbs": "^1.1.2",
"@meeco/cryppo": "^2.0.2",
Expand Down Expand Up @@ -85,5 +85,5 @@
"test:local": "mocha tests/**/*.test.js --exit",
"test:stability": "mocha tests/stability.test.js"
},
"version": "2.14.0"
"version": "2.14.1"
}
13 changes: 12 additions & 1 deletion guardian-service/src/policy-engine/policy-engine.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,18 @@ export class PolicyEngineService {

this.channel.getMessages<any, any>(PolicyEngineEvents.SAVE_POLICIES, async (msg) => {
try {
const result = await DatabaseServer.updatePolicyConfig(msg.policyId, msg.model);
const { policyId, model, user } = msg;
const policy = await DatabaseServer.getPolicyById(policyId);
if (!policy) {
throw new Error('Policy does not exist.');
}
if (policy.owner !== user.did) {
throw new Error('Insufficient permissions to update the policy.');
}
if (policy.status !== PolicyType.DRAFT) {
throw new Error('Policy is not in draft status.');
}
const result = await DatabaseServer.updatePolicyConfig(policyId, model);
return new MessageResponse(result);
} catch (error) {
new Logger().error(error, ['GUARDIAN_SERVICE']);
Expand Down
2 changes: 1 addition & 1 deletion interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"prepack": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "2.14.0"
"version": "2.14.1"
}
6 changes: 3 additions & 3 deletions logger-service/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.0",
"@guardian/interfaces": "^2.14.0",
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@mikro-orm/core": "~5.7.12",
"@mikro-orm/mongodb": "~5.7.12",
"@nestjs/common": "^9.4.1",
Expand Down Expand Up @@ -40,5 +40,5 @@
"start": "node dist/index.js",
"watch": "nodemon src/index.ts"
},
"version": "2.14.0"
"version": "2.14.1"
}
Loading

0 comments on commit 9c87706

Please sign in to comment.