Skip to content

Commit

Permalink
fix: openapi-validation for quorum plugin
Browse files Browse the repository at this point in the history
add missing validation for quorum plugin rest endpoints

Closes: hyperledger-cacti#1286
Signed-off-by: Elena Izaguirre <e.izaguirre.equiza@accenture.com>
  • Loading branch information
elenaizaguirre committed Sep 1, 2021
1 parent 2161e0d commit f2b6d8f
Show file tree
Hide file tree
Showing 7 changed files with 1,201 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"@hyperledger/cactus-core-api": "0.8.0",
"axios": "0.21.1",
"express": "4.17.1",
"express-openapi-validator": "4.12.12",
"prom-client": "13.2.0",
"typescript-optional": "2.0.1",
"web3": "1.3.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"servers": [
{
"url": "https://www.cactus.stream/{basePath}",
"description": "Public test instance",
"variables": {
"basePath": {
"default": ""
}
}
},
{
"url": "http://localhost:4000/{basePath}",
"description": "Local test instance",
"variables": {
"basePath": {
"default": ""
}
}
}
],
"components": {
"schemas": {
"Web3SigningCredential": {
Expand Down Expand Up @@ -333,19 +313,19 @@
},
"transactionHash": {
"type": "string",
"minLength": 64,
"maxLength": 64,
"pattern": "/^0x([A-Fa-f0-9]{64})$/"
"minLength": 66,
"maxLength": 66,
"pattern": "^0x([A-Fa-f0-9]{64})$"
},
"transactionIndex": {
"type": "number",
"nullable": false
},
"blockHash": {
"type": "string",
"minLength": 64,
"maxLength": 64,
"pattern": "/^0x([A-Fa-f0-9]{64})$/"
"minLength": 66,
"maxLength": 66,
"pattern": "^0x([A-Fa-f0-9]{64})$"
},
"blockNumber": {
"type": "number",
Expand Down Expand Up @@ -375,6 +355,7 @@
"web3SigningCredential",
"transactionConfig"
],
"additionalProperties": false,
"properties": {
"web3SigningCredential": {
"$ref": "#/components/schemas/Web3SigningCredential",
Expand Down Expand Up @@ -412,6 +393,7 @@
"web3SigningCredential",
"keychainId"
],
"additionalProperties": false,
"properties": {
"contractName": {
"type": "string",
Expand Down Expand Up @@ -475,6 +457,7 @@
"methodName",
"params"
],
"additionalProperties": false,
"properties": {
"contractName": {
"type": "string",
Expand Down Expand Up @@ -710,6 +693,75 @@
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws": {
"post": {
"x-hyperledger-cactus": {
"http": {
"verbLowerCase": "post",
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws"
}
},
"operationId": "getConsortiumJwsV1",
"summary": "Retrieves a consortium JWS",
"description": "The JWS asserting the consortium metadata (pub keys and hosts of nodes)",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-plugin-consortium-manual/src/main/json/openapi.json#/components/schemas/GetConsortiumJwsRequest"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-plugin-consortium-manual/src/main/json/openapi.json#/components/schemas/GetConsortiumJwsResponse"
}
}
}
}
}
}
},
"/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws": {
"post": {
"x-hyperledger-cactus": {
"http": {
"verbLowerCase": "post",
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws"
}
},
"operationId": "getNodeJwsV1",
"summary": "Retrieves the JWT of a Cactus Node",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-plugin-consortium-manual/src/main/json/openapi.json#/components/schemas/GetNodeJwsRequest"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "https://raw.githubusercontent.com/hyperledger/cactus/v0.8.0/packages/cactus-plugin-consortium-manual/src/main/json/openapi.json#/components/schemas/GetNodeJwsResponse"
}
}
}
}
}
}
}
}
}
Loading

0 comments on commit f2b6d8f

Please sign in to comment.