-
Notifications
You must be signed in to change notification settings - Fork 284
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
feat(cmd-api-server): aggregate swagger.json endpoints #431
Labels
API_Server
enhancement
New feature or request
P1
Priority 1: Highest
Security
Related to existing or potential security vulnerabilities
Milestone
Comments
petermetz
added
Security
Related to existing or potential security vulnerabilities
P1
Priority 1: Highest
labels
Mar 15, 2022
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Sep 14, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Sep 19, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Sep 19, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Sep 20, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Sep 28, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Nov 28, 2023
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Feb 8, 2024
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz
added a commit
to petermetz/cacti
that referenced
this issue
Mar 11, 2024
WORK IN PROGRESS Fixes hyperledger-cacti#431 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API_Server
enhancement
New feature or request
P1
Priority 1: Highest
Security
Related to existing or potential security vulnerabilities
Is your feature request related to a problem? Please describe.
Currently, we use OpenAPI, but we do not have the swagger.json file exposed which would allow people to inspect the generated documentation for all the endpoints that we through the Swagger Editor 1, 2
Describe the solution you'd like
cmd-api-server
. Both of which are to serveGET
requests and return the contents of a openapi-spec.json document that is the aggregate of the openapi-spec.json documents of the plugins exposing web services that the API server has installed (tip: use the plugin registry to fetch a list of web service plugins, there's examples for this in theapi-server.ts
file within thecmd-api-server
package.Dealing with conflicting web service paths
If two nodes have the same plugin installed but with different configuration, then we have a problem for endpoint 2) because these will get into a conflict based on their matching paths.
One way of dealing with this is to just let it happen meaning that based on the path the two web services will get collapsed into one as far as the developer is concerned. This is not as bad as it sounds because it still provides a complete and accurate view of what web services of the consortium as a whole are available for developers to be used. The only information that is lost is the fact that there are two plugins on different needs that can be used for different things such as if both nodes have a Besu ledger connector pointing to different Besu ledgers (so 2 separate ledgers are in this mental picture).
A better way of dealing with the problem stated above would be to add an extension property 3 to our OpenAPI spec files that encodes the information that is lost during the assembly of the aggregate OpenAPI spec file (as explained in the paragraph above).
The extension property would have to be an array type so that it's well defined how the values of the extension property can be concatenated into a single one (by joining the arrays)
The values within the extension property's array could be either the plugin instances, or the Cactus node IDs as specified in the Consortium database. These values would then be able to power the routing mechanisms involved in making sure that the it is possible to disambiguate requests sent to the otherwise identical ledger plugins in the example above (2 besu ledger connectors, 2 besu ledgers).
The extension property to be defined as shown here:
Describe alternatives you've considered
Considered having this in the consortium plugin instead, but ultimately decided that it would be better in the API server package.
Willing to hear opinions to the contrary of course. It's hard to get these things right at the drawing table.
cc: @takeutak @sfuji822 @hartm @jonathan-m-hamilton
The text was updated successfully, but these errors were encountered: