Skip to content

Commit

Permalink
config get will now not show the entire api token anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1N committed Mar 27, 2024
1 parent 5b9b3d2 commit 5d7ae28
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,20 @@ pub async fn handle(matches: &ArgMatches) -> Result<()> {
_ => (),
}
} else {
println!("registry = {}", config.registry.unwrap_or_default());
println!("token = {}", config.token.unwrap_or_default());
println!("registry = \"{}\"", config.registry.unwrap_or_default());

let token = config.token.unwrap_or_default();
let token = if token.len() > 6 {
format!(
"{}{}",
&token[..4],
token[4..].chars().map(|_| '*').collect::<String>()
)
} else {
token.chars().map(|_| '*').collect()
};
println!("token = \"{}\"", token);

println!(
"pub_key_file = {:?}",
config.pub_key_file.unwrap_or_default()
Expand Down

0 comments on commit 5d7ae28

Please sign in to comment.