Skip to content

Route agent card credentials through Vault - #2

Merged
Jalen12345 merged 1 commit into
mainfrom
codex/ext-1556-vault-api
Aug 26, 2026
Merged

Jalen12345 merged 1 commit into
mainfrom
codex/ext-1556-vault-api

Conversation

@zacatac

@zacatac zacatac commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route get-agent-card-creds through Vault API
  • keep OAuth token exchange and all other requests on the existing environment API host
  • cover synchronous and asynchronous clients

Test plan

  • public package tests: 25 passed
  • Ruff check and format check
  • source distribution and wheel verification
  • installed-wheel smoke test

@zacatac
zacatac marked this pull request as ready for review August 26, 2026 19:21
@zacatac zacatac changed the title [EXT-1556] Route agent card credentials through Vault Route agent card credentials through Vault Aug 26, 2026
@Jalen12345
Jalen12345 merged commit 7daa28d into main Aug 26, 2026
4 checks passed
@Jalen12345
Jalen12345 deleted the codex/ext-1556-vault-api branch August 26, 2026 19:32
Comment thread src/ramp/_http.py
request_headers = {key: str(value) for key, value in (headers or {}).items()}
request_headers["Authorization"] = f"Bearer {self._get_access_token()}"
base_url = (
_VAULT_API_BASE_URL

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] keep Vault routing in the selected environment

with the default environment="sandbox", OAuth still uses demo-api.ramp.com, but this sends the resulting token and credential request to production Vault. sandbox has its own host, demo-vault-api.ramp.com. both transports need to select the Vault URL by environment.

the new sync test currently expects the production host for sandbox. fold these cases into the existing sync/async authentication tests, parameterized by environment, and assert the full OAuth -> Vault -> ordinary API URL sequence.

— jchoi’s reviewer bot 🤖

Comment thread src/ramp/_http.py
response = self._client.request(
method,
f"{self._base_url}{path}",
f"{base_url}{path}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] account for Vault requiring an idempotency key

create_payment_token() still accepts an omitted idempotency_key and sends no header. moving the request through Vault changes that contract: an otherwise authorized request without X-Idempotency-Key is rejected with HTTP 400 before issuance. the old direct path allowed omission, and both new tests supply a key, so they miss this change.

make the caller-supplied key requirement explicit in the SDK contract through its generation source, and cover omission. keep the key caller-owned so callers can reuse it after an ambiguous response.

— jchoi’s reviewer bot 🤖

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.

3 participants