Skip to content

fix(e2e): align integration harness with hardened verifier behavior#90

Merged
OkeyAmy merged 1 commit into
mainfrom
fix/e2e-align-with-hardening
Jun 15, 2026
Merged

fix(e2e): align integration harness with hardened verifier behavior#90
OkeyAmy merged 1 commit into
mainfrom
fix/e2e-align-with-hardening

Conversation

@OkeyAmy

@OkeyAmy OkeyAmy commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

The E2E test suite was broken after the security hardening PRs (#81, #83) because the test harness predated two now-enforced protections:

  1. Destination binding is fail-closed (F-014): An invocation that names a tool_server is now rejected with TOOL_SERVER_MISMATCH unless the verifier claims a matching SERVER_IDENTITY. The compose file set no identity, so every bundle that bound a tool_server failed verification — 6 of 8 test failures across happy path, body binding, middleware, and replay checks.

  2. Admin endpoint rate limiting: /admin/revoke has its own deliberately tight limiter (1 req/s per IP, burst 1) as a non-configurable security default. Back-to-back admin tests tripped it on the second request: 429 instead of 200.

Changes

  • docker-compose.test.yml: Set SERVER_IDENTITY=did:key:z6MkTool to match test bundle identities
  • e2e.test.mjs:
    • Align happy-path toolServer DID from placeholder to did:key:z6MkTool
    • Add 1.1s delay between admin tests to let rate limiter refill
    • Import sleep helper
  • util.mjs: Add sleep(ms) utility

Test plan

  • Full E2E suite runs green: 14/14 tests pass
  • E2E via run.sh (docker-compose, Redis-backed nonce store) — full cycle working
  • No production code changes — test harness only

Production code is unchanged and correct; the harness is updated to align with the stricter post-hardening behavior.

The E2E suite broke after the security hardening (#81/#83) because the
test harness predated two now-enforced protections:

1. Destination binding is fail-closed (F-014). An invocation that names a
   tool_server is now rejected with TOOL_SERVER_MISMATCH unless the verifier
   claims a matching SERVER_IDENTITY. The compose file set no identity, so
   every bundle that bound a tool_server failed verification — 6 of 8 failures
   (happy path, body binding, middleware, replay). Fix: set
   SERVER_IDENTITY=did:key:z6MkTool and align the one happy-path bundle that
   still used the old placeholder DID to the same identity.

2. /admin/revoke has its own tight limiter (1 req/s per IP, burst 1) — a
   deliberate, non-configurable security default. The two back-to-back admin
   tests tripped it: the second got 429 instead of 200. Fix: wait one refill
   window between them.

Production code is unchanged and correct; only the test harness is updated to
match the stricter behavior. Full suite now green: 14/14.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The changes correctly fix the E2E test suite to align with the security hardening introduced in PRs #81 and #83. All modifications are test-only and properly address the two identified issues:

  1. Destination binding fix: The SERVER_IDENTITY configuration and corresponding toolServer DID updates ensure tests pass fail-closed verification
  2. Rate limiting workaround: The sleep() utility and 1.1s delay prevent 429 errors from the admin endpoint's rate limiter

The implementation is correct and no issues block merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@OkeyAmy OkeyAmy merged commit ebaa37c into main Jun 15, 2026
9 checks passed
@OkeyAmy OkeyAmy deleted the fix/e2e-align-with-hardening branch June 15, 2026 09:51
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.

1 participant