-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from chainbound/lore/feat/keystore-secrets
feat(sidecar): keystore secrets path in config
- Loading branch information
Showing
28 changed files
with
482 additions
and
206 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
target/ | ||
.env | ||
.env.dev | ||
.env.* | ||
!.env.example |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
39 changes: 22 additions & 17 deletions
39
bolt-sidecar/src/config/signing.rs → ...-sidecar/src/config/constraint_signing.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,54 @@ | ||
use std::{fmt, net::SocketAddr}; | ||
use std::{fmt, path::PathBuf}; | ||
|
||
use clap::{ArgGroup, Args}; | ||
use lighthouse_account_utils::ZeroizeString; | ||
use reqwest::Url; | ||
use serde::Deserialize; | ||
|
||
use crate::common::{BlsSecretKeyWrapper, JwtSecretConfig}; | ||
|
||
/// Command-line options for signing | ||
/// Command-line options for signing constraint messages | ||
#[derive(Args, Deserialize)] | ||
#[clap( | ||
group = ArgGroup::new("signing-opts").required(true) | ||
.args(&["private_key", "commit_boost_address", "keystore_password"]) | ||
.args(&["constraint_private_key", "commit_boost_signer_url", "keystore_password", "keystore_secrets_path"]) | ||
)] | ||
pub struct SigningOpts { | ||
/// Private key to use for signing preconfirmation requests | ||
#[clap(long, env = "BOLT_SIDECAR_PRIVATE_KEY")] | ||
pub private_key: Option<BlsSecretKeyWrapper>, | ||
/// Socket address for the commit-boost sidecar | ||
pub struct ConstraintSigningOpts { | ||
/// Private key to use for signing constraint messages | ||
#[clap(long, env = "BOLT_SIDECAR_CONSTRAINT_PRIVATE_KEY")] | ||
pub constraint_private_key: Option<BlsSecretKeyWrapper>, | ||
/// URL for the commit-boost sidecar | ||
#[clap(long, env = "BOLT_SIDECAR_CB_SIGNER_URL", requires("commit_boost_jwt_hex"))] | ||
pub commit_boost_address: Option<SocketAddr>, | ||
pub commit_boost_signer_url: Option<Url>, | ||
/// JWT in hexadecimal format for authenticating with the commit-boost service | ||
#[clap(long, env = "BOLT_SIDECAR_CB_JWT_HEX", requires("commit_boost_address"))] | ||
#[clap(long, env = "BOLT_SIDECAR_CB_JWT_HEX", requires("commit_boost_signer_url"))] | ||
pub commit_boost_jwt_hex: Option<JwtSecretConfig>, | ||
/// The password for the ERC-2335 keystore. | ||
/// Reference: https://eips.ethereum.org/EIPS/eip-2335 | ||
#[clap(long, env = "BOLT_SIDECAR_KEYSTORE_PASSWORD")] | ||
pub keystore_password: Option<ZeroizeString>, | ||
/// The path to the ERC-2335 keystore secret passwords | ||
/// Reference: https://eips.ethereum.org/EIPS/eip-2335 | ||
#[clap(long, env = "BOLT_SIDECAR_KEYSTORE_SECRETS_PATH", conflicts_with("keystore_password"))] | ||
pub keystore_secrets_path: Option<PathBuf>, | ||
/// Path to the keystores folder. If not provided, the default path is used. | ||
#[clap(long, env = "BOLT_SIDECAR_KEYSTORE_PATH", requires("keystore_password"))] | ||
pub keystore_path: Option<String>, | ||
#[clap(long, env = "BOLT_SIDECAR_KEYSTORE_PATH")] | ||
pub keystore_path: Option<PathBuf>, | ||
/// Path to the delegations file. If not provided, the default path is used. | ||
#[clap(long, env = "BOLT_SIDECAR_DELEGATIONS_PATH")] | ||
pub delegations_path: Option<String>, | ||
pub delegations_path: Option<PathBuf>, | ||
} | ||
|
||
// Implement Debug manually to hide the keystore_password field | ||
impl fmt::Debug for SigningOpts { | ||
impl fmt::Debug for ConstraintSigningOpts { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
f.debug_struct("SigningOpts") | ||
.field("private_key", &self.private_key) | ||
.field("commit_boost_url", &self.commit_boost_address) | ||
.field("constraint_private_key", &"********") // Hides the actual private key | ||
.field("commit_boost_signer_url", &self.commit_boost_signer_url) | ||
.field("commit_boost_jwt_hex", &self.commit_boost_jwt_hex) | ||
.field("keystore_password", &"********") // Hides the actual password | ||
.field("keystore_path", &self.keystore_path) | ||
.field("delegations_path", &self.delegations_path) | ||
.field("keystore_secrets_path", &self.keystore_secrets_path) | ||
.finish() | ||
} | ||
} |
Oops, something went wrong.