Skip to content

feat(openshell): add endpoint-bound API credentials - #13348

Merged
cv merged 2 commits into
v1from
codex/v1-13313-api-credentials
Oct 16, 2026
Merged

cv merged 2 commits into
v1from
codex/v1-13313-api-credentials

Conversation

@deepujain

@deepujain deepujain commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

A booking service can be reachable from a sandbox while still having no credential resource to authenticate it. openshell_api fills that gap for APIs beyond inference and web search:

resource "openshell_api" "booking" {
  gateway        = data.openshell_gateway.example.ref
  workspace      = openshell_workspace.example.ref
  name           = "booking"
  endpoint       = "https://booking.example.com/mcp"
  credential_env = "BOOKING_API_KEY"
  binaries       = ["/usr/bin/curl"]
}
# Attach openshell_api.booking.ref in the sandbox's providers.

The resource owns its OpenShell profile and registration. It supports Bearer or a named API-key header, binds callers to a host, port and path subtree, and resolves the host variable during apply. Secret values stay out of OpenTofu state and exports.

Updating the credential reference preserves the registration and sandbox. Missing objects recover through the existing composite lifecycle; failed creates retain their established binding. Planning rejects foreign or substituted survivors before recovery can touch them, including when only half the pair remains.

Five OpenTofu contract tests cover creation, unchanged plans without the host secret, stored-key updates, missing-half recovery, failed readbacks, ownership checks, invalid bindings and removal. A profile unit test checks exact IPv4/IPv6 grants and the absence of private-network grants for DNS names. Rejection cases reset a shared fixture before each plan; timing budgets and timeouts are unchanged. cargo ci --full passed on macOS ARM64: 1,478 ordinary tests, doctests, schema checks, a fresh bundle and 151 lifecycle tests. OpenShell contract timing overruns were reported-only. The final Node 24.21.0 Fern check passed with no errors and one warning.

Hosted native CI passed all four platforms and Docker/kind on both Linux architectures. Each Linux OpenShell contract suite finished at 173.8 seconds under the unchanged 190-second budget. Documentation validation and preview passed.

This is the provider slice of #13313. examples/hcl/travel-team is absent from v1; live booking-service authentication and credential propagation to an already-running client remain unqualified. The issue stays open.

@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown
Contributor

@deepujain
deepujain marked this pull request as ready for review October 16, 2026 15:52
@cv
cv merged commit 3e49a28 into v1 Oct 16, 2026
@cv
cv deleted the codex/v1-13313-api-credentials branch October 16, 2026 23:30
@cv cv added the v1 NemoClaw v1 branch label Oct 16, 2026
cv added a commit that referenced this pull request Oct 17, 2026
## Why

Every provider contract test copied its providers into a fresh OpenTofu
workspace. On macOS, the first launch of each fresh copy waits about
0.65 s for verification, so most of the local contract-test time went to
copying and verifying. A symlinked provider starts in about 0.01 s.

This does **not** fix the linux_amd64 `openshell-provider::contract`
budget failure (#13376, #13348). This PR's CI showed no Linux change:

| Binary | linux_amd64 before | linux_amd64 after | linux_arm64 before |
linux_arm64 after |
|---|---|---|---|---|
| `openshell-provider::contract` | 182.4 s | 186.6 s | 175.9 s | 172.2 s
|
| `nemoclaw-provider::contract` | 55.9 s | 59.8 s | 50.3 s | 48.4 s |
| `fabric-provider::contract` | 34.3 s | 31.8 s | 36.7 s | 30.5 s |

"Before" is run 38988429435 attempt 3 (#13378); "after" is this PR's
first run.

## Change

On Unix, `TofuWorkspace` links each provider into the workspace instead
of copying it. Windows still copies: providers there must find the SSH
relay beside them.

## Validation

Local, macOS arm64, `--test-threads=4`:

| Suite | Copy | Symlink |
|---|---|---|
| `openshell-provider` contract (62 tests) | 45.4 s | 11.9 s |
| `nemoclaw-provider` contract (26 tests) | 22.1 s | 11.2 s |
| `fabric-provider` contract (4 tests) | 6.8 s | 3.3 s |

Also ran `cargo fmt --all --check`, Clippy for `nemoclaw-test-fixtures`,
and the `nemoclaw-test-fixtures` tests.
@wscurran wscurran added area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality security and removed security labels Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants