Skip to content

Commit

Permalink
2.5.0-prerelease changes from Develop into Main (#1342)
Browse files Browse the repository at this point in the history
* Rename Demo Artifacts/Verra Redd/readme.md to Demo Artifacts/Verra/Verra Redd/VM0007/readme.md

* Create Description

* Add files via upload

* Add files via upload

* Delete Demo Artifacts/Verra Redd directory

* Update readme.md

* Delete Description

* Update readme.md

* Update readme.md

* Delete Description

* Delete Description

* Update readme.md

* GitBook: [#165] Demo to Create API Key

* Update readme.md (#1229)

* GitBook: [#166] Creating Operator ID and Operator Key

* GitBook: [#167] corrected available Blocks

* fix async events

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

* fix memo

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

* ci tests

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

* test

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

* Update package-lock.json

* Update package-lock.json

* fix delete user

* tests environment

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

* fix local tests

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

* added validation for key schema field

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

* fix topic message memo

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

* fixes

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

* fix

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

* added memo for user topic creation message

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

* Create readme.md

* ws events send every 100ms

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

* Update readme.md

* fix user id

* fix

* Update readme.md

* fix

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

* fix

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

* fix

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

* fix

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

* update message status

* fix memo

* change payer

* fix

* fix

* Updated Readme to include authors + definitions (#1238)

Added Envision as an Author. Added a definition for Policy/Schema, please adjust if there is a more correct definition @anvabr. There has a been a request for a glossary so maybe we could link there.

Co-authored-by: anvabr <[email protected]>

* GitBook: [#168] Updated APIs to be cancelled

* GitBook: [#169] Added Memo field changes

* fix schemas in verra redd policies

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

* GitBook: [#170] Corrected Memo field changes.

* Updated Verra Timestamps

* Updated timestamps of Verra

* tests fixes

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

* fix result

* fix invite

* fix

* GitBook: [#171] Removed Keys from API flow

* update swagger

* remove deprecated endpoints

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

* fix

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

* updated postman collection

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

* fix README.md

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

* up version

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

* fix timeout error

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

* GitBook: [#172] Added User Group APIs

* fix vp documents

* fix merge

* fix publish schemas

* Additional fixes and docs for the 2.4.0 release (#1262) (#1264)

* Added iREC files in folder

* Delete iREC Schema.schema

* Delete iRec Policy 2.policy

* Delete iRec Policy.policy

* rename nft api key setting

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

* Add files via upload

* Delete Inverter.schema

* Delete MRV.schema

* Fixed links, highlighting and linting;
Fixes some statements in the text;
'Refactoring of the paragraphs';
Using live link (not permalink) when referring to generic external documentation that can be updated;
Use 'Guardian' instead of 'The Guardian' (it should be done through all the docs);

Signed-off-by: Giuseppe Bertone <[email protected]>

* GitBook: [#145] Fixed minor changes as per ReadMe

* GitBook: [#146] Added IPFS_STORAGE_API_KEY

* update swagger

* fix error messages

* update import messages

* fix

* fix

* fix

* fix

* prevent change status on creation step

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

* fixed policy's pagination

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

* fix change policy status

* check policy status

* fix run multiple tests

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

* fix lint

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

* fix tests

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

* fix tests

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

* fix tests

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

* fix tests

* fix run multiple tests

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

* fix lint

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

* fix tests

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

* fix tests

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

* fix tests

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

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

* added find single schema endpoint

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

* enable closing of 'save as' dialog

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

* added single schema api

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

* policy delete option, fix import schemas

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

* change delete policy result

* allow users to get schema of own RA

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

* fix disabled delete icon, less delete schema info

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

* GitBook: [#147] Dry Run Demo added

* change delete policy functionality

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

* change initial balance settings

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

* add group

* update swagger

* add ivite

* GitBook: [#148] Added Dry Run, Added missing APIs, Added Note for .policy, .schema

* GitBook: [#149] Corrected External events docs, Roadmap content added

* async mq events

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

* fix lint

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

* add group manager block

* fix publish

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

* fix publish

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

* GitBook: [#150] Updated Roadmap, Added Dry Run APIs

* GitBook: [#151] Made corrections in roadmap

* GitBook: [#152] Dry Run APIs added

* prevent to delete schema and policy not in draft

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

* added close button to 'save as' dialog

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

* templates in mrv sender

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

* update css template dialog

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

* GitBook: [#153] Adding Schema API

* group

* fixed issue with defs

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

* publishing related schemas

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

* fixed with policy publishing

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

* GitBook: [#154] Added missing APIs

* workers

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

* workers

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

* fixed save as policy action

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

* update irec policies

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

* fix 1195

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

* fix 1195

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

* fix blank

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

* fix heartbeat

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

* GitBook: [#155] Updated iREC demo from iREC 3 to iREC 4

* Fixed IPFS pinning service key name in .env.example

* fixed permissions combined with owner

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

* task queue

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

* update documents

* update group mapping

* fixed schemas defs and comment fields

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

* fixed schemas in irec3,4

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

* Readme of Verra Redd (#1210)

* ReadMe file of iREC (#1209)

* topics memo

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

* messages memo

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

* fixed policy catch errors

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

* Removed Keys from ReadMe file

* supports arrays path in memo

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

* workers

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

* fix lint

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

* Corrected Timestamps in Verra ReadMe

* fix lint, fix docker build

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

* fix docker build

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

* fix docker build

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

* Updated IREC ReadMe

* add issuer ref

* set memo for global topic

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

* Demo Artifacts ReadMe changes

* Delete iREC Description

* Delete Verra Description

* fix docker build

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

* Changes made to Demo Artifacts ReadMe

* Changes made in IREC ReadMe

* Updated Verra ReadMe

* fix merge

* fix single worker

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

* error handling and get items interval

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

* message request timeout

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

* delete group

* fix

* fix

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

* fix group

* fix group

* fix issuer

* fix external data

* fix policy info

* Create Description

* Add files via upload

* Delete IRec Policy 3.policy

* Delete IRec Policy 4.policy

* Delete iRec Policy 2.policy

* Delete iRec Policy.policy

* Create Description

* Add files via upload

* Delete Description

* Delete Inverter.schema

* Delete MRV.schema

* Delete iREC Schema.schema

* Create Description

* Add files via upload

* Delete Verra REDD Policy 2.policy

* Delete Verra REDD.policy

* Create Description

* Rename Demo Artifacts/Verra Redd/readme.md to Demo Artifacts/Verra/Verra Redd/VM0007/readme.md

* Create Description

* Add files via upload

* Add files via upload

* Delete Demo Artifacts/Verra Redd directory

* Update readme.md

* Delete Description

* Update readme.md

* Update readme.md

* Delete Description

* Delete Description

* Update readme.md

* GitBook: [#165] Demo to Create API Key

* Update readme.md (#1229)

* GitBook: [#166] Creating Operator ID and Operator Key

* GitBook: [#167] corrected available Blocks

* fix async events

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

* fix memo

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

* ci tests

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

* test

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

* Update package-lock.json

* Update package-lock.json

* fix delete user

* tests environment

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

* fix local tests

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

* added validation for key schema field

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

* fix topic message memo

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

* fixes

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

* fix

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

* added memo for user topic creation message

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

* Create readme.md

* ws events send every 100ms

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

* Update readme.md

* fix user id

* fix

* Update readme.md

* fix

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

* fix

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

* fix

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

* fix

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

* update message status

* fix memo

* change payer

* fix

* fix

* Updated Readme to include authors + definitions (#1238)

Added Envision as an Author. Added a definition for Policy/Schema, please adjust if there is a more correct definition @anvabr. There has a been a request for a glossary so maybe we could link there.

Co-authored-by: anvabr <[email protected]>

* GitBook: [#168] Updated APIs to be cancelled

* GitBook: [#169] Added Memo field changes

* fix schemas in verra redd policies

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

* GitBook: [#170] Corrected Memo field changes.

* Updated Verra Timestamps

* Updated timestamps of Verra

* tests fixes

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

* fix result

* fix invite

* fix

* GitBook: [#171] Removed Keys from API flow

* update swagger

* remove deprecated endpoints

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

* fix

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

* updated postman collection

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

* fix README.md

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

* up version

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

* fix timeout error

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

* GitBook: [#172] Added User Group APIs

* fix vp documents

* fix merge

Signed-off-by: artembuslaev <[email protected]>
Signed-off-by: Giuseppe Bertone <[email protected]>
Signed-off-by: simvalery <[email protected]>
Co-authored-by: prernaadev01 <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
Co-authored-by: prernaa.agarwal <[email protected]>
Co-authored-by: Stepan Kiryakov <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
Co-authored-by: Stepan Kirjakov <[email protected]>
Co-authored-by: danielnorkin <[email protected]>
Co-authored-by: ANDRI H.U <[email protected]>
Co-authored-by: dubgeis <[email protected]>
Co-authored-by: anvabr <[email protected]>

Signed-off-by: artembuslaev <[email protected]>
Signed-off-by: Giuseppe Bertone <[email protected]>
Signed-off-by: simvalery <[email protected]>
Co-authored-by: prernaadev01 <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
Co-authored-by: prernaa.agarwal <[email protected]>
Co-authored-by: Stepan Kiryakov <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
Co-authored-by: Stepan Kirjakov <[email protected]>
Co-authored-by: danielnorkin <[email protected]>
Co-authored-by: ANDRI H.U <[email protected]>
Co-authored-by: dubgeis <[email protected]>
Co-authored-by: anvabr <[email protected]>

* GitBook: [#173] Added User Groups and Roles Page

* GitBook: [#174] Added groupManagerBlock

* up version

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

* added default setting filters block

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

* added applying permission to children blocks

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

* add filter tokens

* added re-ordering fields functionality

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

* fix circular dependency

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

* add message

* fix

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

* fixed positions conditions in schema view

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

* update memo
refactoring

* fixed undo action after permissions changed

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

* changed composit fields

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

* fix

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

* add MultiSigBlock

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

* fix

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

* fix pagination

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

* fix lint

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

* fix user profile

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

* fixed long time render block properties

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

* fixed hide all events action

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

* update irec policies

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

* fixed sort in source addon block

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

* fix pagination bug

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

* pagination optimizations

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

* add multi sig block

* fix

* GitBook: [#175] Updated Libraries

* update multi sign block

* Updated the timestamps of IREC versions

* GitBook: [#176] Updated timestamps of iREC Versions

* update

* pagination optimizations

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

* fix linting

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

* enum schema type

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

* fix styles, size of buttons

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

* fixed styles and loading

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

* fix

* fix creating standart registry

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

* added common sorting to source blocks

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

* remove users
angular permissions

* update style

* fix import from ipfs

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

* update

* fixed arrays paths in aggregations

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

* GitBook: [#177] Added Enum details

* fixed interfaceSourceBlock validation

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

* fix

* fix

* fix

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

* fix update did

* GitBook: [#178] Added enable sorting UI property in InterfaceDocumentSourceBlock

* fix

* update message-broker messages
fix document ref

* implement hashicorp wallet

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

* fix docker-compose.yml

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

* fix

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

* fix lint

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

* GitBook: [#179] Added multiSignBlock

* fix api tests

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

* test api tests

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

* test

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

* fix

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

* fix

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

* fix

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

* GitBook: [#180] Added worker-service change

* test

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

* Updated ReadMe

* test

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

* fix config

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

* fix api test

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

* remove console.logs

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

* add namespace to .env file

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

* implement hashicorp wallet

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

* fix docker-compose.yml

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

* fix lint

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

* fix api tests

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

* test api tests

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

* test

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

* fix

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

* fix

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

* fix

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

* test

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

* test

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

* fix config

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

* fix api test

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

* remove console.logs

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

* add namespace to .env file

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

* fix assigned

* add database-vault provider

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

* GitBook: [#181] Corrected multiSignBlock

* fix notifier

* fix worker retry

* fix lint

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

* fix lint

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

* add application global keys to storage

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

* keys migrations

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

* fix

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

* add demo policy

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

* fix test

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

* fix

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

* fix blank screen

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

* fix common ordering in aggregation of dryrun

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

* fix preset in schema form

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

* additional properties in blocks

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

* added remote work policy

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

* fix

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

* fix multi sig

* add pop event in aggregate

* fix

* move transactions to workers

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

* move transactions to workers

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

* fix tests

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

* added multiple items to trust chain

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

* fix

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

* fix transaction logger events

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

* refactor token events

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

* fix email validator

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

* fix tests

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

* up version

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

* Create readme.md

* change display multiple documents in trust chain item

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

* fix balance

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

Signed-off-by: simvalery <[email protected]>
Signed-off-by: artembuslaev <[email protected]>
Signed-off-by: Giuseppe Bertone <[email protected]>
Signed-off-by: Stepan Kiryakov <[email protected]>
Co-authored-by: prernaadev01 <[email protected]>
Co-authored-by: prernaa.agarwal <[email protected]>
Co-authored-by: danielnorkin <[email protected]>
Co-authored-by: ANDRI H.U <[email protected]>
Co-authored-by: Stepan Kiryakov <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: artembuslaev <[email protected]>
Co-authored-by: dubgeis <[email protected]>
Co-authored-by: anvabr <[email protected]>
Co-authored-by: Stepan Kirjakov <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
Co-authored-by: Giuseppe Bertone <[email protected]>
  • Loading branch information
13 people authored Sep 27, 2022
1 parent 6543454 commit 33992fb
Show file tree
Hide file tree
Showing 286 changed files with 7,362 additions and 3,782 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ on: [push]
jobs:
buildAndTest:
runs-on: ubuntu-latest
services:
hashicorpvault:
image: vault
env:
VAULT_SERVER: "http://0.0.0.0:8200"
VAULT_DEV_ROOT_TOKEN_ID: "1234"
ports:
- 8200/tcp
strategy:
matrix:
node-version: [16.x]
Expand Down Expand Up @@ -68,6 +76,8 @@ jobs:
OPERATOR_ID: ${{ secrets.OPERATOR_ID }}
OPERATOR_KEY: ${{ secrets.OPERATOR_KEY }}
IPFS_STORAGE_API_KEY: ${{ secrets.IPFS_STORAGE_API_KEY }}
HASHICORP_HOST: localhost
HASHICORP_PORT: ${{ job.services.hashicorpvault.ports[8200] }}
- name: Publish API Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ jobs:
pushd guardian-service
npm run lint
popd
pushd worker-service
npm run lint
popd
pushd ipfs-client
npm run lint
popd
pushd api-gateway
npm run lint
popd
Expand All @@ -79,6 +85,9 @@ jobs:
pushd guardian-service
npm run test
popd
pushd worker-service
npm run test
popd
env:
CI: true
OPERATOR_ID: ${{ secrets.OPERATOR_ID }}
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Demo Artifacts/Tolam Earth/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Demo Artifacts/iREC/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ As the initial step in IREC Policy involve creation of following Schemas: iRec r
| Inverter Schema | 1644847093.979895804 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Schema/Inverter.schema) |
| MRV Schema | 1644847107.415192828 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Schema/MRV.schema) |
| iREC 1 | 1661166202.802071003 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/iRec%20Policy.policy) |
| iREC 2 | 1661167347.064745885 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/iRec%20Policy%202.policy) |
| iREC 3 | 1661372984.332898003 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/IRec%20Policy%203.policy) |
| iREC 4 | 1661373147.975461003 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/IRec%20Policy%204.policy) |
| iREC 2 | 1662640724.951854568 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/iRec%20Policy%202.policy) |
| iREC 3 | 1662641840.731000003 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/IRec%20Policy%203.policy) |
| iREC 4 | 1662642008.325450377 | [Link](https://github.com/hashgraph/guardian/blob/main/Demo%20Artifacts/iREC/Policies/IRec%20Policy%204.policy) |

For complete User Guide and API Flow for executing IREC Policy, please refer to :

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,17 @@ If you build with docker [MongoDB](https://www.mongodb.com), [NodeJS](https://no
```plaintext
IPFS_STORAGE_API_KEY=""
```
in `worker-service/.env`:

```plaintext
IPFS_STORAGE_API_KEY=""
```
in `worker-service/.env.docker`:

```plaintext
IPFS_STORAGE_API_KEY=""
```

4. Build and launch with Docker. Please note that this build is meant to be used in production and will not contain any debug information. From the project's root folder:

```shell
Expand Down
2 changes: 1 addition & 1 deletion api-docs/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: "Guardian"
description: "The Guardian is a modular open-source solution that includes best-in-class identity management and decentralized ledger technology (DLT) libraries. At the heart of the Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a requirements-based tokenization implementation."
version: "2.4.2"
version: "2.5.0"
contact:
name: "API developer"
url: "https://envisionblockchain.com"
Expand Down
5 changes: 3 additions & 2 deletions api-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-docs",
"version": "2.4.2",
"version": "2.5.0-prerelease",
"description": "Swagger Documentation",
"main": "dist/index.js",
"scripts": {
Expand All @@ -23,5 +23,6 @@
"@types/swagger-ui-express": "^4.1.3",
"tslint": "^6.1.3",
"typescript": "^4.6.3"
}
},
"stableVersion": "2.4.2"
}
7 changes: 4 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.4.2",
"@guardian/interfaces": "^2.4.2",
"@guardian/common": "^2.5.0-prerelease",
"@guardian/interfaces": "^2.5.0-prerelease",
"dotenv": "^16.0.0",
"express": "^4.17.1",
"jszip": "^3.7.1",
Expand Down Expand Up @@ -49,5 +49,6 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.4.2"
"version": "2.5.0-prerelease",
"stableVersion": "2.4.2"
}
102 changes: 55 additions & 47 deletions api-gateway/src/api/service/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Guardians } from '@helpers/guardians';
import { permissionHelper } from '@auth/authorization-helper';
import { Response, Router } from 'express';
import { ITokenInfo, UserRole } from '@guardian/interfaces';
import { AuthenticatedRequest, IAuthUser, Logger } from '@guardian/common';
import { IToken, ITokenInfo, UserRole } from '@guardian/interfaces';
import { AuthenticatedRequest, Logger } from '@guardian/common';
import { PolicyEngine } from '@helpers/policy-engine';
import { findAllEntities } from '@helpers/utils';
import { TaskManager } from '@helpers/task-manager';
Expand All @@ -15,37 +15,70 @@ export const tokenAPI = Router();
/**
* Connect policies to tokens
* @param tokens
* @param user
* @param policies
* @param policyId
*/
async function setTokensPolicies(tokens: any[], user: IAuthUser) {
function setTokensPolicies<T>(tokens: any[], policies: any[], policyId?: any, notEmpty?: boolean): T[] {
if (!tokens) {
return;
return [];
}
const engineService = new PolicyEngine();

let result: any;
if (user.role === UserRole.STANDARD_REGISTRY) {
result = await engineService.getPolicies({ filters: { owner: user.did } });
} else {
result = await engineService.getPolicies({ filters: { status: 'PUBLISH' } });
for (const policyObject of policies) {
policyObject.tokenIds = findAllEntities(policyObject.config, 'tokenId');
}
const { policies } = result;

for (const token of tokens) {
const tokenPolicies = [];
token.policies = [];
token.policyIds = [];
for (const policyObject of policies) {
const tokenIds = findAllEntities(policyObject.config, 'tokenId');
if (tokenIds.includes(token.tokenId)) {
tokenPolicies.push(`${policyObject.name} (${policyObject.version || 'DRAFT'})`);
if (policyObject.tokenIds.includes(token.tokenId)) {
token.policies.push(`${policyObject.name} (${policyObject.version || 'DRAFT'})`);
token.policyIds.push(policyObject.id.toString());
}
}
token.policies = tokenPolicies;
}
if (policyId) {
tokens = tokens.filter(t => t.policyIds.includes(policyId));
}
if (notEmpty) {
tokens = tokens.filter(t => !!t.policyIds.length);
}
return tokens;

}

tokenAPI.get('/', permissionHelper(UserRole.STANDARD_REGISTRY, UserRole.USER), async (req: AuthenticatedRequest, res: Response) => {
try {
const guardians = new Guardians();
const engineService = new PolicyEngine();

const user = req.user;
const policyId = req.query?.policy;

let tokens: IToken[] = [];
if (user.role === UserRole.STANDARD_REGISTRY) {
tokens = await guardians.getTokens({ did: user.did });
const { policies } = await engineService.getPolicies({ filters: { owner: user.did } });
tokens = setTokensPolicies(tokens, policies, policyId, false);
} else if (user.did) {
tokens = await guardians.getAssociatedTokens(user.did);
const { policies } = await engineService.getPolicies({
filters: {
status: 'PUBLISH',
owner: user.parent
}
});
tokens = setTokensPolicies(tokens, policies, policyId, true);
}
res.status(200).json(tokens);
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
res.status(500).send({ code: error.code || 500, message: error.message });
}
});

tokenAPI.post('/', permissionHelper(UserRole.STANDARD_REGISTRY), async (req: AuthenticatedRequest, res: Response) => {
try {
const guardians = new Guardians();
const engineService = new PolicyEngine();
const user = req.user;

if (!user.did) {
Expand All @@ -58,13 +91,10 @@ tokenAPI.post('/', permissionHelper(UserRole.STANDARD_REGISTRY), async (req: Aut
owner: user.did
}));

tokens = await guardians.getTokens({
did: user.did
});
tokens = await guardians.getTokens({ did: user.did });
const { policies } = await engineService.getPolicies({ filters: { owner: user.did } });
tokens = setTokensPolicies(tokens, policies);

tokens = tokens || [];

await setTokensPolicies(tokens, user);
res.status(201).json(tokens);
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
Expand Down Expand Up @@ -95,28 +125,6 @@ tokenAPI.post('/push/', permissionHelper(UserRole.STANDARD_REGISTRY), async (req
res.status(201).send({ taskId, expectation });
});

tokenAPI.get('/', permissionHelper(UserRole.STANDARD_REGISTRY, UserRole.USER), async (req: AuthenticatedRequest, res: Response) => {
try {
const guardians = new Guardians();
const user = req.user;
let tokens = [];

if (user.role === UserRole.STANDARD_REGISTRY) {
tokens = await guardians.getTokens({
did: user.did
});
} else if (user.did) {
tokens = await guardians.getAssociatedTokens(user.did);
}
tokens = tokens || [];
await setTokensPolicies(tokens, user);
res.status(200).json(tokens);
} catch (error) {
new Logger().error(error, ['API_GATEWAY']);
res.status(500).send({ code: error.code || 500, message: error.message });
}
});

tokenAPI.put('/:tokenId/associate', permissionHelper(UserRole.USER), async (req: AuthenticatedRequest, res: Response) => {
try {
const guardians = new Guardians();
Expand Down
43 changes: 30 additions & 13 deletions api-gateway/src/api/service/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ export class WebSocketsService {
private registerMessageHandler(): void {
this.channel.response<IUpdateBlockMessage, any>('update-block', async (msg) => {
this.wss.clients.forEach((client: any) => {
this.send(client, {
type: 'update-event',
data: msg.uuid
});
if (this.checkUserByDid(client, msg)) {
this.send(client, {
type: 'update-event',
data: msg.uuid
});
}
});
return new MessageResponse({})
});
Expand Down Expand Up @@ -89,15 +91,24 @@ export class WebSocketsService {
return new MessageResponse({});
});

this.channel.response<IUpdateUserBalanceMessage, any>('update-user-balance', async (msg) => {
this.wss.clients.forEach((client: any) => {
if (this.checkUserByName(client, msg)) {
this.send(client, {
type: 'PROFILE_BALANCE',
data: msg
this.channel.response<IUpdateUserBalanceMessage, any>('update-user-balance', async (msg) => {
this.wss.clients.forEach(client => {
new Users().getUserByAccount(msg.operatorAccountId).then(user => {{
Object.assign(msg, {
user: user ? {
username: user.username,
did: user.did
} : null
});
}
if (this.checkUserByName(client, msg)) {
this.send(client, {
type: 'PROFILE_BALANCE',
data: msg
});
}
}});
});

return new MessageResponse({});
});

Expand All @@ -118,7 +129,6 @@ export class WebSocketsService {
*/
private registerConnection(): void {
this.wss.on('connection', async (ws: any, req: IncomingMessage) => {
ws.user = await this.getUserByUrl(req.url);
ws.on('message', async (data: Buffer) => {
const message = data.toString();
if (message === 'ping') {
Expand All @@ -128,6 +138,7 @@ export class WebSocketsService {
this.wsResponse(ws, message);
}
});
ws.user = await this.getUserByUrl(req.url);
});
}

Expand Down Expand Up @@ -228,7 +239,13 @@ export class WebSocketsService {
* @private
*/
private checkUserByDid(client: any, msg: any): boolean {
return client && client.user && msg && msg.user && (client.user.did === msg.user.did);
if(client && client.user) {
if(msg && msg.user) {
return (client.user.did === msg.user.did || msg.user.virtual);
}
return true;
}
return false;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions api-gateway/src/helpers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ export class Users extends ServiceRequestsBase {
return await this.request(AuthEvents.GET_USER_BY_ID, {did});
}

/**
* Return user by account
* @param account
*/
public async getUserByAccount(account: string): Promise<IAuthUser> {
return await this.request(AuthEvents.GET_USER_BY_ACCOUNT, { account });
}

/**
* Return user by did
* @param dids
Expand Down
7 changes: 2 additions & 5 deletions api-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ dotenv.config();
const { spawn } = require('child_process');
const kill = require('tree-kill');
const path = require('path');
const fs = require('fs');

const { sleep, GenerateTokens } = require("./helpers");

const { Accounts } = require("./test-suits/accounts");
const { Profiles } = require("./test-suits/profiles");
const { Schemas } = require("./test-suits/schemas");
const { Trustchains } = require("./test-suits/trustchains");
const { Policies } = require("./test-suits/policies");


const processes = [];
Expand All @@ -22,8 +19,8 @@ describe('Tests', async function () {
this.timeout(10000000000);
const pathArray = [
[path.resolve(path.join('..', 'logger-service')), {}],
[path.resolve(path.join('..', 'worker-service')), {}],
[path.resolve(path.join('..', 'auth-service')), {}],
[path.resolve(path.join('..', 'worker-service')), {IPFS_STORAGE_API_KEY: process.env.IPFS_STORAGE_API_KEY}],
[path.resolve(path.join('..', 'auth-service')), {HASHICORP_ADDRESS: `http://${process.env.HASHICORP_HOST}:${process.env.HASHICORP_PORT}`}],
[path.resolve(path.join('..', 'ipfs-client')), {IPFS_STORAGE_API_KEY: process.env.IPFS_STORAGE_API_KEY}],
[path.resolve(path.join('..', 'guardian-service')), {OPERATOR_ID: process.env.OPERATOR_ID, OPERATOR_KEY: process.env.OPERATOR_KEY}],
[path.resolve(path.join('..', 'api-gateway')), {}]
Expand Down
Loading

0 comments on commit 33992fb

Please sign in to comment.