[fortuna] accept only a secret file as argument (#1204)
* accept file only * pre commit
This commit is contained in:
parent
220e06a62d
commit
3e05edba24
|
@ -1486,7 +1486,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fortuna"
|
||||
version = "3.0.2"
|
||||
version = "3.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "fortuna"
|
||||
version = "3.0.2"
|
||||
version = "3.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
@ -31,10 +31,7 @@ pub async fn register_provider(opts: &RegisterProviderOptions) -> Result<()> {
|
|||
|
||||
// Create a new random hash chain.
|
||||
let random = rand::random::<[u8; 32]>();
|
||||
let secret = match opts.randomness.load_secret() {
|
||||
Ok(loaded_secret) => loaded_secret,
|
||||
Err(_err) => opts.randomness.secret_file.clone(),
|
||||
};
|
||||
let secret = opts.randomness.load_secret()?;
|
||||
|
||||
let commitment_length = opts.randomness.chain_length;
|
||||
let mut chain =
|
||||
|
|
|
@ -47,11 +47,7 @@ pub async fn run(opts: &RunOptions) -> Result<()> {
|
|||
struct ApiDoc;
|
||||
|
||||
let config = Config::load(&opts.config.config)?;
|
||||
let secret: String;
|
||||
match opts.randomness.load_secret() {
|
||||
Ok(loaded_secret) => secret = loaded_secret,
|
||||
Err(_err) => secret = opts.randomness.secret_file.clone(),
|
||||
}
|
||||
let secret = opts.randomness.load_secret()?;
|
||||
|
||||
|
||||
let mut chains = HashMap::new();
|
||||
|
|
|
@ -78,7 +78,6 @@ pub struct ConfigOptions {
|
|||
pub struct RandomnessOptions {
|
||||
/// Path to file containing a secret which is a 64-char hex string.
|
||||
/// The secret is used for generating new hash chains
|
||||
/// Or the secret itself. TODO: this will be removed in another PR.
|
||||
#[arg(long = "secret")]
|
||||
#[arg(env = "FORTUNA_SECRET")]
|
||||
pub secret_file: String,
|
||||
|
|
Loading…
Reference in New Issue