Skip to content

test: demonstrate API key filtering bug with multiple clients#1

Closed
nobbs wants to merge 2 commits intomainfrom
test/api-key-filtering-bug
Closed

test: demonstrate API key filtering bug with multiple clients#1
nobbs wants to merge 2 commits intomainfrom
test/api-key-filtering-bug

Conversation

@nobbs
Copy link
Copy Markdown
Owner

@nobbs nobbs commented Feb 9, 2026

Demonstrates Bug

This PR contains failing tests that prove the API key secret filtering bug exists.

What fails:

  • Unit test: Only client1 is preserved, client2 and client3 are dropped
  • E2E test: Authentication with key2 (client2) fails

Root cause:
The expectedAndFirstFallbackFilter keeps only predefined keys + first key alphabetically. API key secrets use arbitrary client IDs as keys, so all except the first are dropped.

Related:

This PR is for demonstration only. See the fix branch for the solution.

nobbs added 2 commits February 9, 2026 21:38
This test demonstrates the bug where API key secrets with multiple
client IDs are incorrectly filtered, keeping only the first client ID
alphabetically.

Expected: All client IDs (client1, client2, client3) should be preserved
Actual: Only client1 is preserved, client2 and client3 are dropped

Related to envoyproxy#8227
This test would fail with the current implementation because client2
is dropped from the cache (only client1, the first alphabetically, is preserved).

The existing E2E tests only tested client1, which is why the bug
went undetected. This test demonstrates that authentication with
client2 fails due to the filtering bug.
@nobbs nobbs closed this Feb 9, 2026
@nobbs nobbs reopened this Feb 9, 2026
@nobbs nobbs changed the title Test/api key filtering bug Feb 9, 2026
@nobbs nobbs closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant