From b719085de61458b914b04ee736e47d4ec5623225 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Sun, 23 Nov 2025 11:20:51 +0100 Subject: [PATCH 1/3] Support AZURE_TRUSTED_SIGNING_ACCOUNT_NAME, AZURE_CERTIFICATE_PROFILE_NAME --- READMe.md | 8 +++++--- src/main.rs | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/READMe.md b/READMe.md index 1da0453..38e35f6 100644 --- a/READMe.md +++ b/READMe.md @@ -18,9 +18,11 @@ A simple CLI tool to sign files with Trusted Signing The CLI expects the following environment variables to be set or you can pass them as arguments. You need to create an Azure App Registration (you can use [this](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory) article to get the credentials): -- `AZURE_CLIENT_ID` -- `AZURE_CLIENT_SECRET` -- `AZURE_TENANT_ID` +- `AZURE_CLIENT_ID` (or use `--azure-client-id`) +- `AZURE_CLIENT_SECRET` (or use `--azure-tenant-id`) +- `AZURE_TENANT_ID` (or use `--azure-tenant-id`) +- `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME` (or use `--account/-a`) +- `AZURE_CERTIFICATE_PROFILE_NAME` (or use `--certificate/-c`) Signing a single file: `trusted-signing-cli -e -a -c file1.exe` diff --git a/src/main.rs b/src/main.rs index 628daaa..7c60270 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,12 +60,20 @@ struct Args { #[arg(long, short = 'e', verbatim_doc_comment)] endpoint: String, - /// Code Signing Account name - #[arg(long, short = 'a')] + /// Trusted Signing Account name + #[arg( + long, + env = "AZURE_TRUSTED_SIGNING_ACCOUNT_NAME", + short = 'a' + )] account: String, /// Certificate Profile name - #[arg(long, short = 'c')] + #[arg( + long, + env = "AZURE_CERTIFICATE_PROFILE_NAME", + short = 'c' + )] certificate: String, /// File digest algorithm @@ -107,6 +115,7 @@ async fn main() { } async fn run(args: Args) -> Result<(), String> { + dbg!(&args); if fs::metadata(&args.azure_cli_path).is_err() { Err(format!( "azure cli {} does not exists, please specify PATH with env AZURE_CLI_PATH", From a781338d3e6c8745d7ba07746219583415efbbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rik=20Levente?= <33373714+Levminer@users.noreply.github.com> Date: Sun, 23 Nov 2025 14:28:38 +0100 Subject: [PATCH 2/3] Update src/main.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7c60270..71eeb4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,7 +115,6 @@ async fn main() { } async fn run(args: Args) -> Result<(), String> { - dbg!(&args); if fs::metadata(&args.azure_cli_path).is_err() { Err(format!( "azure cli {} does not exists, please specify PATH with env AZURE_CLI_PATH", From 63d240bd9c1c4fd125780623b6a1bcfa8cbe6564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rik=20Levente?= <33373714+Levminer@users.noreply.github.com> Date: Sun, 23 Nov 2025 14:31:26 +0100 Subject: [PATCH 3/3] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- READMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/READMe.md b/READMe.md index 38e35f6..1243543 100644 --- a/READMe.md +++ b/READMe.md @@ -19,7 +19,7 @@ A simple CLI tool to sign files with Trusted Signing The CLI expects the following environment variables to be set or you can pass them as arguments. You need to create an Azure App Registration (you can use [this](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory) article to get the credentials): - `AZURE_CLIENT_ID` (or use `--azure-client-id`) -- `AZURE_CLIENT_SECRET` (or use `--azure-tenant-id`) +- `AZURE_CLIENT_SECRET` (or use `--azure-client-secret`) - `AZURE_TENANT_ID` (or use `--azure-tenant-id`) - `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME` (or use `--account/-a`) - `AZURE_CERTIFICATE_PROFILE_NAME` (or use `--certificate/-c`)