From 852a0e6fef1ce24aafbe082040e8ea7b5d701f56 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 9 Nov 2023 23:17:40 +0100 Subject: [PATCH 1/7] feat: update smallvec, tokio, tokio-macros --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c727f21..d781ebe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1464,9 +1464,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -1608,9 +1608,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -1627,9 +1627,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", From 41a622e34dc573ffc8b99328be6068fc7559c2cf Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 9 Nov 2023 23:24:00 +0100 Subject: [PATCH 2/7] feat: add job to publish to crates.io --- .github/workflows/release.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f69ff96..4f3621f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,12 +145,12 @@ jobs: keyweave-*.tar.xz keyweave-x86_64-pc-windows-gnu/keyweave.exe - sign: + release: needs: - pre-check - build - name: Checksum and sign + name: Sign and Release runs-on: ubuntu-latest permissions: id-token: write @@ -195,7 +195,6 @@ jobs: github-token: ${{ secrets.PAT_TOKEN }} script: | const sha256sums = ${{ steps.homebrew-inputs.outputs.sha256sums }} - await github.rest.actions.createWorkflowDispatch({ owner: 'bartvdbraak', repo: 'homebrew-keyweave', @@ -205,4 +204,20 @@ jobs: version: '${{ needs.pre-check.outputs.version }}', sha256sums: JSON.stringify(sha256sums) } - }) \ No newline at end of file + }) + + publish: + needs: release + name: Publish crate + runs-on: ubuntu-latest + steps: + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - run: cargo publish --token ${CARGO_REGISTRY_TOKEN} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file From 914c80213a86ca70e77caf80b74487e499200cc1 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Fri, 10 Nov 2023 00:20:36 +0100 Subject: [PATCH 3/7] docs: windows example, prereqs, cargo --- README.md | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f1ee98e..8ed42be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Keyweave -Cluster +Cluster Keyweave is an open-source tool crafted to seamlessly fetch secrets from Azure Key Vault and weave them into a convenient `.env` file. Developed in Rust, Keyweave stands out for its efficiency and user-friendly design, making it an ideal choice for managing your application's secrets. @@ -15,14 +15,25 @@ Keyweave is an open-source tool crafted to seamlessly fetch secrets from Azure K Before diving into Keyweave, ensure you have the following prerequisites: -- **Azure Account**: Log into your Azure tenant and set up the right subscription, along with any Access Policies required for you to read and list secrets from your Key Vault. +- Logged into the right Azure tenant: -```sh -az login --tenant "your-tenant-guid" -az account set --subscription "your-subscription-guid" + ```bash + az login --tenant "your-tenant-guid" + ``` + +- Identity has `Get` and `List` Secret Permissions in the Access Policies of the Key Vault. + +## Installation + +### Cargo + +Keyweave is built with [Cargo](https://doc.rust-lang.org/cargo/), the Rust package manager. It can also be used to install from [crates.io](https://crates.io/crates/keyweave): + +```bash +cargo install keyweave ``` -## Installation (MacOS, Linux) +### Homebrew (MacOS, Linux) For MacOS and Linux systems, installation is a breeze with [Homebrew](https://brew.sh/). Simply run: @@ -31,13 +42,15 @@ brew tap bartvdbraak/keyweave brew install keyweave ``` -## Manual Download +### Manual Download If you prefer manual installation or need binaries for different platforms (including an executable for Windows), visit the [Releases](/releases) page of this GitHub repository. -## Building from Source +```powershell +Invoke-WebRequest -Uri 'https://github.com/bartvdbraak/keyweave/releases/latest/download/keyweave.exe' -OutFile 'keyweave.exe' +``` -Keyweave is built with [Cargo](https://doc.rust-lang.org/cargo/), the Rust package manager. +## Building from Source To build Keyweave from source, follow these steps: @@ -71,6 +84,10 @@ keyweave --vault_name [--output ] [--filter ] keyweave --vault_name my-key-vault --output my-env-file.env --filter my-secret ``` +## Documentation + +Additional documentation for this package can be found on [docs.rs](https://docs.rs/keyweave). + ## License Keyweave is licensed under the GPLv3 License. See [LICENSE](LICENSE) for more details. From fa90ae8a53a7345a63fb2c6415d720c3c5978305 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Fri, 10 Nov 2023 00:23:42 +0100 Subject: [PATCH 4/7] feat: move to `.github` --- renovate.json => .github/renovate.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename renovate.json => .github/renovate.json (100%) diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json From ddb9fac7caa05ac4dcfbc5e91cf522795b4940cd Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Fri, 10 Nov 2023 00:24:19 +0100 Subject: [PATCH 5/7] feat: add standard reviewer --- .github/renovate.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 39a2b6e..7269f0b 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,5 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" - ] -} + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base"], + "reviewers": ["bartvdbraak"] +} \ No newline at end of file From 08466adb0c7b9b3fba6a233e3f7224ebeb212d7d Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Fri, 10 Nov 2023 00:26:01 +0100 Subject: [PATCH 6/7] feat: bump version to 0.2.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d781ebe..de438f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -852,7 +852,7 @@ dependencies = [ [[package]] name = "keyweave" -version = "0.2.1" +version = "0.2.2" dependencies = [ "azure_identity", "azure_security_keyvault", diff --git a/Cargo.toml b/Cargo.toml index 0f95b37..9f979ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "keyweave" -version = "0.2.1" +version = "0.2.2" edition = "2021" authors = ["Bart van der Braak "] From be400c0c50a7d354777291dcaac2efdd71da2558 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Fri, 10 Nov 2023 00:46:36 +0100 Subject: [PATCH 7/7] feat: additional metadata fields --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 9f979ae..4c6f890 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,11 @@ name = "keyweave" version = "0.2.2" edition = "2021" authors = ["Bart van der Braak "] +keywords = ["azure", "keyvault", "env"] +description = "Fetches secrets from Azure Key Vault and weaves them into a convenient .env file" +license = "GPL-3.0" +documentation = "https://docs.rs/keyweave" +repository = "https://github.com/bartvdbraak/keyweave/" [dependencies] azure_identity = "0.17.0"