Skip to content

Commit

Permalink
[fix] hyperledger-iroha#2422: Hide private keys in configuration endp…
Browse files Browse the repository at this point in the history
…oint response (hyperledger-iroha#2435)

Signed-off-by: Shanin Roman <[email protected]>
  • Loading branch information
Erigara authored and mversic committed Sep 9, 2022
1 parent a827e9e commit 0f0a632
Show file tree
Hide file tree
Showing 60 changed files with 1,469 additions and 996 deletions.
24 changes: 23 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ members = [
"client",
"client_cli",
"config",
"config/derive",
"config/base",
"config/base/derive",
"core",
"core/test_network",
"crypto",
Expand Down
178 changes: 0 additions & 178 deletions cli/src/config.rs

This file was deleted.

5 changes: 2 additions & 3 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use std::{panic, path::PathBuf, sync::Arc};

use color_eyre::eyre::{eyre, Result, WrapErr};
use config::Configuration;
use iroha_actor::{broker::*, prelude::*};
use iroha_config::iroha::Configuration;
use iroha_core::{
block_sync::{BlockSynchronizer, BlockSynchronizerTrait},
genesis::{GenesisNetwork, GenesisNetworkTrait, RawGenesisBlock},
Expand All @@ -28,7 +28,6 @@ use tokio::{
};
use torii::Torii;

pub mod config;
mod event;
pub mod samples;
mod stream;
Expand Down Expand Up @@ -360,7 +359,7 @@ where
///
/// # Errors
/// - Genesis account public key not specified.
fn domains(configuration: &config::Configuration) -> [Domain; 1] {
fn domains(configuration: &Configuration) -> [Domain; 1] {
let key = configuration.genesis.account_public_key.clone();
[Domain::from(GenesisDomain::new(key))]
}
Expand Down
23 changes: 10 additions & 13 deletions cli/src/samples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
//! This module contains the sample configurations used for testing and benchmarking throghout Iroha.
use std::{collections::HashSet, str::FromStr};

use iroha_core::{
block_sync::config::BlockSyncConfiguration,
genesis::config::GenesisConfiguration,
kura::config::KuraConfiguration,
use iroha_config::{
block_sync::Configuration as BlockSyncConfiguration,
genesis::Configuration as GenesisConfiguration,
iroha::Configuration,
kura::Configuration as KuraConfiguration,
queue::Configuration as QueueConfiguration,
smartcontracts::wasm::config::Configuration as WasmConfiguration,
sumeragi::config::{SumeragiConfiguration, TrustedPeers},
wsv::config::Configuration as WsvConfiguration,
sumeragi::{Configuration as SumeragiConfiguration, TrustedPeers},
torii::{Configuration as ToriiConfiguration, DEFAULT_TORII_P2P_ADDR},
wasm::Configuration as WasmConfiguration,
wsv::Configuration as WsvConfiguration,
};
use iroha_crypto::{KeyPair, PublicKey};
use iroha_data_model::peer::Id as PeerId;

use crate::{
config::Configuration,
torii::config::{ToriiConfiguration, DEFAULT_TORII_P2P_ADDR},
};

/// Get sample trusted peers. The public key must be the same as `configuration.public_key`
///
/// # Panics
Expand Down Expand Up @@ -72,7 +69,7 @@ pub fn get_config(trusted_peers: HashSet<PeerId>, key_pair: Option<KeyPair>) ->
public_key: public_key.clone(),
private_key: private_key.clone(),
kura: KuraConfiguration {
init_mode: iroha_core::kura::Mode::Strict,
init_mode: iroha_config::kura::Mode::Strict,
block_store_path: "./blocks".into(),
..KuraConfiguration::default()
},
Expand Down
45 changes: 0 additions & 45 deletions cli/src/torii/config.rs

This file was deleted.

3 changes: 1 addition & 2 deletions cli/src/torii/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use warp::{

#[macro_use]
pub(crate) mod utils;
pub mod config;
pub mod routing;

/// Main network handler and the only entrypoint of the Iroha.
Expand Down Expand Up @@ -74,7 +73,7 @@ pub enum Error {
Status(#[from] iroha_actor::Error),
/// Configuration change error.
#[error("Attempt to change configuration failed")]
ConfigurationReload(#[from] iroha_config::runtime_upgrades::ReloadError),
ConfigurationReload(#[from] iroha_config::base::runtime_upgrades::ReloadError),
#[cfg(feature = "telemetry")]
/// Error while getting Prometheus metrics
#[error("Failed to produce Prometheus metrics: {0}")]
Expand Down
Loading

0 comments on commit 0f0a632

Please sign in to comment.