Skip to content

Commit 6615294

Browse files
committed
feat: Do not print the secret key
It is scary when folks have to worry about secrets being printed. #84 will solve the key persistence in a much better way anyway.
1 parent d78922c commit 6615294

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Command line arguments.
22
use clap::{Parser, Subcommand};
33
use dumbpipe::EndpointTicket;
4-
use iroh::{endpoint::Connecting, Endpoint, EndpointAddr, SecretKey};
4+
use iroh::{Endpoint, EndpointAddr, SecretKey, endpoint::Connecting};
55
use n0_snafu::{Result, ResultExt};
66
use std::{
77
io,
@@ -282,16 +282,14 @@ async fn copy_from_quinn(
282282
}
283283

284284
/// Get the secret key or generate a new one.
285-
///
286-
/// Print the secret key to stderr if it was generated, so the user can save it.
287285
fn get_or_create_secret() -> Result<SecretKey> {
288286
match std::env::var("IROH_SECRET") {
289287
Ok(secret) => SecretKey::from_str(&secret).context("invalid secret"),
290288
Err(_) => {
291289
let key = SecretKey::generate(&mut rand::rng());
292290
eprintln!(
293-
"using secret key {}",
294-
data_encoding::HEXLOWER.encode(&key.to_bytes())
291+
"generated new endpoint ID: {}",
292+
data_encoding::HEXLOWER.encode(&*key.public())
295293
);
296294
Ok(key)
297295
}

0 commit comments

Comments
 (0)