mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 08:07:58 +00:00
Expand remote keystore interface to allow for hybrid mode (#7628)
* update to latest master * updates on docs, license, meta * hide ssrs behind feature flag * implement remaining functions on the server * sign server line length fix * fix tests * fixup in-memory-keystore * adding failsafe * skipping ecdsa test for now * remote keystore param * remote sign urls made available * integrating keystore remotes features * don't forget the dependency * remove old cruft * reset local keystore * applying suggestions * Switch to single remote, minor grumbles * minor grumbles, docs
This commit is contained in:
committed by
GitHub
parent
7a43cca875
commit
5ce8c33368
@@ -30,6 +30,9 @@ const DEFAULT_KEYSTORE_CONFIG_PATH: &'static str = "keystore";
|
||||
/// Parameters of the keystore
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct KeystoreParams {
|
||||
/// Specify custom URIs to connect to for keystore-services
|
||||
#[structopt(long = "keystore-uri")]
|
||||
pub keystore_uri: Option<String>,
|
||||
/// Specify custom keystore path.
|
||||
#[structopt(long = "keystore-path", value_name = "PATH", parse(from_os_str))]
|
||||
pub keystore_path: Option<PathBuf>,
|
||||
@@ -67,7 +70,9 @@ pub fn secret_string_from_str(s: &str) -> std::result::Result<SecretString, Stri
|
||||
|
||||
impl KeystoreParams {
|
||||
/// Get the keystore configuration for the parameters
|
||||
pub fn keystore_config(&self, base_path: &PathBuf) -> Result<KeystoreConfig> {
|
||||
/// returns a vector of remote-urls and the local Keystore configuration
|
||||
pub fn keystore_config(&self, base_path: &PathBuf) -> Result<(Option<String>, KeystoreConfig)> {
|
||||
|
||||
let password = if self.password_interactive {
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
{
|
||||
@@ -89,7 +94,7 @@ impl KeystoreParams {
|
||||
.clone()
|
||||
.unwrap_or_else(|| base_path.join(DEFAULT_KEYSTORE_CONFIG_PATH));
|
||||
|
||||
Ok(KeystoreConfig::Path { path, password })
|
||||
Ok((self.keystore_uri.clone(), KeystoreConfig::Path { path, password }))
|
||||
}
|
||||
|
||||
/// helper method to fetch password from `KeyParams` or read from stdin
|
||||
|
||||
Reference in New Issue
Block a user