Repository navigation
Conversation
Add SandboxClient.from_env(), a disk-free constructor that builds a client entirely from OPENSHELL_* environment variables. It complements the existing $OPENSHELL_GATEWAY + XDG gateway-directory discovery used by from_active_cluster() for callers (CI runners, containers, serverless functions) that inject configuration through the environment rather than the CLI's on-disk gateway directory. Environment variables (all follow the existing OPENSHELL_* convention): - OPENSHELL_ENDPOINT (required): host:port or URL; https selects TLS - OPENSHELL_TOKEN: OIDC access token attached as Bearer to every RPC - OPENSHELL_TLS: force TLS on/off, overriding scheme inference - OPENSHELL_TLS_CA / OPENSHELL_TLS_CERT / OPENSHELL_TLS_KEY: TLS material - OPENSHELL_TIMEOUT: per-call gRPC timeout in seconds - OPENSHELL_CLUSTER_NAME: friendly name for error messages The TLS trust profile mirrors from_active_cluster (full mTLS, CA-only, or system roots). Uses only stdlib os.environ parsing plus the existing TlsConfig validation; no new dependencies. Upstreamed from the internal Astra Sandbox SDK (config.py); contribution O2. Adds unit tests mirroring the existing *_test.py patterns and documents the variables under docs/sandboxes/manage-sandboxes.mdx. Signed-off-by: Dhiraj Bokde <dbokde@nvidia.com>
|
This pull request has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. |
|
A fresh native transport check on this head ( A minimal downstream proposal reattaches brackets only when the parsed hostname contains Reproducible execution receipt and limits: Linux ARM64, Python3.14.8/grpcio1.84.0, generated repository bindings and a real Health-only gRPC service, not a deployed gateway or minimum-version qualification. This is fresh agent-assisted evidence under user direction, not recovery of dot's earlier missing packet. Dhiraj Bokde retains the SDK implementation credit; no competing upstream PR or change to the owner branch. |
Summary
Add
SandboxClient.from_env()as a disk-free configuration path for CI jobs, containers, serverless applications, and other environments that inject gateway settings directly instead of mounting the OpenShell CLI gateway directory.Related Issue
Closes #1817
Changes
OPENSHELL_*variables.host:port, HTTP, and HTTPS endpoint forms with explicit TLS override precedence.from_active_cluster()path for CLI-managed state and refreshable OIDC sessions.Testing
mise run pre-commitpassesmise run python:typecheckpassesmise run test:python(103 tests)Checklist