Skip to content

Commit

Permalink
feat(aqua): pass --verbose flag down to cosign and added aqua.cosign_…
Browse files Browse the repository at this point in the history
…extra_args setting (#4148)
  • Loading branch information
jdx authored Jan 17, 2025
1 parent 2d32a6d commit f1dec69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,13 @@
"description": "Use cosign to verify aqua tool signatures.",
"type": "boolean"
},
"cosign_extra_args": {
"description": "Extra arguments to pass to cosign when verifying aqua tool signatures.",
"type": "array",
"items": {
"type": "string"
}
},
"minisign": {
"default": true,
"description": "Use minisign to verify aqua tool signatures.",
Expand Down
7 changes: 7 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ type = "Bool"
default = true
description = "Use cosign to verify aqua tool signatures."

[aqua.cosign_extra_args]
env = "MISE_AQUA_COSIGN_EXTRA_ARGS"
type = "ListString"
rust_type = "Vec<String>"
optional = true
description = "Extra arguments to pass to cosign when verifying aqua tool signatures."

[aqua.minisign]
env = "MISE_AQUA_MINISIGN"
type = "Bool"
Expand Down
6 changes: 6 additions & 0 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ impl AquaBackend {
let mut cmd = CmdLineRunner::new(cosign_bin)
.arg("verify-blob")
.arg(checksum_path);
if log::log_enabled!(log::Level::Debug) {
cmd = cmd.arg("--verbose");
}
if cosign.experimental == Some(true) {
cmd = cmd.env("COSIGN_EXPERIMENTAL", "1");
}
Expand All @@ -466,6 +469,9 @@ impl AquaBackend {
for opt in cosign.opts(pkg, v)? {
cmd = cmd.arg(opt);
}
for arg in SETTINGS.aqua.cosign_extra_args.clone().unwrap_or_default() {
cmd = cmd.arg(arg);
}
cmd = cmd.with_pr(&ctx.pr);
cmd.execute()?;
} else {
Expand Down

0 comments on commit f1dec69

Please sign in to comment.