Skip to content

test(e2e): add secret manager lanes for HashiCorp Vault and CyberArk Conjur - #42503

Merged
yujonglee-berri merged 6 commits into
mainfrom
e2e-secret-manager
Sep 23, 2026
Merged

yujonglee-berri merged 6 commits into
mainfrom
e2e-secret-manager

Conversation

@yujonglee-berri

@yujonglee-berri yujonglee-berri commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds tests/e2e/secret_manager/ against the actual hashicorp/vault:1.20 and cyberark/conjur:1.24 containers. The Vault and Conjur test clients call each manager's HTTP API to write and read secrets. SecretStore is their shared typing interface, not a mock store

What it covers

Four behaviors, none of which mention a backend: a deployment key resolves from the manager, the value the manager holds is the one used, a generated virtual key is written to the manager, and a deleted one is removed from it

The proxy's own environment never holds the seeded secret, so a deployment can only get its key from the manager: the runner holds OPENAI_API_KEY and the tests copy it in under a fresh name per test, which rules out the os.environ fallback get_secret takes when the manager errors

Shape

key_management_system is global to a proxy, so each backend is its own lane against its own proxy. E2E_SECRET_MANAGER=<system> both opts the suite in and names the backend; the proxy boots from gateway/secret_manager_<system>_ci_config.yml, and the tests reach the same manager through that backend's SecretStore

A backend declares its capabilities, and a test that needs one carries @pytest.mark.requires_capability(...), so it is deselected rather than failed or skipped where it does not apply. CyberArk's proxy-side delete returns not_supported and Conjur keeps the key, so the delete test runs only on the Vault lane

Adding a backend touches no test and no marker: a store module, a registry entry, a lane config, and an up_<system> in secret_manager/backend.sh, which runs any backend in Docker and writes the proxy's and the tests' env. A half-added backend shows up when its lane runs, since tests/e2e allows no unit tests

Buildkite steps for both lanes: BerriAI/project-releaser#263

Testing

Against real containers (hashicorp/vault:1.20, cyberark/conjur:1.24):

  • Each store round-trips write, overwrite with non-ASCII, read, absent read and idempotent destroy, and fails clearly on a wrong credential
  • Each store cross-checked against litellm's own manager class both ways: the manager reads what the store seeds, and the store reads what the manager writes
  • Collection: 4 tests on Vault, 3 on CyberArk with the delete test deselected, 0 with the opt-in unset

make lint-e2e-basedpyright is clean; ruff, the raw-requests check, the coverage registry tests, the strict collector and the e2e-changed gate tests all pass

Not run: the full proxy lane. Both managers are enterprise-gated and need LITELLM_LICENSE, and one test needs a real OPENAI_API_KEY; neither was available locally. The cross-checks above exercise the manager classes in-process instead

key_management_system had no end-to-end coverage: the Rust crates and the
Python unit tests all run against mocked managers. This adds a secret_manager
suite that drives a proxy configured with hashicorp_vault against a real Vault.

The tests seed a fresh secret name per test with the runner's OPENAI_API_KEY and
register a deployment pointing at os.environ/<name>. The proxy's env never holds
that name, so get_secret's os.environ fallback cannot mask a broken manager, and
a bogus value in Vault must come back as the provider's 401. Virtual keys are
checked written to and removed from Vault under prefix_for_stored_virtual_keys.

The setting is global to the proxy, so the lane has its own config and the
secret_manager_vault opt-in marker, and stays out of the per-PR selector.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

One marker and opt-in (secret_manager / E2E_SECRET_MANAGER=<system>) pick the
backend from secret_backends.BACKENDS. The tests reach the manager through a
SecretStore protocol, and each backend contributes a secret_store_<system>.py
module, a registry entry, and gateway/secret_manager_<system>_ci_config.yml.
requires_capability deselects tests a backend cannot support (CyberArk does
not delete), and test_secret_backends.py checks every lane config against its
backend without a live stack.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds cyberark as the second secret_manager backend: a Conjur store over its
REST API (policy-declared variables, raw-text values, policy-patch teardown),
its lane config, and a registry entry without deletes_stored_keys, since the
proxy's CyberArk delete answers not_supported and Conjur keeps the key.

secret_manager/backend.sh up|down <system> boots any backend in Docker and
writes proxy.env and tests.env, so every lane runs the same way; the registry
test checks the script boots exactly the registered backends. e2e_http gains
send_text_external for APIs that speak raw text rather than JSON.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@yujonglee-berri yujonglee-berri changed the title test(e2e): add a HashiCorp Vault secret manager lane test(e2e): add secret manager lanes for HashiCorp Vault and CyberArk Conjur Sep 22, 2026
@yujonglee-berri
yujonglee-berri marked this pull request as ready for review September 22, 2026 18:57
@yujonglee-berri
yujonglee-berri requested a review from a team September 22, 2026 18:57

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The secret-manager lanes appear sound, but the PR should not merge until the newly excluded LangSmith test has an actual CI execution path.

Findings

  1. P1 LangSmith Test Never Runs ▶

Summary

Adds backend-agnostic live E2E coverage for gateway secret-manager integration with HashiCorp Vault and CyberArk Conjur.

  • Introduces backend stores, capability-based test selection, and Docker setup for both managers.
  • Covers deployment-secret resolution and virtual-key storage/deletion behavior.
  • Adds gateway configurations, coverage-registry entries, contributor guidance, and shared external HTTP support.
  • Fixes the previously reported fixture shape and credential-file handling issues.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

Comment thread tests/e2e/secret_manager/conftest.py Outdated
Comment thread tests/e2e/secret_manager/backend.sh Outdated
Comment thread tests/e2e/secret_manager/test_secret_backends.py Outdated
Comment thread tests/e2e/secret_manager/backend.sh Outdated
…ess review

The shared resources fixture reads client.proxy, so a bare ProxyClient errored every
live test at setup. backend.sh now writes its env under a per-user directory with
umask 077, the markerless unit tests are gone per tests/e2e/AGENTS.md, and routine
comments are trimmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	.github/e2e-stack/select_tests.py
@yujonglee-berri

Copy link
Copy Markdown
Contributor Author

@greptile-apps wdyt

Comment thread .github/e2e-stack/select_tests.py
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@yujonglee-berri
yujonglee-berri merged commit 630c462 into main Sep 23, 2026
93 of 96 checks passed
@yujonglee-berri
yujonglee-berri deleted the e2e-secret-manager branch September 23, 2026 01:02

This branch is waiting to be deployed

1 waiting deployment
e2e-changed — b4f98963 Waiting Sep 22, 2026 by devin-ai-integration[bot] via Run changed e2e tests against the stage-mirror stack #9883
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.

2 participants