You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates to @shardeum-foundation package versions are included in this PR. Per project policy, these should be in a separate PR or commit to avoid merge conflicts between branch lines with different versions.
There are no unit tests added for the new rpc.discover method. Ensure that this method is covered by appropriate tests, including correct schema return and error handling.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The current implementation exposes the rpc.discover method without any authentication or rate limiting, which could allow abuse or information leakage. Consider adding appropriate access controls or rate limiting to this method to prevent misuse. [security, importance: 8]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
This adds
This adds
rpc.discovermethod for OpenRPC service discovery. This enables clients to retrieve the OpenRPC schema via JSON-RPC.Notes:
jaysonbecause it doesnt supportrpc.PR Type
Enhancement
Description
Add
rpc.discoverOpenRPC service discovery methodIntegrate OpenRPC schema via
@shardeum-foundation/api-specsUpdate method whitelist to allow
rpc.discoverRegister
rpc.discoverin JSON-RPC server initializationChanges walkthrough 📝
rpcDiscover.ts
Add rpcDiscover method for OpenRPC schema retrievalsrc/methods/rpcDiscover.ts
rpcDiscovermethod returning OpenRPC document@shardeum-foundation/api-specsmethodWhitelist.ts
Allow rpc.discover in method whitelistsrc/middlewares/methodWhitelist.ts
rpc.discoverto allowed JSON-RPC methodsrpc.discoverare permittedserver.ts
Register rpc.discover in JSON-RPC serversrc/server.ts
rpcDiscoverin JSON-RPC serverrpc.discovermethodpackage.json
Add OpenRPC schema dependency to projectpackage.json
@shardeum-foundation/api-specsas a dependency