Skip to content

feat(tool): add security field to mise tool --json#7303

Merged
jdx merged 4 commits intomainfrom
feat/tool-security-info
Dec 15, 2025
Merged

feat(tool): add security field to mise tool --json#7303
jdx merged 4 commits intomainfrom
feat/tool-security-info

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Dec 15, 2025

Summary

  • Add security field to mise tool <name> --json output showing aqua registry security metadata
  • Security field is an array of enabled security features with relevant metadata:
    • checksum (with algorithm)
    • github_attestations (with signer_workflow)
    • slsa
    • cosign
    • minisign (with public_key)
  • For non-aqua backends, returns an empty array []
  • Also displays security info in non-JSON table output

Example Output

For aqua tool with security features:

{
  "backend": "aqua:hashicorp/terraform",
  "security": [
    {
      "type": "checksum",
      "algorithm": "sha256"
    }
  ]
}

For non-aqua tool:

{
  "backend": "core:node",
  "security": []
}

Test plan

  • Added e2e tests verifying security field exists in JSON output
  • Tests verify security field is an array
  • Tests verify non-aqua tools have empty security array
  • Tests verify security features have type field

🤖 Generated with Claude Code


Note

Adds a security array to mise tool <name> --json and table output, populated from aqua registry and core plugins (checksum, gpg, minisign, etc.), with e2e tests.

  • CLI (src/cli/tool.rs)
    • Add security array to mise tool <name> --json and display a "Security:" row in human output.
    • Include security in ToolInfo and render feature labels.
  • Backend API (src/backend/mod.rs)
    • Introduce SecurityFeature enum (checksum, github_attestations, slsa, cosign, minisign, gpg).
    • Extend Backend trait with security_info() (default empty).
  • Aqua backend (src/backend/aqua.rs)
    • Implement security_info() mapping registry fields: checksum(+algorithm), github_attestations(+signer_workflow), slsa, cosign, minisign(+public_key).
  • Core plugins
    • Implement security_info():
      • node: checksum + optional gpg (based on settings).
      • swift: checksum + optional gpg (Linux/settings).
      • zig: checksum + minisign (+public_key).
      • go, deno, bun: checksum only.
  • Tests (e2e/cli/test_tool)
    • Assert security exists and is an array in JSON.
    • Verify core plugin features (node checksum/gpg, go checksum, zig checksum/minisign) and aqua tool presence.

Written by Cursor Bugbot for commit b42dea8. This will update automatically on new commits. Configure here.

Add security information to `mise tool <name> --json` output showing
aqua registry security metadata. The security field is an array of
enabled security features with relevant metadata:

- checksum (with algorithm)
- github_attestations (with signer_workflow)
- slsa
- cosign
- minisign (with public_key)

For non-aqua backends, returns an empty array.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 15, 2025 03:21
@jdx jdx changed the title feat(cli): add security field to mise tool --json feat(tool): add security field to mise tool --json Dec 15, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds security metadata reporting to the mise tool command by including a security field in both JSON and table outputs. The field displays security features enabled in aqua registry tools.

  • Introduces SecurityFeature enum to represent different security verification methods (checksum, GitHub attestations, SLSA, cosign, minisign)
  • Implements security_info() method for aqua backend to fetch and parse security metadata from the aqua registry
  • Extends mise tool command output to include security information in both JSON and human-readable formats

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/cli/tool.rs Adds security field to ToolInfo struct and implements display logic for both JSON and table formats
src/backend/mod.rs Defines SecurityFeature enum and adds security_info() trait method with default empty implementation
src/backend/aqua.rs Implements security_info() for AquaBackend to extract security features from aqua registry metadata
e2e/cli/test_tool Adds e2e tests verifying security field presence, type, and behavior for both aqua and non-aqua tools

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/cli/test_tool
Comment on lines +23 to +26
mise tool aqua:cli/cli --json | jq -e '.security' || fail "security field not found in JSON"

# Test security field is an array
mise tool aqua:cli/cli --json | jq -e '.security | type == "array"' || fail "security is not an array"
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool name 'aqua:cli/cli' is repeated three times. Consider storing it in a variable to improve maintainability and make it easier to change the test tool if needed.

