Repository navigation
test: cover fail-closed middleware in the docker-dummy live case - #14515
Conversation
The `docker-dummy` live case now shows that a `fail_closed` middleware binding blocks a request when the middleware service errors, so the destination never receives it. The live guard answers requests to `/fail` with a service error. The sandbox sends that request last, after the allow, deny and excluded requests. The sandbox must get a 403, the middleware must be called at least once for `/fail`, and the recorder must not see it. Part of #14338. Follows #14343 and #14441. Signed-off-by: Deepak Jain <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Authoring session — opening
|
|
@coderabbitai review |
Action performed
|
|
No actionable comments were generated in the recent review. WalkthroughThe middleware fixture returns an internal service error for ChangesFail-closed middleware error coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Possibly related issues
Suggested reviewers: Merge Risk:
|
The
docker-dummylive case now checks that afail_closedmiddleware binding blocks a sandbox request when the middleware service fails.Problem
Part of #14338.
#14343 let explicit sandbox policies carry OpenShell middleware bindings, and #14441 made the
docker-dummylive case check allow, deny and excluded-destination effects. Nothing in a live run made the middleware service fail, so the issue's last live criterion, that the configured failure behavior applies when the service fails, was untested. The case's binding setson_error: fail_closed, so a broken guard should stop traffic, not let it through. If OpenShell let the request through or NemoClaw dropped the setting, no test would notice.Change
nemoclaw-test-fixturesanswers a request to/failwith a service error, after recording it as it does for every request.middlewarerun block indocker-dummy.tftest.hclsends a fourth request, to/fail, last, so no later request depends on how the supervisor treats a failed service. It must return 403./fail; the count is a floor because OpenShell may call a failing service more than once. The recorder must still see only/allowand/bypass, so neither the denied nor the failed request arrives.fail_openrun. It needs a second binding on a different destination, and the case has only the two addresses it already uses. The provider's unit tests already treat a change ofon_errortofail_openas drift.Beyond CI
I did not run
cargo ci live-docker: this environment has no reachable Docker daemon and cannot fetch the OpenShell dependencies, so the Rust crate was not built here either. What I ran:rustfmt --checkon the changed Rust file,tofu fmt -checkon the test file, and the new HCL conditions evaluated with OpenTofu against a sample effects file. Per OpenShell's source at the pinned revision, a failed fail-closed middleware gets the same 403 as a denial, so the new/failassertions rest on that reading until the live Docker lane runs them.Summary by CodeRabbit
Documentation
Tests