feat: read-only Vault references for externally managed provider credentials
还没有人认领这个 Issue。
评估
调研方向
Start in crates/openshell-driver-vault/src/lib.rs, where managed_secret_path and validate_managed_secret_path restrict every credential to the openshell/provider-credentials layout and handles use the v1:<logical_path> form. Read api_path_for_reference from #5818 to see how api_path_prefix is applied to reads. Done means a read-only reference resolves through the driver, is never written or deleted, and fails closed on a missing path, which needs a design decision on the config surface first.
由索引模型根据 Issue 内容生成。
描述
User Story
I run OpenShell gateways against an enterprise HashiCorp Vault where a separate publishing system owns and rotates secret values. I need OpenShell providers to consume those existing Vault secrets read-only, so sandboxes always use the current published value while Vault remains the single source of truth.
Problem Statement
The Vault credential driver is a gateway-owned storage backend: credential values are written to a managed path (openshell/provider-credentials/<hash>) derived from workspace/provider/credential identity, and any other logical path is rejected. There is no way to point a provider credential at an existing Vault path and have the gateway read it in place.
Impact / Why This Matters
- To use a value already published to Vault, operators must read it out and re-enter it through
provider create/update. The secret then exists in two places, and the OpenShell copy goes stale whenever the publishing system rotates it; every rotation requires a manual re-sync. - In storage-only mode the Vault driver adds little over the built-in encrypted database credential store: if OpenShell only stores values it was handed, the database is equally safe. The value of Vault integration in an enterprise is consuming centrally governed secrets — rotation, audit, and access policy stay in Vault, and OpenShell is a consumer, not a second owner.
- This blocks adoption for deployments where Vault is populated by an external secret-publishing pipeline, which is a common enterprise pattern.
Proposed Design
A provider credential can be declared as a read-only reference to an existing Vault secret instead of an OpenShell-stored value:
- The reference names the secret location (mount, path, field; KV v1 and v2) and resolves through the configured driver address, including
api_path_prefix(#5818). - The gateway reads the referenced value when supplying the credential to a sandbox. It never writes or deletes the referenced secret; the external publishing system remains the owner.
- Rotations performed by the external system are picked up without operator action, either at credential supply time or on the existing credential refresh cadence.
- A missing or unreadable referenced path fails closed with an actionable error; no stale or empty value is injected.
- Deleting the provider removes only the reference, never the external secret.
Suggested UX
Notional, for human review:
openshell provider create --name corp-api --type corp-api \
--credential-ref API_TOKEN=vault://secret/myapp/token#value
provider get shows the reference (mount/path/field), not the value. The exact configuration surface (CLI flag, provider config key, or driver-level mapping) is open for discussion.
Acceptance Criteria
- A provider credential can reference an existing Vault KV path (v1 and v2) without OpenShell writing to that path.
- A sandbox attached to the provider receives the current Vault value through normal placeholder resolution, including deployments with
api_path_prefixset. - After the external system updates the value, subsequent credential supply reflects the update without operator action.
- Missing or unreadable referenced paths fail closed with an actionable error.
- Provider deletion leaves the external secret untouched.
Alternatives Considered
- Static provider plus manual re-sync on rotation: works today, but duplicates the secret, breaks the single source of truth, and the operational cost grows with rotation frequency.
- Built-in database credential store: equally secure for storage, but has the same copy-and-sync problem and does not consume Vault-governed secrets.
- Custom network middleware fetching from Vault per request: would re-implement Vault auth, caching, and failure handling outside the credential model, and bypasses provider/placeholder semantics and endpoint binding.
- A new credential refresh strategy that reads external KV: a plausible supply mechanism for this feature rather than a separate alternative; the user-facing requirement is the read-only reference itself.
Agent Investigation
crates/openshell-driver-vault/src/lib.rs:managed_secret_pathderivesopenshell/provider-credentials/<sha256[..40]>from workspace/provider_id/provider_name/credential_key/object_id;validate_managed_secret_pathrejects any other logical path. Handles arev1:<logical_path>. Store/read/delete all operate on this managed layout.- The shared URL builder from #5818 (
api_path_for_reference) already appliesapi_path_prefixto reads, so reference reads can reuse it unchanged. - The server's provider refresh worker (
provider_refreshsweep) is an existing cadence a periodic reference re-read could hook into. - Verified on a live deployment (gateway
0.1.7-api-prefix, enterprise-style prefix/v1/bu-a/): the managed write/read/delete lifecycle works end-to-end through the prefix; the gap is purely the absence of a read-only external reference mode.
Related: #5818, #5871, #5709.
- 主要语言
- Rust
- 星标
- 21.5k
- 派生
- 2.1k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 86/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 78/100
-
bug: Ready=False/PodTerminating is treated as a terminal sandbox failure可能已有人在做 @TaylorMutch 于 9 天前认领。 未关闭state:accepted state:pr-opened
难度 2/5 1-3 小时 新手友好度 78/100
-
state:triage-needed
难度 1/5 1-3 小时 新手友好度 78/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 62/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
autofixer: follow-up
难度 2/5 1-3 小时 新手友好度 78/100
tursodatabase/turso#12531 ·
维护者通常 1 天内回复
-
bug help wanted ui
难度 2/5 1-3 小时 新手友好度 82/100
userFRM/egui-charts#4292 ·
维护者通常 1 天内回复
-
Issue-Bug Need-Review
难度 1/5 1-3 小时 新手友好度 85/100
PowerShell/DSC#1832 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复