Copilot uses AI. Check for mistakes.
Comment thread e2e/cli/test_tool
mise tool node --json | jq -e '.security == []' || fail "non-aqua tool should have empty security"

# Test that security features have type field when present
mise tool aqua:cli/cli --json | jq -e '.security | if length > 0 then .[0].type else true end' || fail "security feature missing type field"
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool name 'aqua:cli/cli' is repeated three times. Consider storing it in a variable to improve maintainability and make it easier to change the test tool if needed.

Copilot uses AI. Check for mistakes.
autofix-ci Bot and others added 2 commits December 15, 2025 03:29
Extend security field in `mise tool --json` to core plugins:

- node: checksum (sha256) + GPG verification
- zig: checksum (sha256) + minisign (with public key)
- swift: checksum (sha256) + GPG verification (Linux only)
- go, ruby, deno, bun: checksum (sha256)

Also adds Gpg variant to SecurityFeature enum.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 15, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.7 x -- echo 20.3 ± 0.3 19.8 22.9 1.00
mise x -- echo 20.3 ± 0.2 19.8 21.3 1.00 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.7 env 19.8 ± 0.6 19.2 25.3 1.00
mise env 19.9 ± 0.2 19.4 21.2 1.01 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.7 hook-env 19.8 ± 0.3 19.3 24.6 1.00
mise hook-env 19.9 ± 0.3 19.4 22.7 1.00 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.7 ls 16.7 ± 0.3 16.2 19.0 1.00
mise ls 16.8 ± 0.3 16.4 18.7 1.01 ± 0.02

xtasks/test/perf

Command mise-2025.12.7 mise Variance
install (cached) 108ms 108ms +0%
ls (cached) 65ms 66ms -1%
bin-paths (cached) 71ms 71ms +0%
task-ls (cached) 436ms 423ms +3%

@jdx jdx merged commit 056db78 into main Dec 15, 2025
26 checks passed
@jdx jdx deleted the feat/tool-security-info branch December 15, 2025 04:05
jdx pushed a commit that referenced this pull request Dec 15, 2025
### 🚀 Features

- **(conda)** add dependency resolution for conda packages by @jdx in
[#7280](#7280)
- **(go)** add created_at support to ls-remote --json by @jdx in
[#7305](#7305)
- **(hook-env)** add hook_env.cache_ttl and hook_env.chpwd_only settings
for NFS optimization by @jdx in
[#7312](#7312)
- **(hooks)** add MISE_TOOL_NAME and MISE_TOOL_VERSION to
preinstall/postinstall hooks by @jdx in
[#7311](#7311)
- **(shell_alias)** add shell_alias support for cross-shell aliases by
@jdx in [#7316](#7316)
- **(tool)** add security field to mise tool --json by @jdx in
[#7303](#7303)
- add --before flag for date-based version filtering by @jdx in
[#7298](#7298)

### 🐛 Bug Fixes

- **(aqua)** support cosign v3 bundle verification by @jdx in
[#7314](#7314)
- **(config)** use correct config_root in tera context for hooks by @jdx
in [#7309](#7309)
- **(nu)** fix nushell deactivation script on Windows by @fu050409 in
[#7213](#7213)
- **(python)** apply uv_venv_create_args in auto-venv code path by @jdx
in [#7310](#7310)
- **(shell)** escape exe path in activation scripts for paths with
spaces by @jdx in [#7315](#7315)
- **(task)** parallelize exec_env loading to fix parallel task execution
by @jdx in [#7313](#7313)
- track downloads for python and java by @jdx in
[#7304](#7304)
- include full tool ID in download track by @jdx in
[#7320](#7320)

### 📚 Documentation

- Switch `postinstall` code to be shell-agnostic by @thejcannon in
[#7317](#7317)

### 🧪 Testing

- **(e2e)** disable debug mode by default for windows-e2e by @jdx in
[#7318](#7318)

### New Contributors

- @fu050409 made their first contribution in
[#7213](#7213)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants