Skip to content

feat(env): add JSON allowlist output#343

Open
ychampion wants to merge 1 commit into
h5i-dev:mainfrom
ychampion:feat-env-allow-json
Open

feat(env): add JSON allowlist output#343
ychampion wants to merge 1 commit into
h5i-dev:mainfrom
ychampion:feat-env-allow-json

Conversation

@ychampion

Copy link
Copy Markdown
Contributor

Summary

  • add a list-only h5i env allow --json view with the allowlist path and normalized rules
  • reject JSON with add/remove forms and preserve host-only policy boundaries
  • cover stored, empty, conflicting, and in-box cases

Why

The env command family is otherwise scriptable, but auditing persistent egress grants requires parsing styled text. This adds stable JSON without changing add/remove or default listing behavior.

Closes #339.

Validation

  • cargo test --test env_integration env_allow_add_list_remove_and_in_box_refusal -- --nocapture — passed
  • cargo clippy --all-targets --all-features -- -D warnings — passed
  • cargo build --all-targets — passed
  • ./scripts/gen_man.sh — passed
  • python3 scripts/gen_manual.py — passed

Constraint: Preserve styled listing and add/remove behavior while keeping host policy unreadable from an env box.
Rejected: Reuse the styled output | Automation requires stable field names and valid JSON-only stdout.
Confidence: high
Scope-risk: narrow
Directive: Keep future allowlist output fields backward compatible for scripts.
Tested: focused red-to-green env integration test; strict all-target/all-feature Clippy; all-target build; generated man and HTML checks.
Not-tested: Eight unrelated process-tier integration cases cannot access their temporary worktrees in this container.
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.

Add --json to the h5i env allow list view

1 participant