Skip to content

Commit

Permalink
2024-04-23
Browse files Browse the repository at this point in the history
  • Loading branch information
bestia.dev committed Apr 23, 2024
1 parent 6a15a47 commit 08df4ae
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 51 deletions.
6 changes: 3 additions & 3 deletions automation_tasks_rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// for projects that don't use GitHub, delete all the mentions of GitHub
mod secrets_always_local_mod;
use crate::secrets_always_local_mod::crate_io_mod;
use crate::secrets_always_local_mod::crates_io_mod;
use crate::secrets_always_local_mod::github_mod;

use cargo_auto_github_lib as cgl;
Expand Down Expand Up @@ -409,8 +409,8 @@ fn task_publish_to_crates_io() {
let tag_name_version = cl::git_tag_sync_check_create_push(&version);

// cargo publish with encrypted secret token
let crate_io_client = crate_io_mod::CratesIoClient::new_with_stored_token();
crate_io_client.publish_to_crates_io();
let crates_io_client = crates_io_mod::CratesIoClient::new_with_stored_token();
crates_io_client.publish_to_crates_io();

println!(
r#"
Expand Down
8 changes: 4 additions & 4 deletions automation_tasks_rs/src/secrets_always_local_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub(crate) mod github_mod {
}
}

pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {

//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -552,7 +552,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -580,13 +580,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/template_new_auto_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Cargo.lock
// for projects that don't use GitHub, delete all the mentions of GitHub
mod secrets_always_local_mod;
use crate::secrets_always_local_mod::crate_io_mod;
use crate::secrets_always_local_mod::crates_io_mod;
use crate::secrets_always_local_mod::github_mod;
use cargo_auto_github_lib as cgl;
Expand Down Expand Up @@ -445,8 +445,8 @@ fn task_publish_to_crates_io() {
let tag_name_version = cl::git_tag_sync_check_create_push(&version);
// cargo publish with encrypted secret token
let crate_io_client = crate_io_mod::CratesIoClient::new_with_stored_token();
crate_io_client.publish_to_crates_io();
let crates_io_client = crates_io_mod::CratesIoClient::new_with_stored_token();
crates_io_client.publish_to_crates_io();
println!(
r#"
Expand Down Expand Up @@ -1030,7 +1030,7 @@ pub(crate) mod github_mod {
}
}
pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {
//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -1100,7 +1100,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -1128,13 +1128,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/template_new_cli_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Cargo.lock
// for projects that don't use GitHub, delete all the mentions of GitHub
mod secrets_always_local_mod;
use crate::secrets_always_local_mod::crate_io_mod;
use crate::secrets_always_local_mod::crates_io_mod;
use crate::secrets_always_local_mod::github_mod;
use cargo_auto_github_lib as cgl;
Expand Down Expand Up @@ -465,8 +465,8 @@ fn task_publish_to_crates_io() {
let tag_name_version = cl::git_tag_sync_check_create_push(&version);
// cargo publish with encrypted secret token
let crate_io_client = crate_io_mod::CratesIoClient::new_with_stored_token();
crate_io_client.publish_to_crates_io();
let crates_io_client = crates_io_mod::CratesIoClient::new_with_stored_token();
crates_io_client.publish_to_crates_io();
println!(
r#"
Expand Down Expand Up @@ -1050,7 +1050,7 @@ pub(crate) mod github_mod {
}
}
pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {
//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -1120,7 +1120,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -1148,13 +1148,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/template_new_pwa_wasm_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ pub(crate) mod github_mod {
}
}

pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {

//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -1322,7 +1322,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -1350,13 +1350,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/template_new_wasm_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ pub(crate) mod github_mod {
}
}
pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {
//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -1188,7 +1188,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -1216,13 +1216,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}
Expand Down
6 changes: 3 additions & 3 deletions template_new_auto/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// for projects that don't use GitHub, delete all the mentions of GitHub
mod secrets_always_local_mod;
use crate::secrets_always_local_mod::crate_io_mod;
use crate::secrets_always_local_mod::crates_io_mod;
use crate::secrets_always_local_mod::github_mod;

use cargo_auto_github_lib as cgl;
Expand Down Expand Up @@ -358,8 +358,8 @@ fn task_publish_to_crates_io() {
let tag_name_version = cl::git_tag_sync_check_create_push(&version);

// cargo publish with encrypted secret token
let crate_io_client = crate_io_mod::CratesIoClient::new_with_stored_token();
crate_io_client.publish_to_crates_io();
let crates_io_client = crates_io_mod::CratesIoClient::new_with_stored_token();
crates_io_client.publish_to_crates_io();

println!(
r#"
Expand Down
8 changes: 4 additions & 4 deletions template_new_auto/src/secrets_always_local_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub(crate) mod github_mod {
}
}

pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {

//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -552,7 +552,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -580,13 +580,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}

Expand Down
6 changes: 3 additions & 3 deletions template_new_cli/automation_tasks_rs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// for projects that don't use GitHub, delete all the mentions of GitHub
mod secrets_always_local_mod;
use crate::secrets_always_local_mod::crate_io_mod;
use crate::secrets_always_local_mod::crates_io_mod;
use crate::secrets_always_local_mod::github_mod;

use cargo_auto_github_lib as cgl;
Expand Down Expand Up @@ -358,8 +358,8 @@ fn task_publish_to_crates_io() {
let tag_name_version = cl::git_tag_sync_check_create_push(&version);

// cargo publish with encrypted secret token
let crate_io_client = crate_io_mod::CratesIoClient::new_with_stored_token();
crate_io_client.publish_to_crates_io();
let crates_io_client = crates_io_mod::CratesIoClient::new_with_stored_token();
crates_io_client.publish_to_crates_io();

println!(
r#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub(crate) mod github_mod {
}
}

pub(crate) mod crate_io_mod {
pub(crate) mod crates_io_mod {

//! Publish to crates.io needs the crates.io token. This is a secret important just like a password.
//! I don't want to pass this secret to an "obscure" library crate that is difficult to review.
Expand Down Expand Up @@ -552,7 +552,7 @@ pub(crate) mod crate_io_mod {
#[allow(dead_code)]
pub fn new_with_stored_token() -> Self {
/// Internal function for DRY Don't Repeat Yourself
fn read_token_and_decrypt_return_crate_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
fn read_token_and_decrypt_return_crates_io_client(mut ssh_context: super::ssh_mod::SshContext, encrypted_string_file_path: &camino::Utf8Path) -> CratesIoClient {
cargo_auto_encrypt_secret_lib::decrypt_with_ssh_interactive_from_file(&mut ssh_context, encrypted_string_file_path);
let token_is_a_secret = ssh_context.get_decrypted_string();
let mut crates_io_client = CratesIoClient::new_wo_token();
Expand Down Expand Up @@ -580,13 +580,13 @@ pub(crate) mod crate_io_mod {
// encrypt and save the encrypted token
cargo_auto_encrypt_secret_lib::encrypt_with_ssh_interactive_save_file(&mut ssh_context, identity_private_file_path, encrypted_string_file_path);
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
} else {
// file exists
let ssh_context = super::ssh_mod::SshContext::new();
// read the token and decrypt, return CratesIoClient
read_token_and_decrypt_return_crate_io_client(ssh_context, encrypted_string_file_path)
read_token_and_decrypt_return_crates_io_client(ssh_context, encrypted_string_file_path)
}
}

Expand Down
Loading

0 comments on commit 08df4ae

Please sign in to comment.