feat(supervisor): expose sandbox name to middleware request context - #2771
Open
letv1nnn wants to merge 3 commits into
Open
feat(supervisor): expose sandbox name to middleware request context#2771letv1nnn wants to merge 3 commits into
letv1nnn wants to merge 3 commits into
Conversation
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
# Conflicts: # crates/openshell-supervisor-network/src/l7/middleware.rs
letv1nnn
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 17, 2026 10:14
pimlock
reviewed
Aug 20, 2026
| // Workload process that originated the request, when available. | ||
| Process originating_process = 3; | ||
| // Sandbox name that originated the request. | ||
| string sandbox_name = 4; |
Collaborator
There was a problem hiding this comment.
Please also add workspace to RequestContext as string workspace = 5, preserving the existing field numbers and matching the other workspace-aware APIs. Populate it from the canonical workspace already learned through GetSandboxConfigResponse.workspace, and propagate it through both HTTP and WebSocket requests.
Please add assertions for both paths.
|
|
||
| Middleware receives the request before credential injection. Operator-run services cannot inspect OpenShell-managed credentials. Middleware-visible request headers are delivered in wire order and repeated header names are preserved as separate entries. OpenShell filters credential, routing, framing, and hop-by-hop headers before invoking middleware. It rejects malformed request headers and unsupported transfer-coding sequences before middleware or policy dispatch. Headers named by a request's `Connection` field are omitted from middleware input and removed before forwarding, except for the validated WebSocket upgrade pair. | ||
|
|
||
| The request context identifies the originating sandbox to operator-run services. It carries the sandbox ID (`sandbox_id`) and the sandbox name (`sandbox_name`), letting audit and approval interfaces show a human-readable name instead of an opaque ID. The name is best-effort: a supervisor that cannot resolve it, or an older supervisor that predates the field, sends an empty string. Services should fall back to the sandbox ID when the name is empty. |
Collaborator
There was a problem hiding this comment.
Please clearly document here and in the protobuf field comment that sandbox_name is for display and logging only. Names are workspace-scoped and may be reused for different sandbox instances. Consumers must use sandbox_id for authorization, persistence, durable correlation, and identity.
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
letv1nnn
force-pushed
the
expose-sandbox-name-to-supervisor-middleware
branch
from
August 20, 2026 13:07
9d38ccf to
803dc62
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the originating sandbox name to the supervisor middleware request context. Operator-run middleware already receives the sandbox ID; passing the name alongside it lets audit and approval interfaces show a human-readable identifier instead of an opaque UUID, using data the supervisor already owns.
Related Issue
Closes #2754
Changes
sandbox_namefield toRequestContextinproto/supervisor_middleware.proto; existing field numbers are unchanged for wire compatibility.sandbox_nametoopenshell_supervisor_middleware::HttpRequestInputand carry it into the gRPCRequestContext.sandbox_idandsandbox_namefrom the process-wideopenshell_ocsf::SandboxContextwhen the network supervisor builds middleware input.SandboxContextintomiddleware_request_inputinstead of reading the global inside it, making the identifier copy unit-testable with a real name.docs/extensibility/supervisor-middleware.mdx.#[cfg(target_os = "linux")]gate on thestd::path::Pathimport inopenshell-driver-podman'scontainer.rs.Pathis used unconditionally in a public function signature, so the gated import broke the non-Linux (macOS) build after mergingmain. Unrelated to the feature but required for the branch to compile cross-platform.Testing
mise run pre-commitpassesChecklist