Skip to content

Commit 8d67250

Browse files
authored
fix(providers): keep refresh credential handles stable (#2780)
* fix(providers): keep refresh credential handles stable Signed-off-by: Mrunal Patel <mrunalp@gmail.com> * fix(providers): protect refresh-owned credentials Signed-off-by: Mrunal Patel <mrunalp@gmail.com> --------- Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
1 parent 600bbae commit 8d67250

16 files changed

Lines changed: 1629 additions & 79 deletions

File tree

‎.agents/skills/openshell-cli/SKILL.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ openshell provider refresh rotate my-outlook --credential-key MS_GRAPH_ACCESS_TO
180180

181181
Prefer `--secret-material-env KEY[=ENVVAR]` for secret refresh material. `--material KEY=VALUE` is for non-secret material; `--secret-material-key` marks supplied material keys as secret.
182182

183+
Gateway-managed refresh credentials use an identity-stable workload handle.
184+
Routine automatic refresh and `provider refresh rotate` update the access token
185+
behind that handle, so long-running processes do not need to restart. Running
186+
processes must be restarted once when upgrading from revision-scoped
187+
placeholders. A later `provider refresh configure` call is an explicit
188+
reauthorization boundary: it revokes the previous handle, and processes holding
189+
that handle fail closed until restarted.
190+
191+
While gateway-managed refresh is configured, `provider update --credential`
192+
cannot replace or delete the refresh-owned primary credential or any co-minted
193+
output. Use `provider refresh rotate`, reconfigure refresh, or delete refresh
194+
before returning those keys to manual management. Unrelated provider fields
195+
remain updateable.
196+
183197
---
184198

185199
## Workflow 3: Sandbox Lifecycle

‎architecture/sandbox.md‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ partially active or last-known-good static set. Invalid metadata preserves the
8787
supplied dynamic snapshot, while a fetch failure preserves the currently active
8888
dynamic snapshot.
8989

90+
Gateway-managed refresh credentials use an opaque workload handle derived from
91+
the sandbox, provider identity, credential key, refresh authorization epoch,
92+
and canonical endpoint boundary. The handle remains stable while the gateway
93+
rotates the short-lived value, so an already-running process keeps one
94+
placeholder and each request resolves against the current token. Explicit
95+
refresh reconfiguration, provider replacement or detachment, and endpoint
96+
boundary changes produce a new handle and revoke the old one. Supervisors do
97+
not retain old values for these handles. Public provider updates cannot replace
98+
or delete the refresh-owned primary credential or co-minted outputs; internal
99+
CAS rotation and explicit refresh lifecycle operations own those values.
100+
Unmanaged static credentials retain the bounded revision-generation behavior.
101+
90102
Route selection and policy evaluation use a syntax-only redacted request target;
91103
they do not materialize real credentials. Cross-endpoint placeholder use returns
92104
HTTP 403. After a WebSocket upgrade it closes the connection with policy
@@ -258,8 +270,10 @@ when policy allows the target endpoint. For GCP providers, a loopback metadata
258270
server inside the network namespace serves placeholders to SDKs that bypass the
259271
proxy (e.g. Go's `cloud.google.com/go/compute/metadata`). Secrets must not be
260272
logged in OCSF or plain tracing output. The supervisor uses revision-scoped
261-
placeholders for rotating provider credentials; provider environment keys
262-
beginning with `v<digits>_` are reserved for that placeholder namespace.
273+
placeholders for unmanaged rotating credentials and identity-stable opaque
274+
handles for gateway-managed refresh credentials. Provider environment keys
275+
beginning with `v<digits>_` or `s<64 lowercase hex characters>_` are reserved
276+
for those placeholder namespaces.
263277

264278
Provider profiles can also declare dynamic token grants. For matching HTTP
265279
endpoints, the supervisor obtains a SPIFFE JWT-SVID from the local Workload API,

0 commit comments

Comments
 (0)