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(plugin-ledger-connector-besu): OpenAPI spec validation missing from plugin REST endpoints #1291

Closed
elenaizaguirre opened this issue Sep 1, 2021 · 1 comment · Fixed by #1292
Assignees
Labels
bug Something isn't working

Comments

@elenaizaguirre
Copy link
Contributor

Describe the bug

Right now the constraints we define for request/response objects are not checked when a request comes in.

To Reproduce

Send an invalid request to some plugin endpoint that is invalid in a certain way and watch how it crashes the plugin resulting in internal server error vs. bad request.

Expected behavior

Fail with bad request even before the plugin's back-end code is reached if a request is sent that does not comply with the open api specs defined for that endpoint.

Logs/Stack traces

N/A

Screenshots

N/A

Cloud provider or hardware configuration:

N/A

Operating system name, version, build:

N/A

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

main

Hyperledger Cactus Plugins/Connectors Used

Besu

Additional context

The interface of the web service plugins should be extended with a getOpenApiSpecs() method that returns an OpenAPI v3 spec document (see the openapi-types package)
Then the api-server calls up this method when it's installing the web services of the plugin, obtains the open api specs and creates a validator instance from it.

@elenaizaguirre elenaizaguirre added the bug Something isn't working label Sep 1, 2021
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 1, 2021
add missing validation for besu plugin rest endpoints

Closes: hyperledger-cacti#1291
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 1, 2021
add missing validation for quorum rest endpoints

Closes: hyperledger-cacti#1291
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
@elenaizaguirre
Copy link
Contributor Author

Working on this!

elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 1, 2021
add missing validation for quorum rest endpoints

Closes: hyperledger-cacti#1291
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 2, 2021
add missing validation for quorum rest endpoints

Closes: hyperledger-cacti#1291
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 3, 2021
add missing validation for besu rest endpoints throught cmd-api-server

Closes: hyperledger-cacti#1291

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 14, 2021
…su-erc20

Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 14, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 15, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 17, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 20, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 21, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 22, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 23, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
elenaizaguirre added a commit to elenaizaguirre/cactus that referenced this issue Sep 27, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
petermetz pushed a commit that referenced this issue Sep 28, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes #1291

Relationed with #847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
Leeyoungone pushed a commit to Leeyoungone/cactus that referenced this issue Sep 29, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
brioux pushed a commit to brioux/cactus that referenced this issue Oct 4, 2021
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
RafaelAPB pushed a commit to RafaelAPB/blockchain-integration-framework that referenced this issue Mar 9, 2022
Changes endpoints getSingleStatus and getStatus in htlc-eth-besu
and htlc-eth-besu-erc20 which now are of type post and defines
for that new request schemas.

Includes tests for all endpoints in besu, htlc-eth-besu and
htlc-eth-besu-erc20, each of them with test cases:
  - Right request
  - Request including an invalid parameter
  - Request without a required parameter

Closes hyperledger-cacti#1291

Relationed with hyperledger-cacti#847

Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant