fix(gateway): report invalid OCI env values #206

Merged
jwilger merged 3 commits from issue-149-oci-env-errors into main 2026-05-15 10:31:19 -07:00
Owner

Summary

  • distinguish non-Unicode embedded OCI env values from missing variables
  • add regression coverage for packaged path and inner gateway allowlist env retrieval failures
  • remove the context-mode Pi package per session permission-bypass concern

Verification

  • nix develop -c cargo test -p ar-gateway embedded_oci_gateway_reports_non_unicode -- --nocapture
  • nix develop -c cargo clippy -p ar-gateway --all-targets -- -D warnings
  • nix develop -c cargo fmt --all -- --check

Closes #149.

## Summary - distinguish non-Unicode embedded OCI env values from missing variables - add regression coverage for packaged path and inner gateway allowlist env retrieval failures - remove the context-mode Pi package per session permission-bypass concern ## Verification - `nix develop -c cargo test -p ar-gateway embedded_oci_gateway_reports_non_unicode -- --nocapture` - `nix develop -c cargo clippy -p ar-gateway --all-targets -- -D warnings` - `nix develop -c cargo fmt --all -- --check` Closes #149.
Remove the context-mode project package after it allowed command permission bypass in the active Pi session.
fix(gateway): report invalid OCI env values
Some checks failed
CI / Verify PR with nix flake check (pull_request) Has been cancelled
CI / Publish PR artifact packages (pull_request) Has been cancelled
CI / Request auto_review semantic review (pull_request) Has been cancelled
CI / Build PR artifacts (no token) (pull_request) Has been cancelled
f332e2e76e
Distinguish non-Unicode embedded OCI launcher env values from missing variables so operator diagnostics name the invalid env var without echoing its value.

RED: nix develop -c cargo test -p ar-gateway embedded_oci_gateway_reports_non_unicode_packaged_path_env_as_invalid -- --nocapture
GREEN: nix develop -c cargo test -p ar-gateway embedded_oci_gateway_reports_non_unicode -- --nocapture
Verification: nix develop -c cargo clippy -p ar-gateway --all-targets -- -D warnings; nix develop -c cargo fmt --all -- --check

Closes #149.
chore: ignore nested tool caches
All checks were successful
CI / Verify PR with nix flake check (pull_request) Successful in 2m34s
CI / Request auto_review semantic review (pull_request) Successful in 1s
CI / Build PR artifacts (no token) (pull_request) Successful in 2s
CI / Publish PR artifact packages (pull_request) Successful in 1s
auto_review auto_review: no findings
bceb48877a
Ignore nested .dependencies and .pi-lens directories created by tool invocations outside the repository root.
auto-review left a comment

The PR introduces a mechanism to handle non-Unicode environment variables for OCI setups, ensuring they are reported as invalid. It also adds tests to verify this behavior and removes a potentially risky package. The changes appear safe to merge.

Walkthrough

  • crates/ar-gateway/src/startup.rs:
    • Introduced read_env_var_for_oci to handle environment variable retrieval, distinguishing between missing and non-Unicode values.
    • Updated inner_gateway_process_env_from_lookup to use the new function, improving error handling for non-Unicode values.
  • crates/ar-gateway/tests/embedded_oci_env.rs:
    • Added tests to ensure non-Unicode environment variables are correctly reported as invalid, preventing potential misconfigurations.
  • .pi/settings.json:
    • Removed the context-mode package, addressing a session permission-bypass concern.
The PR introduces a mechanism to handle non-Unicode environment variables for OCI setups, ensuring they are reported as invalid. It also adds tests to verify this behavior and removes a potentially risky package. The changes appear safe to merge. ## Walkthrough - **crates/ar-gateway/src/startup.rs**: - Introduced `read_env_var_for_oci` to handle environment variable retrieval, distinguishing between missing and non-Unicode values. - Updated `inner_gateway_process_env_from_lookup` to use the new function, improving error handling for non-Unicode values. - **crates/ar-gateway/tests/embedded_oci_env.rs**: - Added tests to ensure non-Unicode environment variables are correctly reported as invalid, preventing potential misconfigurations. - **.pi/settings.json**: - Removed the `context-mode` package, addressing a session permission-bypass concern.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!206
No description provided.