diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0deff87..04226a9 100755 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,7 +27,7 @@ jobs: - windows-latest toolchain: - - 1.64.0 + - 1.67.0 - stable - nightly @@ -58,13 +58,13 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.64.0 + toolchain: 1.67.0 target: x86_64-unknown-linux-musl profile: minimal override: true - uses: Swatinem/rust-cache@v2 with: - key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.64.0-binary + key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.67.0-binary - name: Install musl tools run: sudo apt-get install -y musl-tools - name: Build @@ -93,12 +93,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.64.0 + toolchain: 1.67.0 profile: minimal override: true - uses: Swatinem/rust-cache@v2 with: - key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.64.0-binary + key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.67.0-binary - name: Build run: cargo build --release - name: Rename @@ -123,12 +123,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.64.0 + toolchain: 1.67.0 profile: minimal override: true - uses: Swatinem/rust-cache@v2 with: - key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.64.0-binary + key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.67.0-binary - name: Build run: cargo build --release - name: Rename diff --git a/CHANGELOG.md b/CHANGELOG.md index dd5dd20..5a743a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log for Amber +## 0.1.5 (2022-12-23) + +* Update rust toolchain to 1.67.0 +* Fix cargo lock file issue causing packaging problem. + ## 0.1.4 (2022-11-29) * Upgrade to clap v4 diff --git a/Cargo.lock b/Cargo.lock index 0f46dc6..5a2965c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ [[package]] name = "amber" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aho-corasick", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index bd06412..d42bcfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "amber" -version = "0.1.4" +version = "0.1.5" authors = ["Michael Snoyman "] edition = "2018" description = "Manage secret values in-repo via public key cryptography" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 10add70..969710a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.64.0" +channel = "1.67.0" diff --git a/src/cli.rs b/src/cli.rs index e9ae4a4..5a15765 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -95,7 +95,7 @@ static VERSION_SHA: Lazy = Lazy::new(|| { let pkgver = env!("CARGO_PKG_VERSION"); match option_env!("VERGEN_GIT_SHA") { None => pkgver.to_owned(), - Some(gitsha) => format!("{} (Git SHA1 {})", pkgver, gitsha), + Some(gitsha) => format!("{pkgver} (Git SHA1 {gitsha})"), } }); @@ -139,7 +139,7 @@ impl Opt { } self.amber_yaml .as_deref() - .with_context(|| format!("No file named {} found", DEFAULT_AMBER_YAML)) + .with_context(|| format!("No file named {DEFAULT_AMBER_YAML} found")) } pub fn find_amber_yaml_or_default(&mut self) -> &Path { diff --git a/src/config.rs b/src/config.rs index d8311b7..2708255 100644 --- a/src/config.rs +++ b/src/config.rs @@ -194,10 +194,7 @@ impl Config { Ok(secret) })() .with_context(|| { - format!( - "Error loading secret key from environment variable {}", - SECRET_KEY_ENV - ) + format!("Error loading secret key from environment variable {SECRET_KEY_ENV}") }) } @@ -215,7 +212,7 @@ impl Config { pub(crate) fn get_secret(&self, key: &str, secret_key: &SecretKey) -> Result { self.secrets .get(key) - .with_context(|| format!("Key does not exist: {}", key)) + .with_context(|| format!("Key does not exist: {key}")) .and_then(|secret| secret.decrypt(secret_key, key)) } } @@ -254,6 +251,6 @@ impl Secret { ); String::from_utf8(plain.to_vec()).context("Invalid UTF-8 encoding") })() - .with_context(|| format!("Error while decrypting secret named {}", key)) + .with_context(|| format!("Error while decrypting secret named {key}")) } } diff --git a/src/main.rs b/src/main.rs index 5f30d27..094a879 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,9 +51,9 @@ fn init(mut opt: cli::Opt, only_secret_key: bool) -> Result<()> { config.save(opt.find_amber_yaml_or_default())?; if only_secret_key { - print!("{}", secret_key); + print!("{secret_key}"); } else { - eprintln!("Your secret key is: {}", secret_key); + eprintln!("Your secret key is: {secret_key}"); eprintln!( "Please save this key immediately! If you lose it, you will lose access to your secrets." ); @@ -104,7 +104,7 @@ fn encrypt(mut opt: cli::Opt, key: String, value: Option) -> Result<()> fn generate(opt: cli::Opt, key: String) -> Result<()> { let value = SecretKey::generate(&mut OsRng); let value = encode_config(value.as_bytes(), base64::URL_SAFE); - let msg = format!("Your new secret value is {}: {}", key, value); + let msg = format!("Your new secret value is {key}: {value}"); encrypt(opt, key, Some(value))?; println!("{}", &msg); Ok(()) @@ -136,7 +136,7 @@ fn print(mut opt: cli::Opt, style: cli::PrintStyle) -> Result<()> { match style { cli::PrintStyle::SetEnv => pairs .iter() - .for_each(|(key, value)| println!("export {}={:?}", key, value)), + .for_each(|(key, value)| println!("export {key}={value:?}")), cli::PrintStyle::Json => { let secrets = to_objs(&pairs); serde_json::to_writer(std::io::stdout(), &secrets)?;