mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
Allow to expose a subset of unsafe RPCs (#5233)
* sc-cli: Use type-safe constructors for RPC/Prometheus interfaces * service: Simplify rpc handler creation Could probably be further simplifies once [this][commit] lands. [commit]: https://github.com/paritytech/jsonrpc/commit/20485387ed06a48f1a70bf4d609a7cde6cf0accf * service: Streamline some HTTP & WS server start logic * client: Introduce a simple RPC policy mechanism * rpc/system: Check unsafe RPCs * rpc/offchain: Check unsafe RPCs * rpc/author: Check unsafe RPCs
This commit is contained in:
@@ -249,6 +249,13 @@ pub trait CliConfiguration: Sized {
|
||||
Ok(Default::default())
|
||||
}
|
||||
|
||||
/// Returns `Ok(true) if potentially unsafe RPC is to be exposed.
|
||||
///
|
||||
/// By default this is `false`.
|
||||
fn unsafe_rpc_expose(&self) -> Result<bool> {
|
||||
Ok(Default::default())
|
||||
}
|
||||
|
||||
/// Get the RPC websockets maximum connections (`None` if unlimited).
|
||||
///
|
||||
/// By default this is `None`.
|
||||
@@ -419,6 +426,7 @@ pub trait CliConfiguration: Sized {
|
||||
execution_strategies: self.execution_strategies(is_dev)?,
|
||||
rpc_http: self.rpc_http()?,
|
||||
rpc_ws: self.rpc_ws()?,
|
||||
unsafe_rpc_expose: self.unsafe_rpc_expose()?,
|
||||
rpc_ws_max_connections: self.rpc_ws_max_connections()?,
|
||||
rpc_cors: self.rpc_cors(is_dev)?,
|
||||
prometheus_config: self.prometheus_config()?,
|
||||
|
||||
Reference in New Issue
Block a user