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

fix: endpoints implementation in corda plugin #1347

Merged

Conversation

elenaizaguirre
Copy link
Contributor

Closes #1346

Signed-off-by: Elena Izaguirre [email protected]

@elenaizaguirre
Copy link
Contributor Author

@petermetz Can you take a look at this, please? I am not sure if this is that you wanted me to do. I started with a remote adapter like plugin-keychain-vault-remote-adapter.ts but later I saw that it was simpler to use those endpoints like proxies to container endpoints (as Vault.client in plugin-keychain-vault.ts) because Corda endpoints are not used when we call container endpoints.

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2021

Codecov Report

Merging #1347 (7314cc1) into main (09ace15) will increase coverage by 1.44%.
The diff coverage is 78.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1347      +/-   ##
==========================================
+ Coverage   68.35%   69.80%   +1.44%     
==========================================
  Files         333      336       +3     
  Lines       12524    12620      +96     
  Branches     1507     1512       +5     
==========================================
+ Hits         8561     8809     +248     
+ Misses       3152     2989     -163     
- Partials      811      822      +11     
Impacted Files Coverage Δ
...pescript/web-services/diagnose-node-endpoint-v1.ts 54.05% <54.05%> (ø)
...typescript/web-services/network-map-endpoint-v1.ts 83.78% <83.78%> (ø)
.../typescript/web-services/list-flows-endpoint-v1.ts 84.61% <84.61%> (ø)
...ript/web-services/deploy-contract-jars-endpoint.ts 82.97% <85.71%> (+70.93%) ⬆️
...script/web-services/invoke-contract-endpoint-v1.ts 83.78% <88.88%> (+70.45%) ⬆️
...c/main/typescript/plugin-ledger-connector-corda.ts 83.09% <100.00%> (+66.14%) ⬆️
...ing/src/main/typescript/corda/corda-test-ledger.ts 87.17% <0.00%> (+1.28%) ⬆️
...pescript/generated/openapi/typescript-axios/api.ts 83.87% <0.00%> (+10.48%) ⬆️
...ipt/plugin/web-service/i-endpoint-authz-options.ts 66.66% <0.00%> (+33.33%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09ace15...7314cc1. Read the comment docs.

@elenaizaguirre elenaizaguirre force-pushed the corda-remote-adapter branch 3 times, most recently from a14b095 to 46c8f76 Compare September 23, 2021 06:12
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elenaizaguirre A few questions:

  1. Is the remote adapter pattern not implemented in here? I couldn't find a class for it in the diff.
  2. Can the OpenAPI validation be done in the JVM implementation? Right now the validation only happens (I think) if you proxied the requests through the NodeJS app but if you were to hit the JVM app directly it wouldn't perform the validations.

@elenaizaguirre elenaizaguirre marked this pull request as draft October 7, 2021 08:33
@elenaizaguirre elenaizaguirre force-pushed the corda-remote-adapter branch 2 times, most recently from 9ea7cca to f6f0086 Compare November 3, 2021 15:57
@elenaizaguirre
Copy link
Contributor Author

@elenaizaguirre A few questions:

  1. Is the remote adapter pattern not implemented in here? I couldn't find a class for it in the diff.
  2. Can the OpenAPI validation be done in the JVM implementation? Right now the validation only happens (I think) if you proxied the requests through the NodeJS app but if you were to hit the JVM app directly it wouldn't perform the validations.

@petermetz
That pattern is not implemented because I used a proxy to access the internal container.
Validations will be directly in the JVM app

@elenaizaguirre elenaizaguirre marked this pull request as ready for review November 3, 2021 15:59
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elenaizaguirre

That pattern is not implemented because I used a proxy to access the internal container.

Okay, that's fine for now but we'll have to move that to a remote adapter once we are adding support to Corda 5.x because that one will have support for RPC directly from JS code

@petermetz petermetz merged commit 21a22b5 into hyperledger-cacti:main Nov 4, 2021
@petermetz petermetz deleted the corda-remote-adapter branch November 4, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix (cactus-plugin-ledger-connector-corda): add endpoints implementation
4 participants