From c31ff5743fd930e227a9fba98bf4fe8f5f9003c9 Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Thu, 17 Sep 2026 19:52:50 +0000 Subject: [PATCH 01/12] fix(ci): use renamed conformance suite in release dev (#3425) Signed-off-by: Piotr Mlocek --- .github/workflows/release-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 68c73a562e..7dd1e98a8e 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -109,7 +109,7 @@ jobs: uses: ./.github/workflows/conformance.yml with: scenarios: '["ubuntu-docker-rootful", "fedora-podman-rootful", "fedora-podman-rootless"]' - testsuites: '["smoke"]' + testsuites: '["conformance"]' docker-e2e: needs: [build-binaries, build-images] From fc071655440574489808a76701bd4519444e7a6f Mon Sep 17 00:00:00 2001 From: Simon Scatton <44714756+SDAChess@users.noreply.github.com> Date: Thu, 17 Sep 2026 20:07:32 +0000 Subject: [PATCH 02/12] test(tmachine): accept scalar playbook inputs (#3418) Signed-off-by: Simon Scatton --- tests/tmachine/src/ansible.rs | 13 ++++++++++--- tests/tmachine/src/qemu/layer.rs | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/tmachine/src/ansible.rs b/tests/tmachine/src/ansible.rs index c54f11f335..868b763d5b 100644 --- a/tests/tmachine/src/ansible.rs +++ b/tests/tmachine/src/ansible.rs @@ -28,11 +28,18 @@ pub async fn install_roles() { pub async fn run(playbook: &Path, inputs: &BTreeMap) -> Result<()> { let mut command = Command::new("ansible-playbook"); for (name, path) in inputs { - let path = std::fs::canonicalize(path) - .with_context(|| format!("failed to resolve input {name:?} from {}", path.display()))?; + let value = match std::fs::canonicalize(path) { + Ok(path) => path, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => path.clone(), + Err(error) => { + return Err(error).with_context(|| { + format!("failed to resolve input {name:?} from {}", path.display()) + }); + } + }; command .arg("--extra-vars") - .arg(format!("{name}={}", path.display())); + .arg(format!("{name}={}", value.display())); } let status = command.arg(playbook).status().await.unwrap(); diff --git a/tests/tmachine/src/qemu/layer.rs b/tests/tmachine/src/qemu/layer.rs index aecca0daf4..9b1273a836 100644 --- a/tests/tmachine/src/qemu/layer.rs +++ b/tests/tmachine/src/qemu/layer.rs @@ -65,8 +65,15 @@ pub(super) fn hash_inputs(hasher: &mut Hasher, inputs: &BTreeMap Date: Thu, 17 Sep 2026 20:10:56 +0000 Subject: [PATCH 03/12] fix(sandbox): harden isolated supervisor startup (#3426) As part of the RFC-0012 changes, the Podman runtime moved trusted networking into a paired supervisor running as the resolved non-root identity, while the capability-free sandbox retained ownership of seccomp-mediated I/O. The supervisor still generated interception TLS material under the root-owned /etc/openshell-tls directory, and the sandbox treated the documented ENOENT notification race as a fatal listener failure. This meant TLS interception could fail with a permission error, and an exiting target process could stop the network broker while the kernel was preparing its notification. Now, we store generated supervisor TLS material in its writable /run tmpfs and retry ENOENT notification races while preserving fatal handling for other listener errors. Signed-off-by: Kris Hicks --- .../openshell-driver-podman/src/container.rs | 15 ++++++++++++ .../openshell-sandbox/src/network_broker.rs | 24 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/crates/openshell-driver-podman/src/container.rs b/crates/openshell-driver-podman/src/container.rs index 4378d0a6bb..4f502da8bc 100644 --- a/crates/openshell-driver-podman/src/container.rs +++ b/crates/openshell-driver-podman/src/container.rs @@ -1494,6 +1494,13 @@ pub fn build_isolation_specs( openshell_core::sandbox_env::ADMITTED_ISOLATION_BACKEND.into(), openshell_sandbox_backend::BACKEND_NAME.into(), ); + // The supervisor runs as the resolved non-root workload identity. Keep + // generated interception CA material under its writable /run tmpfs rather + // than the root-owned default at /etc/openshell-tls. + supervisor.env.insert( + openshell_core::sandbox_env::PROXY_TLS_DIR.into(), + "/run/openshell/proxy-tls".into(), + ); supervisor.user = user; supervisor.groups = input .identity @@ -1801,6 +1808,14 @@ mod tests { .contains(&"nocopy".into()) ); assert_eq!(specs.supervisor.entrypoint, vec!["/openshell-supervisor"]); + assert_eq!( + specs + .supervisor + .env + .get(openshell_core::sandbox_env::PROXY_TLS_DIR) + .map(String::as_str), + Some("/run/openshell/proxy-tls") + ); } fn json_struct(value: Value) -> prost_types::Struct { diff --git a/crates/openshell-sandbox/src/network_broker.rs b/crates/openshell-sandbox/src/network_broker.rs index 6b01cc0967..d4972465c6 100644 --- a/crates/openshell-sandbox/src/network_broker.rs +++ b/crates/openshell-sandbox/src/network_broker.rs @@ -41,6 +41,10 @@ const DNS_RELAY_ADDRESS: SocketAddr = SocketAddr::V4(std::net::SocketAddrV4::new const RELAY_CONNECT_TIMEOUT: Duration = Duration::from_secs(5); const NETWORK_DECISION_TIMEOUT: Duration = Duration::from_secs(30); +fn retry_notification_receive(error: &io::Error) -> bool { + error.kind() == io::ErrorKind::Interrupted || error.raw_os_error() == Some(libc::ENOENT) +} + #[derive(Debug)] struct PendingOpenSlot(Arc); @@ -271,7 +275,12 @@ impl NetworkBroker { while broker_healthy.load(Ordering::Acquire) { let notification = match listener.receive() { Ok(notification) => notification, - Err(error) if error.kind() == io::ErrorKind::Interrupted => continue, + // ENOENT is a documented seccomp user-notification + // race: the target thread exited or its blocked + // syscall was interrupted while the kernel was + // preparing the notification. It does not mean the + // listener itself is unhealthy. + Err(error) if retry_notification_receive(&error) => continue, Err(error) => { tracing::error!(%error, "sandbox network broker listener failed"); broker_healthy.store(false, Ordering::Release); @@ -1754,6 +1763,19 @@ mod tests { use std::io::{Read as _, Write as _}; use std::os::unix::net::{UnixListener, UnixStream}; + #[test] + fn notification_receive_retries_interrupted_and_disappeared_targets() { + assert!(retry_notification_receive(&io::Error::from( + io::ErrorKind::Interrupted + ))); + assert!(retry_notification_receive(&io::Error::from_raw_os_error( + libc::ENOENT + ))); + assert!(!retry_notification_receive(&io::Error::from_raw_os_error( + libc::EBADF + ))); + } + #[test] fn relay_rejects_descriptor_replaced_after_policy_decision() { let metadata = SocketMetadata { From faa7969cbf121e5277d9cb93931b2a05971df8cd Mon Sep 17 00:00:00 2001 From: Shiju Date: Fri, 18 Sep 2026 02:58:15 +0530 Subject: [PATCH 04/12] fix(sandbox-backend): recover TCP mediation after boundary disconnects (#3403) Use authenticated boundary recovery for pending TCP accepts. Close the response direction on gRPC failure and retain the generation observed before a request so delayed errors cannot retire its replacement. Add TLS transport-loss, concurrent recovery, terminal-error, and idle-wait regressions. Interrupted opens remain denied and established connections are not replayed. Related to NVIDIA/OpenShell#3396. Signed-off-by: Shiju Signed-off-by: Drew Newberry Co-authored-by: Drew Newberry --- architecture/sandbox.md | 1 + .../openshell-sandbox-backend/src/runtime.rs | 76 ++- .../src/runtime/tests/network_recovery.rs | 448 ++++++++++++++++++ 3 files changed, 511 insertions(+), 14 deletions(-) create mode 100644 crates/openshell-sandbox-backend/src/runtime/tests/network_recovery.rs diff --git a/architecture/sandbox.md b/architecture/sandbox.md index a9ba8ac3ef..50b0aa3034 100644 --- a/architecture/sandbox.md +++ b/architecture/sandbox.md @@ -39,6 +39,7 @@ credentials to claim the existing runtime generation. Confirmation resumes the workload; expiration terminates it. A credential replacement does not displace the active connection until the new connection is confirmed. Idle healthy connections remain usable. +TCP mediation accepts use the same authenticated transport recovery as process waits. A healthy idle accept has no timeout. An interrupted pending open fails closed, while a replacement accept waits for new workload traffic; decisions and established byte streams are not replayed. Boundary rejections and failed recovery remain terminal to the proxy. A renewed Sandbox Protocol bearer is authenticated even when its credential epoch is unchanged. The supervisor confirms that bearer on the active physical connection and records its fingerprint only after confirmation succeeds, preserving pending streams and the mediation session. Changing the credential epoch still requires an authenticated replacement connection. diff --git a/crates/openshell-sandbox-backend/src/runtime.rs b/crates/openshell-sandbox-backend/src/runtime.rs index a411e77ec8..96085e0940 100644 --- a/crates/openshell-sandbox-backend/src/runtime.rs +++ b/crates/openshell-sandbox-backend/src/runtime.rs @@ -792,7 +792,10 @@ struct RemoteNetworkMediation { #[async_trait] impl NetworkMediationSource for RemoteNetworkMediation { async fn accept_tcp(&self) -> Result { - let (stream, response) = self.client.open_exchange(Request::AcceptNetwork).await?; + // An idle accept has no deadline. Recover transport loss before exposing + // a source error, which permanently stops the proxy. The boundary drops + // the interrupted pending open; a retry never replays its decision. + let (stream, response) = self.client.call_wait_stream(Request::AcceptNetwork).await?; let Response::NetworkConnected { identity, destination, @@ -1079,6 +1082,7 @@ impl BoundaryClient { let envelope = Self::prepare_request(request)?; tokio::time::timeout(timeout, async { loop { + let generation = self.connection_generation().await; match self.exchange_envelope(&envelope).await { Ok(response) => { if remember_attach { @@ -1100,7 +1104,7 @@ impl BoundaryClient { Err(BackendError::Unavailable(message)) if is_transport_unavailable(&message) => { - self.recover_after_unavailable().await?; + self.recover_after_unavailable(generation).await?; tokio::time::sleep(Duration::from_millis(25)).await; } Err(error) => return Err(error), @@ -1116,10 +1120,21 @@ impl BoundaryClient { } async fn call_wait(&self, request: Request) -> Result { + let (_, response) = self.call_wait_stream(request).await?; + Ok(response) + } + + /// Wait without an idle timeout, retaining the stream for TCP mediation. + /// Only transport failures enter recovery; boundary rejections stay terminal. + async fn call_wait_stream( + &self, + request: Request, + ) -> Result<(BoundaryDuplexStream, Response), BackendError> { let envelope = Self::prepare_request(request)?; let mut recovery_deadline = None; loop { - match self.exchange_envelope(&envelope).await { + let generation = self.connection_generation().await; + match self.open_exchange_envelope(&envelope).await { Ok(response) => return Ok(response), Err(BackendError::Unavailable(message)) if is_transport_unavailable(&message) => { let deadline = @@ -1127,7 +1142,7 @@ impl BoundaryClient { if tokio::time::Instant::now() >= deadline { return Err(BackendError::Unavailable(message)); } - self.recover_after_unavailable().await?; + self.recover_after_unavailable(generation).await?; tokio::time::sleep(Duration::from_millis(25)).await; } Err(error) => return Err(error), @@ -1142,12 +1157,13 @@ impl BoundaryClient { let envelope = Self::prepare_request(request)?; tokio::time::timeout(REQUEST_TIMEOUT, async { loop { + let generation = self.connection_generation().await; match self.open_exchange_envelope(&envelope).await { Ok(response) => return Ok(response), Err(BackendError::Unavailable(message)) if is_transport_unavailable(&message) => { - self.recover_after_unavailable().await?; + self.recover_after_unavailable(generation).await?; tokio::time::sleep(Duration::from_millis(25)).await; } Err(error) => return Err(error), @@ -1165,12 +1181,13 @@ impl BoundaryClient { let envelope = Self::prepare_request(request)?; tokio::time::timeout(REQUEST_TIMEOUT, async { loop { + let generation = self.connection_generation().await; match self.open_exchange_envelope(&envelope).await { Ok(response) => return Ok(response), Err(BackendError::Unavailable(message)) if is_transport_unavailable(&message) => { - self.recover_after_unavailable().await?; + self.recover_after_unavailable(generation).await?; tokio::time::sleep(Duration::from_millis(25)).await; } Err(error) => return Err(error), @@ -1194,6 +1211,7 @@ impl BoundaryClient { .map_err(|error| BackendError::Process(format!("encode control request: {error}"))) } + #[cfg(test)] async fn open_exchange( &self, request: Request, @@ -1353,15 +1371,21 @@ impl BoundaryClient { Ok(()) } - /// Replace a failed physical transport and replay the authenticated - /// lifecycle needed to make the new HTTP/2 connection authoritative. - async fn recover_after_unavailable(&self) -> Result<(), BackendError> { - let observed_generation = self - .grpc_channel + async fn connection_generation(&self) -> Option { + self.grpc_channel .lock() .await .as_ref() - .map(|cached| cached.generation); + .map(|cached| cached.generation) + } + + /// Replace a failed physical transport and replay its authenticated lifecycle. + /// Capture the generation before the attempt: a late failure from an old + /// connection must not retire one another caller has already recovered. + async fn recover_after_unavailable( + &self, + observed_generation: Option, + ) -> Result<(), BackendError> { let _reconnect = self.reconnect.lock().await; if self .grpc_channel @@ -1481,12 +1505,13 @@ impl BoundaryClient { // waiting. Never multiply that deadline with message-matching retries. let session = tokio::time::timeout(REQUEST_TIMEOUT, async { loop { + let generation = self.connection_generation().await; match self.open_mediation_session().await { Ok(session) => return Ok(session), Err(BackendError::Unavailable(message)) if is_transport_unavailable(&message) => { - self.recover_after_unavailable().await?; + self.recover_after_unavailable(generation).await?; tokio::time::sleep(Duration::from_millis(25)).await; } Err(error) => return Err(error), @@ -1750,6 +1775,10 @@ where } Err(error) => { tracing::debug!(%error, "boundary gRPC response stream ended"); + // The request pump still owns the other duplex half. Explicitly + // close this direction so a waiting exchange observes EOF and + // can recover instead of waiting for both halves to drop. + let _ = writer.shutdown().await; return; } } @@ -1864,6 +1893,7 @@ fn is_transport_unavailable(message: &str) -> bool { #[cfg(test)] mod tests { mod credential_renewal; + mod network_recovery; use std::path::PathBuf; use std::pin::Pin; @@ -2175,13 +2205,31 @@ mod tests { Response::Confirmed { .. } )); - client.recover_after_unavailable().await.unwrap(); + let failed_generation = client.connection_generation().await; + client + .recover_after_unavailable(failed_generation) + .await + .unwrap(); tokio::time::timeout(Duration::from_secs(1), server) .await .expect("replacement connection accepted") .unwrap(); assert_eq!(accepted.load(Ordering::Acquire), 2); assert_eq!(requests.load(Ordering::Acquire), 4); + + // Another accept can report the same transport loss after recovery. + // It must reuse the replacement without a third connection or replay. + let recovered_generation = client.connection_generation().await; + tokio::time::timeout( + Duration::from_secs(1), + client.recover_after_unavailable(failed_generation), + ) + .await + .expect("stale failure must reuse the recovered connection") + .unwrap(); + assert_eq!(client.connection_generation().await, recovered_generation); + assert_eq!(accepted.load(Ordering::Acquire), 2); + assert_eq!(requests.load(Ordering::Acquire), 4); } #[test] diff --git a/crates/openshell-sandbox-backend/src/runtime/tests/network_recovery.rs b/crates/openshell-sandbox-backend/src/runtime/tests/network_recovery.rs new file mode 100644 index 0000000000..d131c3ffa0 --- /dev/null +++ b/crates/openshell-sandbox-backend/src/runtime/tests/network_recovery.rs @@ -0,0 +1,448 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +use super::*; +use crate::boundary_protocol::{ + BinaryIdentityWire, BoundaryErrorKind, MediationTimingWire, STREAM_NETWORK_DECISION, + SessionSnapshotWire, +}; +use openshell_isolation_interface::contract::NetworkSocketMetadata; +use std::sync::Mutex; +use std::sync::atomic::AtomicUsize; +use tokio_stream::StreamExt as _; + +#[derive(Clone, Copy)] +enum Reply { + Disconnect { pending_accepts: usize }, + Leaf(BoundaryErrorKind), + Idle, +} + +struct PeerState { + reply: Reply, + connections: AtomicUsize, + first_accepts: AtomicUsize, + decisions: AtomicUsize, + active: Mutex>, + events: Mutex>, + accepting: tokio::sync::Notify, + release: tokio::sync::Notify, +} + +#[derive(Clone)] +struct NetworkPeer { + state: Arc, + connection: usize, + attached: Arc, + disconnect: Arc, +} + +#[tonic::async_trait] +impl IsolationBoundary for NetworkPeer { + type ExchangeStream = TestGrpcStream; + type MediateStream = TestGrpcStream; + + async fn exchange( + &self, + request: tonic::Request>, + ) -> Result, tonic::Status> { + if request.metadata().get("authorization").unwrap() + != format!("Bearer {}", "a".repeat(32)).as_str() + { + return Err(tonic::Status::unauthenticated("unexpected test bearer")); + } + let peer = self.clone(); + let (outbound, receiver) = tokio::sync::mpsc::channel(2); + let closed = outbound.clone(); + tokio::spawn(async move { + tokio::select! { + result = peer.respond(request.into_inner(), outbound) => result.unwrap(), + () = closed.closed() => {}, + } + }); + Ok(tonic::Response::new(Box::pin(ReceiverStream::new( + receiver, + )))) + } + + async fn mediate( + &self, + _request: tonic::Request>, + ) -> Result, tonic::Status> { + Err(tonic::Status::unimplemented("TCP fixture")) + } +} + +impl NetworkPeer { + async fn respond( + &self, + mut inbound: tonic::Streaming, + outbound: tokio::sync::mpsc::Sender>, + ) -> Result<(), tonic::Status> { + let mut frame = Vec::new(); + while !complete_control_frame(&frame) { + frame.extend_from_slice(&inbound.message().await?.expect("control request").data); + } + let envelope: RequestEnvelope = decode_frame(&frame).unwrap(); + let kind = match envelope.request { + Request::Attach { .. } => "attach", + Request::Confirm => "confirm", + Request::AcceptNetwork => "accept", + _ => panic!("unexpected network fixture request"), + }; + self.state + .events + .lock() + .unwrap() + .push((self.connection, kind)); + let response = match envelope.request { + Request::Attach { .. } => { + // An equal-epoch connection cannot displace an active peer. + // This rejects reconnect storms that a stateless mock permits. + let active = *self.state.active.lock().unwrap(); + if active.is_some_and(|active| active != self.connection) { + Response::Error { + kind: BoundaryErrorKind::Denied, + message: "credential epoch is already active".into(), + } + } else { + self.attached.store(true, Ordering::Release); + Response::Attached { + snapshot: SessionSnapshotWire { + generation: "test-generation".into(), + processes: Vec::new(), + }, + } + } + } + Request::Confirm => { + assert!(self.attached.load(Ordering::Acquire)); + *self.state.active.lock().unwrap() = Some(self.connection); + Response::Confirmed { + evidence: Box::new(test_confirmation_evidence()), + } + } + Request::AcceptNetwork => { + assert_eq!( + *self.state.active.lock().unwrap(), + Some(self.connection), + "accept requires confirmation on its physical connection" + ); + self.state.accepting.notify_one(); + match self.state.reply { + Reply::Disconnect { pending_accepts } if self.connection == 1 => { + if self.state.first_accepts.fetch_add(1, Ordering::AcqRel) + 1 + == pending_accepts + { + self.disconnect.notify_one(); + } + // The TLS bridge closes while these responses are pending. + return std::future::pending().await; + } + Reply::Leaf(kind) => Response::Error { + kind, + message: "network mediation unavailable".into(), + }, + Reply::Idle => { + self.state.release.notified().await; + network_response() + } + Reply::Disconnect { .. } => network_response(), + } + } + _ => unreachable!(), + }; + let connected = matches!(response, Response::NetworkConnected { .. }); + let bytes = encode_frame(&ResponseEnvelope { + request_id: envelope.request_id, + response, + }) + .unwrap(); + outbound + .send(Ok(BoundaryChunk { data: bytes })) + .await + .unwrap(); + if connected { + let state = self.state.clone(); + tokio::spawn(async move { + let (mut reader, writer) = tokio::io::duplex(4096); + let pump = tokio::spawn(pump_from_grpc(inbound, writer)); + let result = tokio::time::timeout(Duration::from_secs(3), async { + let (channel, payload) = read_stream_frame(&mut reader).await.unwrap().unwrap(); + assert_eq!(channel, STREAM_NETWORK_DECISION); + assert_eq!( + serde_json::from_slice::(&payload).unwrap(), + TcpOpenDecision::RelayReady + ); + state.decisions.fetch_add(1, Ordering::AcqRel); + let mut ping = [0; 4]; + reader.read_exact(&mut ping).await.unwrap(); + assert_eq!(&ping, b"ping"); + outbound + .send(Ok(BoundaryChunk { + data: b"pong".to_vec(), + })) + .await + .unwrap(); + }) + .await; + pump.abort(); + result.expect("accepted network stream must receive its decision and payload"); + }); + } + Ok(()) + } +} + +fn network_response() -> Response { + Response::NetworkConnected { + identity: BinaryIdentityWire::Resolved { + binary_path: PathBuf::from("/usr/bin/curl"), + binary_digest: None, + ancestors: Vec::new(), + cmdline_paths: Vec::new(), + }, + destination: "203.0.113.1:443".parse().unwrap(), + socket: NetworkSocketMetadata { + socket_cookie: 42, + nonblocking: true, + process_generation: 7, + }, + policy_generation: 9, + timing: MediationTimingWire { + notification_to_queue_us: 11, + queue_wait_us: 13, + }, + } +} + +struct Fixture { + source: RemoteNetworkMediation, + state: Arc, + server: tokio::task::JoinHandle<()>, +} + +impl Fixture { + async fn new(reply: Reply) -> Self { + let certificate = test_certificate(); + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let address = listener.local_addr().unwrap(); + let state = Arc::new(PeerState { + reply, + connections: AtomicUsize::new(0), + first_accepts: AtomicUsize::new(0), + decisions: AtomicUsize::new(0), + active: Mutex::new(None), + events: Mutex::new(Vec::new()), + accepting: tokio::sync::Notify::new(), + release: tokio::sync::Notify::new(), + }); + let server_state = state.clone(); + let server = tokio::spawn(async move { + let mut connections = tokio::task::JoinSet::new(); + loop { + let (socket, _) = listener.accept().await.unwrap(); + let connection = server_state.connections.fetch_add(1, Ordering::AcqRel) + 1; + let state = server_state.clone(); + let config = certificate.server_config.clone(); + connections.spawn(async move { + let mut tls = tokio_rustls::TlsAcceptor::from(config) + .accept(socket) + .await + .unwrap(); + let (application, mut bridge) = tokio::io::duplex(64 * 1024); + let disconnect = Arc::new(tokio::sync::Notify::new()); + let peer = NetworkPeer { + state: state.clone(), + connection, + attached: Arc::new(AtomicBool::new(false)), + disconnect: disconnect.clone(), + }; + // Keep the incoming stream open: the server can finish + // accepting before its connection task finishes serving. + let incoming = tokio_stream::iter([Ok::<_, std::io::Error>(TestTlsIo( + Box::new(application), + ))]) + .chain(tokio_stream::pending()); + let serving = tonic::transport::Server::builder() + .add_service(IsolationBoundaryServer::new(peer)) + .serve_with_incoming(incoming); + tokio::select! { + result = serving => result.unwrap(), + _ = tokio::io::copy_bidirectional(&mut tls, &mut bridge) => {}, + () = disconnect.notified() => {}, + } + let mut active = state.active.lock().unwrap(); + if *active == Some(connection) { + *active = None; + } + // Dropping TLS after retiring the owner models the server's + // disconnect callback before a same-epoch replacement attach. + }); + } + }); + let client = Arc::new(BoundaryClient::new( + tls_runtime_descriptor(address, certificate.client_tls), + test_bearer(&"a".repeat(32)), + )); + tokio::time::timeout(Duration::from_secs(3), async { + client + .call_idempotent(Request::Attach { + supervisor_instance_id: client.supervisor_instance_id, + policy: Box::new(SandboxPolicyWire::from(sandbox().policy)), + resource_claims: std::collections::BTreeMap::new(), + }) + .await + .unwrap(); + client.call_idempotent(Request::Confirm).await.unwrap(); + }) + .await + .expect("fixture must attach and confirm"); + Self { + source: RemoteNetworkMediation { client }, + state, + server, + } + } +} + +impl Drop for Fixture { + fn drop(&mut self) { + self.server.abort(); + } +} + +async fn verify_connection(mut pending: PendingTcpOpen) { + assert_eq!(pending.destination, "203.0.113.1:443".parse().unwrap()); + assert_eq!( + pending.binary_identity.unwrap().binary_path, + PathBuf::from("/usr/bin/curl") + ); + assert_eq!( + pending.socket, + NetworkSocketMetadata { + socket_cookie: 42, + nonblocking: true, + process_generation: 7 + } + ); + assert_eq!(pending.policy_generation, 9); + assert_eq!( + pending.timing.sandbox_notification_to_queue, + Duration::from_micros(11) + ); + assert_eq!(pending.timing.sandbox_queue_wait, Duration::from_micros(13)); + pending.decision.send(TcpOpenDecision::RelayReady).unwrap(); + pending.stream.write_all(b"ping").await.unwrap(); + let mut pong = [0; 4]; + pending.stream.read_exact(&mut pong).await.unwrap(); + assert_eq!(&pong, b"pong"); +} + +#[tokio::test] +async fn tcp_accept_recovers_a_lost_tls_connection() { + let fixture = Fixture::new(Reply::Disconnect { pending_accepts: 1 }).await; + tokio::time::timeout(Duration::from_secs(3), async { + verify_connection(fixture.source.accept_tcp().await.unwrap()).await; + }) + .await + .unwrap_or_else(|error| { + panic!( + "TCP mediation must recover and relay: {error}; events: {:?}", + fixture.state.events.lock().unwrap() + ) + }); + assert_eq!(fixture.state.connections.load(Ordering::Acquire), 2); + assert_eq!(fixture.state.decisions.load(Ordering::Acquire), 1); + assert_eq!( + *fixture.state.events.lock().unwrap(), + vec![ + (1, "attach"), + (1, "confirm"), + (1, "accept"), + (2, "attach"), + (2, "confirm"), + (2, "accept") + ] + ); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn concurrent_tcp_accepts_recover_a_lost_tls_connection() { + const ACCEPTS: usize = 4; + let fixture = Fixture::new(Reply::Disconnect { + pending_accepts: ACCEPTS, + }) + .await; + let mut accepts = tokio::task::JoinSet::new(); + for _ in 0..ACCEPTS { + let source = RemoteNetworkMediation { + client: fixture.source.client.clone(), + }; + accepts.spawn(async move { verify_connection(source.accept_tcp().await.unwrap()).await }); + } + tokio::time::timeout(Duration::from_secs(3), async { + while let Some(result) = accepts.join_next().await { + result.unwrap(); + } + }) + .await + .expect("all concurrent TCP accepts must recover"); + assert_eq!(fixture.state.connections.load(Ordering::Acquire), 2); + assert_eq!(fixture.state.decisions.load(Ordering::Acquire), ACCEPTS); +} + +#[tokio::test] +async fn tcp_accept_preserves_boundary_leaf_errors() { + for kind in [ + BoundaryErrorKind::Unavailable, + BoundaryErrorKind::Denied, + BoundaryErrorKind::Terminated, + BoundaryErrorKind::Invalid, + BoundaryErrorKind::Process, + ] { + let fixture = Fixture::new(Reply::Leaf(kind)).await; + let error = tokio::time::timeout(Duration::from_secs(3), fixture.source.accept_tcp()) + .await + .expect("leaf error must not retry") + .err() + .expect("boundary leaf must fail"); + assert!(matches!( + (kind, error), + (BoundaryErrorKind::Unavailable, BackendError::Unavailable(_)) + | (BoundaryErrorKind::Denied, BackendError::Denied(_)) + | (BoundaryErrorKind::Terminated, BackendError::Terminated(_)) + | (BoundaryErrorKind::Invalid, BackendError::Descriptor(_)) + | (BoundaryErrorKind::Process, BackendError::Process(_)) + )); + assert_eq!(fixture.state.connections.load(Ordering::Acquire), 1); + assert_eq!( + *fixture.state.events.lock().unwrap(), + vec![(1, "attach"), (1, "confirm"), (1, "accept")] + ); + } +} + +#[tokio::test] +async fn tcp_accept_has_no_idle_operation_timeout() { + let fixture = Fixture::new(Reply::Idle).await; + let source = RemoteNetworkMediation { + client: fixture.source.client.clone(), + }; + let pending = tokio::spawn(async move { source.accept_tcp().await }); + tokio::time::timeout(Duration::from_secs(3), fixture.state.accepting.notified()) + .await + .expect("TCP accept must reach the peer"); + tokio::time::sleep(REQUEST_TIMEOUT + Duration::from_millis(100)).await; + assert!( + !pending.is_finished(), + "healthy idle acceptance must outlive ordinary requests" + ); + fixture.state.release.notify_one(); + tokio::time::timeout(Duration::from_secs(3), async { + verify_connection(pending.await.unwrap().unwrap()).await; + }) + .await + .expect("idle acceptance must deliver the next connection"); + assert_eq!(fixture.state.connections.load(Ordering::Acquire), 1); +} From cb93f62bfe7aef5cae92c8e46cba4ac9b00f9899 Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Thu, 17 Sep 2026 14:34:14 -0700 Subject: [PATCH 05/12] fix(e2e): support distroless supervisor fixture (#3431) * fix(e2e): support distroless supervisor fixture Signed-off-by: Piotr Mlocek * test(e2e): preserve provider fixture trust bundle Signed-off-by: Drew Newberry --------- Signed-off-by: Piotr Mlocek Signed-off-by: Drew Newberry Co-authored-by: Drew Newberry --- e2e/rust/tests/provider_readiness.rs | 30 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/e2e/rust/tests/provider_readiness.rs b/e2e/rust/tests/provider_readiness.rs index 7736681d19..d2ba5154d4 100644 --- a/e2e/rust/tests/provider_readiness.rs +++ b/e2e/rust/tests/provider_readiness.rs @@ -186,14 +186,14 @@ impl FixtureImage { &self.tag } - async fn build(&self, dockerfile: &Path, context: &Path) -> Result<(), String> { + async fn build(&self, dockerfile: &Path, context: &Path, label: &str) -> Result<(), String> { let mut command = Command::from(self.engine.command()); command .args(["build", "--file"]) .arg(dockerfile) .args(["--tag", &self.tag]) .arg(context); - checked_command_with_timeout(&mut command, "build fixture image", IMAGE_BUILD_TIMEOUT) + checked_command_with_timeout(&mut command, label, IMAGE_BUILD_TIMEOUT) .await .map(|_| ()) } @@ -1369,16 +1369,26 @@ async fn acknowledged_provider_changes_apply_to_fresh_clients_and_revoke_retaine "FROM {base}\nUSER root\nCOPY client.py /opt/provider-readiness-client.py\nUSER sandbox\n" )).map_err(|_| "could not write fixture Dockerfile")?; let supervisor_dockerfile = context.join("Dockerfile.supervisor"); - // Outbound TLS belongs to the separate supervisor. Its combined public - // trust bundle is delivered to the workload through the sandbox protocol. - // Preserve the base image's user setting: Docker's archive upload applies - // an explicit image user to the supervisor's private bootstrap files. + // Outbound TLS belongs to the separate supervisor. Assemble its combined + // public trust bundle in the shell-capable workload image because the + // final supervisor image is intentionally distroless. Preserve the final + // image's user setting: Docker's archive upload applies an explicit image + // user to the supervisor's private bootstrap files. std::fs::write(&supervisor_dockerfile, format!( - "FROM {}\nCOPY fixture-ca.crt /tmp/readiness-fixture-ca.crt\nRUN cat /tmp/readiness-fixture-ca.crt >> /etc/ssl/certs/ca-certificates.crt && rm /tmp/readiness-fixture-ca.crt\n", - gateway_config.supervisor_image + "FROM {} AS supervisor\nFROM {base} AS trust-bundle\nUSER 0\nCOPY --from=supervisor /etc/ssl/certs/ca-certificates.crt /tmp/ca-certificates.crt\nCOPY fixture-ca.crt /tmp/readiness-fixture-ca.crt\nRUN [\"/usr/bin/python3\", \"-c\", \"from pathlib import Path; bundle = Path('/tmp/ca-certificates.crt'); bundle.write_bytes(bundle.read_bytes() + Path('/tmp/readiness-fixture-ca.crt').read_bytes())\"]\nFROM {}\nCOPY --from=trust-bundle /tmp/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt\n", + gateway_config.supervisor_image, + gateway_config.supervisor_image, )).map_err(|_| "could not write fixture supervisor Dockerfile")?; - image.build(&dockerfile, &context).await?; - supervisor_image.build(&supervisor_dockerfile, &context).await?; + image + .build(&dockerfile, &context, "build workload fixture image") + .await?; + supervisor_image + .build( + &supervisor_dockerfile, + &context, + "build supervisor fixture image", + ) + .await?; gateway_config.apply(supervisor_image.tag()).await?; let profile = directory.path().join("profile.json"); let policy = directory.path().join("policy.json"); From a72351d370e652a604fa3e5846a9e3039526e399 Mon Sep 17 00:00:00 2001 From: Shiju Date: Thu, 17 Sep 2026 22:53:07 +0000 Subject: [PATCH 06/12] fix(policy)!: require explicit L7 append targets and scope (#3380) Make allow and deny appends identify a rule and endpoint and declare every affected binary and port. Reject incomplete, stale, ambiguous, and provider targets atomically so a small append cannot silently change a broader scope. Update CLI previews, wire requests, Go types and generated bindings, SDK regressions, operator documentation, and live policy-update coverage. BREAKING CHANGE: AddAllowRules and AddDenyRules require L7RuleTarget instead of host and port. CLI appends require a rule name and explicit binary scope. Signed-off-by: Shiju --- architecture/gateway.md | 2 + architecture/security-policy.md | 2 + crates/openshell-cli/src/main.rs | 119 +- crates/openshell-cli/src/policy_update.rs | 493 +++++- crates/openshell-cli/src/run.rs | 5 + crates/openshell-policy/src/lib.rs | 5 +- crates/openshell-policy/src/merge.rs | 918 ++++++++-- crates/openshell-server/src/grpc/policy.rs | 609 ++++++- crates/openshell-server/src/storage_proto.rs | 4 +- docs/sandboxes/policies.mdx | 43 +- e2e/rust/tests/live_policy_update.rs | 174 +- proto/openshell.proto | 24 +- sdk/go/docs/src/api/policy.md | 34 + sdk/go/openshell/v1/config_client_test.go | 70 + .../v1/internal/converter/setting.go | 36 +- .../v1/internal/converter/setting_test.go | 121 +- sdk/go/openshell/v1/types/network_policy.go | 32 +- sdk/go/openshell/v1/types_reexport.go | 3 + sdk/go/proto/openshellv1/openshell.pb.go | 1561 +++++++++-------- sdk/typescript/src/client.test.ts | 56 + skills/openshell-cli/SKILL.md | 7 +- 21 files changed, 3268 insertions(+), 1050 deletions(-) diff --git a/architecture/gateway.md b/architecture/gateway.md index f991e591bc..fc354f3e93 100644 --- a/architecture/gateway.md +++ b/architecture/gateway.md @@ -387,6 +387,8 @@ Public RPC contracts and durable protobuf formats have separate ownership. The ` `ReportEndpointStatus` is a sandbox-authenticated public gateway RPC. Its request, response, and `EndpointObservation` messages belong only to the public closure. `EndpointStatus` and `EndpointResult` also belong to the durable closure because `Sandbox.status.endpoint_statuses` persists them. The repeated status field uses a new wire tag; stored sandboxes without it decode with an empty endpoint list and retain their lifecycle fields. A fixed payload encoded with the earlier sandbox schema verifies that no database rewrite is required. +Allow and deny append requests carry `L7RuleTarget` to declare the rule, endpoint, and complete affected scope. The removed `host` and `port` fields remain reserved by number and name, and requests without a target are rejected. These mutation requests are not persisted formats. + `GetSandboxProviderStatus` and `ReportProviderReadiness` are unary public gateway RPCs. The first lets authorized users inspect a provider change; the second accepts installation reports only from the sandbox's current authenticated supervisor session. The removed `NetworkBinary.harness` field remains reserved by number and name, diff --git a/architecture/security-policy.md b/architecture/security-policy.md index eca641f4b5..3b490ceee4 100644 --- a/architecture/security-policy.md +++ b/architecture/security-policy.md @@ -240,6 +240,8 @@ ambiguity atomically, without creating an invalid revision or partially activating an update. Supervisor validation remains the defense-in-depth boundary for startup, concurrent changes, and sources outside those mutations. +L7 allow and deny append operations carry an explicit rule target and the complete affected binary and port scope. The merge engine resolves one non-provider endpoint within that rule, optionally by exact endpoint path, and compares both scope sets before mutation. A partial declaration, ambiguous target, or changed scope rejects the batch before revision persistence. The declaration records operator intent; it does not grant policy-writing authority or change the stored binary and port sets. + The `[openshell.gateway] policy_validation_failure_mode` configuration controls candidates rejected by supervisor runtime validation. Gateway preflight rejections never become generations and leave the active policy unchanged. The diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index a17d4c2e92..674349061b 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -366,7 +366,7 @@ const POLICY_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m $ openshell policy set my-sandbox --policy policy.yaml $ openshell policy update my-sandbox --add-endpoint api.github.com:443:read-only:rest:enforce $ openshell policy update my-sandbox --add-endpoint realtime.example.com:443:read-write:websocket:enforce:websocket-credential-rewrite,allowed-ip=10.0.0.0/8 - $ openshell policy update my-sandbox --add-allow 'api.github.com:443:GET:/repos/**' + $ openshell policy update my-sandbox --rule-name github --binary /usr/bin/gh --add-allow 'api.github.com:443:GET:/repos/**' $ openshell policy set --global --policy policy.yaml $ openshell policy delete --global $ openshell policy list my-sandbox @@ -1944,11 +1944,15 @@ enum PolicyCommands { #[arg(long = "remove-endpoint")] remove_endpoints: Vec, - /// Add a REST or WebSocket method/path allow rule: `host:port:METHOD:path_glob`. + /// Append an allow rule: `host:port[,port...]:METHOD:path_glob`. + /// List every port on the target endpoint. + /// Requires --rule-name and the complete --binary list or --any-binary. #[arg(long = "add-allow")] add_allow: Vec, - /// Add a REST or WebSocket method/path deny rule: `host:port:METHOD:path_glob`. + /// Append a deny rule: `host:port[,port...]:METHOD:path_glob`. + /// List every port on the target endpoint. + /// Requires --rule-name and the complete --binary list or --any-binary. #[arg(long = "add-deny")] add_deny: Vec, @@ -1956,14 +1960,23 @@ enum PolicyCommands { #[arg(long = "remove-rule")] remove_rules: Vec, - /// Add binaries to each --add-endpoint rule. + /// Add a binary to --add-endpoint, or declare every binary of an L7 target rule. #[arg(long = "binary", value_hint = ValueHint::FilePath)] binaries: Vec, - /// Override the generated rule name when exactly one --add-endpoint is provided. + /// Name the target rule for L7 appends, or override one --add-endpoint rule name. #[arg(long = "rule-name")] rule_name: Option, + /// Explicitly declare that the target rule for L7 appends allows any binary. + #[arg(long, conflicts_with = "binaries")] + any_binary: bool, + + /// Select an exact endpoint path for L7 appends; an empty value selects no path. + /// This is distinct from the appended method/path matcher. + #[arg(long)] + endpoint_path: Option, + /// Preview the merged policy without sending it to the gateway. #[arg(long)] dry_run: bool, @@ -2839,6 +2852,8 @@ async fn run_async() -> Result<()> { remove_rules, binaries, rule_name, + any_binary, + endpoint_path, dry_run, wait, timeout, @@ -2854,6 +2869,8 @@ async fn run_async() -> Result<()> { &remove_rules, &binaries, rule_name.as_deref(), + any_binary, + endpoint_path.as_deref(), dry_run, wait, timeout, @@ -4014,6 +4031,98 @@ mod tests { use std::ffi::OsString; use std::fs; + #[test] + fn policy_update_parses_explicit_l7_scope_and_endpoint_path() { + let cli = Cli::try_parse_from([ + "openshell", + "policy", + "update", + "sandbox-1", + "--rule-name", + "api", + "--binary", + "/usr/bin/curl", + "--binary", + "/usr/bin/python3", + "--endpoint-path", + "", + "--add-allow", + "api.example.com:443,8443:POST:/v1/a:b", + ]) + .expect("explicit scope flags should parse"); + let Some(Commands::Policy { + command: + Some(PolicyCommands::Update { + rule_name, + binaries, + any_binary, + endpoint_path, + add_allow, + .. + }), + .. + }) = cli.command + else { + panic!("expected policy update"); + }; + assert_eq!(rule_name.as_deref(), Some("api")); + assert_eq!(binaries, vec!["/usr/bin/curl", "/usr/bin/python3"]); + assert!(!any_binary); + assert_eq!(endpoint_path.as_deref(), Some("")); + assert_eq!(add_allow, vec!["api.example.com:443,8443:POST:/v1/a:b"]); + } + + #[test] + fn policy_update_any_binary_is_explicit_and_conflicts_with_binary() { + let args = [ + "openshell", + "policy", + "update", + "--rule-name", + "api", + "--any-binary", + "--add-deny", + "api.example.com:443:DELETE:/v1/**", + ]; + let cli = Cli::try_parse_from(args).expect("explicit wildcard should parse"); + assert!(matches!( + cli.command, + Some(Commands::Policy { + command: Some(PolicyCommands::Update { + any_binary: true, + .. + }), + .. + }) + )); + let conflicting = args.into_iter().chain(["--binary", "/usr/bin/curl"]); + assert!(Cli::try_parse_from(conflicting).is_err()); + } + + #[test] + fn policy_update_add_endpoint_keeps_scope_defaults() { + let cli = Cli::try_parse_from([ + "openshell", + "policy", + "update", + "--add-endpoint", + "api.example.com:443", + ]) + .expect("endpoint creation retains its existing flags"); + assert!(matches!( + cli.command, + Some(Commands::Policy { + command: Some(PolicyCommands::Update { + any_binary: false, + endpoint_path: None, + rule_name: None, + .. + }), + .. + }) + )); + } + // Tests below mutate the process-global XDG_CONFIG_HOME env var. // A static mutex serialises them so concurrent threads don't clobber // each other's environment. diff --git a/crates/openshell-cli/src/policy_update.rs b/crates/openshell-cli/src/policy_update.rs index 93886725af..a34ed04f54 100644 --- a/crates/openshell-cli/src/policy_update.rs +++ b/crates/openshell-cli/src/policy_update.rs @@ -6,18 +6,20 @@ use std::collections::{BTreeMap, HashMap}; use miette::{Result, miette}; use openshell_core::proto::policy_merge_operation; use openshell_core::proto::{ - AddAllowRules, AddDenyRules, AddNetworkRule, L7Allow, L7DenyRule, L7Rule, NetworkBinary, - NetworkEndpoint, NetworkPolicyRule, PolicyMergeOperation, RemoveNetworkEndpoint, - RemoveNetworkRule, + AddAllowRules, AddDenyRules, AddNetworkRule, L7Allow, L7DenyRule, L7Rule, + L7RuleTarget as ProtoL7RuleTarget, NetworkBinary, NetworkEndpoint, NetworkPolicyRule, + PolicyMergeOperation, RemoveNetworkEndpoint, RemoveNetworkRule, }; -use openshell_policy::{PolicyMergeOp, generated_rule_name}; +use openshell_policy::{L7BinaryScope, L7RuleTarget, PolicyMergeOp, generated_rule_name}; +/// Equivalent gateway and local-preview operations for one policy update. #[derive(Debug, Clone)] pub struct PolicyUpdatePlan { pub merge_operations: Vec, pub preview_operations: Vec, } +/// Parse operation flags and require explicit scope for every L7 append. #[allow(clippy::too_many_arguments)] pub fn build_policy_update_plan( add_endpoints: &[String], @@ -27,15 +29,55 @@ pub fn build_policy_update_plan( remove_rules: &[String], binaries: &[String], rule_name: Option<&str>, + any_binary: bool, + endpoint_path: Option<&str>, ) -> Result { + let has_l7_append = !add_allow.is_empty() || !add_deny.is_empty(); if binaries.iter().any(|binary| binary.trim().is_empty()) { return Err(miette!("--binary values must not be empty")); } - if !binaries.is_empty() && add_endpoints.is_empty() { - return Err(miette!("--binary can only be used with --add-endpoint")); + if any_binary && !binaries.is_empty() { + return Err(miette!("--any-binary and --binary are mutually exclusive")); } - if rule_name.is_some() && add_endpoints.is_empty() { - return Err(miette!("--rule-name can only be used with --add-endpoint")); + // Scope flags describe the existing rule for L7 appends, but create scope + // for AddRule. Reject mixed use so one declaration cannot mean both. + if has_l7_append && !add_endpoints.is_empty() { + return Err(miette!( + "--add-endpoint cannot be combined with --add-allow or --add-deny; submit separate updates" + )); + } + if has_l7_append { + if rule_name.is_none_or(|name| name.trim().is_empty()) { + return Err(miette!( + "--add-allow and --add-deny require a nonempty --rule-name" + )); + } + if binaries.is_empty() && !any_binary { + return Err(miette!( + "--add-allow and --add-deny require the complete --binary list or explicit --any-binary" + )); + } + } else { + if any_binary { + return Err(miette!( + "--any-binary can only be used with --add-allow or --add-deny" + )); + } + if endpoint_path.is_some() { + return Err(miette!( + "--endpoint-path can only be used with --add-allow or --add-deny" + )); + } + if !binaries.is_empty() && add_endpoints.is_empty() { + return Err(miette!( + "--binary requires --add-endpoint, --add-allow, or --add-deny" + )); + } + if rule_name.is_some() && add_endpoints.is_empty() { + return Err(miette!( + "--rule-name requires --add-endpoint, --add-allow, or --add-deny" + )); + } } if rule_name.is_some() && add_endpoints.len() > 1 { return Err(miette!( @@ -45,7 +87,19 @@ pub fn build_policy_update_plan( let mut merge_operations = Vec::new(); let mut preview_operations = Vec::new(); - let deduped_binaries = dedup_strings(binaries); + let deduped_binaries = if has_l7_append { + // L7 scope acknowledges stored paths exactly; whitespace can be part + // of an executable filename and must survive preview and transport. + let mut paths = Vec::new(); + for path in binaries { + if !paths.contains(path) { + paths.push(path.clone()); + } + } + paths + } else { + dedup_strings(binaries) + }; for spec in add_endpoints { let endpoint = parse_add_endpoint_spec(spec)?; let target_rule_name = rule_name @@ -110,34 +164,46 @@ pub fn build_policy_update_plan( }); } - for ((host, port), rules) in group_allow_rules(add_allow)? { + for ((host, ports), rules) in group_allow_rules(add_allow)? { + let target = build_l7_target( + rule_name, + host, + ports, + endpoint_path, + &deduped_binaries, + any_binary, + merge_operations.len(), + )?; merge_operations.push(PolicyMergeOperation { operation: Some(policy_merge_operation::Operation::AddAllowRules( AddAllowRules { - host: host.clone(), - port, + target: Some(l7_target_to_proto(&target)), rules: rules.clone(), }, )), }); - preview_operations.push(PolicyMergeOp::AddAllowRules { host, port, rules }); + preview_operations.push(PolicyMergeOp::AddAllowRules { target, rules }); } - for ((host, port), deny_rules) in group_deny_rules(add_deny)? { + for ((host, ports), deny_rules) in group_deny_rules(add_deny)? { + let target = build_l7_target( + rule_name, + host, + ports, + endpoint_path, + &deduped_binaries, + any_binary, + merge_operations.len(), + )?; merge_operations.push(PolicyMergeOperation { operation: Some(policy_merge_operation::Operation::AddDenyRules( AddDenyRules { - host: host.clone(), - port, + target: Some(l7_target_to_proto(&target)), deny_rules: deny_rules.clone(), }, )), }); - preview_operations.push(PolicyMergeOp::AddDenyRules { - host, - port, - deny_rules, - }); + preview_operations.push(PolicyMergeOp::AddDenyRules { target, deny_rules }); } if merge_operations.is_empty() { @@ -152,6 +218,56 @@ pub fn build_policy_update_plan( }) } +/// Build the target once so preview and RPC cannot disagree about affected scope. +#[allow(clippy::too_many_arguments)] +fn build_l7_target( + rule_name: Option<&str>, + host: String, + ports: Vec, + path: Option<&str>, + binaries: &[String], + any_binary: bool, + operation_index: usize, +) -> Result { + let target = L7RuleTarget { + rule_name: rule_name.unwrap_or_default().trim().to_string(), + host, + ports, + // An explicit empty string selects the unscoped endpoint; None leaves + // endpoint selection to the unique-match check in the policy engine. + path: path.map(ToString::to_string), + binaries: if any_binary { + L7BinaryScope::Any + } else { + L7BinaryScope::Restricted( + binaries + .iter() + .map(|path| NetworkBinary { path: path.clone() }) + .collect(), + ) + }, + }; + target + .validate(operation_index) + .map_err(|error| miette!("{error}"))?; + Ok(target) +} + +fn l7_target_to_proto(target: &L7RuleTarget) -> ProtoL7RuleTarget { + let (binaries, any_binary) = match &target.binaries { + L7BinaryScope::Any => (Vec::new(), true), + L7BinaryScope::Restricted(binaries) => (binaries.clone(), false), + }; + ProtoL7RuleTarget { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + ports: target.ports.clone(), + path: target.path.clone(), + binaries, + any_binary, + } +} + fn ensure_websocket_credential_rewrite_protocol( spec: &str, endpoint: &NetworkEndpoint, @@ -186,12 +302,15 @@ fn ensure_request_body_credential_rewrite_protocol( )) } -fn group_allow_rules(specs: &[String]) -> Result>> { +/// L7 payloads grouped by normalized host and complete canonical port set. +type GroupedL7Rules = BTreeMap<(String, Vec), Vec>; + +fn group_allow_rules(specs: &[String]) -> Result> { let mut grouped = BTreeMap::new(); for spec in specs { let parsed = parse_l7_rule_spec("--add-allow", spec)?; grouped - .entry((parsed.host, parsed.port)) + .entry((parsed.host, parsed.ports)) .or_insert_with(Vec::new) .push(L7Rule { allow: Some(L7Allow { @@ -209,12 +328,12 @@ fn group_allow_rules(specs: &[String]) -> Result Result>> { +fn group_deny_rules(specs: &[String]) -> Result> { let mut grouped = BTreeMap::new(); for spec in specs { let parsed = parse_l7_rule_spec("--add-deny", spec)?; grouped - .entry((parsed.host, parsed.port)) + .entry((parsed.host, parsed.ports)) .or_insert_with(Vec::new) .push(L7DenyRule { method: parsed.method, @@ -233,22 +352,30 @@ fn group_deny_rules(specs: &[String]) -> Result, method: String, path: String, } fn parse_l7_rule_spec(flag: &str, spec: &str) -> Result { - let parts = spec.split(':').collect::>(); - if parts.len() != 4 { + // Only the first three colons delimit fields; request paths may contain + // literal colons and must survive both preview and RPC unchanged. + let segments = spec.splitn(4, ':').collect::>(); + if segments.len() != 4 { return Err(miette!( - "{flag} expects host:port:METHOD:path_glob, got '{spec}'" + "{flag} expects host:port[,port...]:METHOD:path_glob, got '{spec}'" )); } - let host = parse_host(flag, spec, parts[0])?; - let port = parse_port(flag, spec, parts[1])?; - let method = parts[2].trim(); + let host = parse_host(flag, spec, segments[0])?.to_ascii_lowercase(); + let mut ports = segments[1] + .split(',') + .map(|port| parse_port(flag, spec, port)) + .collect::>>()?; + // Equivalent port declarations must group into the same endpoint update. + ports.sort_unstable(); + ports.dedup(); + let method = segments[2].trim(); if method.is_empty() { return Err(miette!("{flag} has an empty METHOD segment in '{spec}'")); } @@ -258,7 +385,7 @@ fn parse_l7_rule_spec(flag: &str, spec: &str) -> Result { )); } - let path = parts[3].trim(); + let path = segments[3].trim(); if path.is_empty() { return Err(miette!("{flag} has an empty path segment in '{spec}'")); } @@ -270,7 +397,7 @@ fn parse_l7_rule_spec(flag: &str, spec: &str) -> Result { Ok(ParsedL7RuleSpec { host, - port, + ports, method: method.to_ascii_uppercase(), path: path.to_string(), }) @@ -466,7 +593,66 @@ mod tests { PolicyUpdatePlan, build_policy_update_plan as build_policy_update_plan_with_options, parse_allowed_ip_value, }; - use openshell_policy::PolicyMergeOp; + use openshell_core::proto::policy_merge_operation::Operation; + use openshell_policy::{L7BinaryScope, PolicyMergeOp}; + + #[test] + fn l7_appends_preserve_literal_binary_paths() { + use openshell_core::proto::{NetworkBinary, NetworkEndpoint, NetworkPolicyRule}; + use openshell_policy::{merge_policy, restrictive_default_policy}; + + for binary_path in ["/opt/tools/curl", "/opt/tools/curl ", "/opt/tools/curl\t"] { + for is_deny in [false, true] { + let mut policy = restrictive_default_policy(); + policy.network_policies.insert( + "api".to_string(), + NetworkPolicyRule { + name: "api".to_string(), + binaries: vec![NetworkBinary { + path: binary_path.to_string(), + }], + endpoints: vec![NetworkEndpoint { + host: "api.example.com".to_string(), + port: 443, + ports: vec![443], + protocol: "rest".to_string(), + access: "read-only".to_string(), + ..Default::default() + }], + }, + ); + let specs = ["api.example.com:443:POST:/v1/**".to_string()]; + let plan = build_policy_update_plan( + &[], + &[], + if is_deny { &specs } else { &[] }, + if is_deny { &[] } else { &specs }, + &[], + &[binary_path.to_string(), binary_path.to_string()], + Some("api"), + ) + .expect("literal nonempty binary paths must parse"); + + // The merge compares the declaration with the stored literal + // path, so this also detects normalization in the preview. + let merged = merge_policy(policy, &plan.preview_operations) + .expect("the exact stored binary scope must merge"); + assert!(merged.changed); + assert_eq!( + merged.policy.network_policies["api"].binaries[0].path, + binary_path + ); + let target = match plan.merge_operations[0].operation.as_ref() { + Some(Operation::AddAllowRules(wire)) => wire.target.as_ref(), + Some(Operation::AddDenyRules(wire)) => wire.target.as_ref(), + other => panic!("expected L7 append, got {other:?}"), + } + .expect("explicit wire target"); + assert_eq!(target.binaries.len(), 1); + assert_eq!(target.binaries[0].path, binary_path); + } + } + } fn build_policy_update_plan( add_endpoints: &[String], @@ -485,6 +671,8 @@ mod tests { remove_rules, binaries, rule_name, + false, + None, ) } @@ -795,16 +983,16 @@ mod tests { &[], &["realtime.example.com:443:websocket_text:/v1/messages/**".to_string()], &[], - &[], - None, + &["/usr/bin/curl".to_string()], + Some("realtime"), ) .expect("plan should build"); - let PolicyMergeOp::AddAllowRules { host, port, rules } = &plan.preview_operations[0] else { + let PolicyMergeOp::AddAllowRules { target, rules } = &plan.preview_operations[0] else { panic!("expected add-allow preview"); }; - assert_eq!(host, "realtime.example.com"); - assert_eq!(*port, 443); + assert_eq!(target.host, "realtime.example.com"); + assert_eq!(target.ports, vec![443]); let allow = rules[0].allow.as_ref().expect("allow rule"); assert_eq!(allow.method, "WEBSOCKET_TEXT"); assert_eq!(allow.path, "/v1/messages/**"); @@ -818,8 +1006,8 @@ mod tests { &["api.github.com:443::/repos/**".to_string()], &[], &[], - &[], - None, + &["/usr/bin/gh".to_string()], + Some("github"), ) .expect_err("plan should fail"); assert!(error.to_string().contains("METHOD")); @@ -833,8 +1021,8 @@ mod tests { &[], &["api.github.com:443:GET:repos/**".to_string()], &[], - &[], - None, + &["/usr/bin/gh".to_string()], + Some("github"), ) .expect_err("plan should fail"); assert!(error.to_string().contains("path must start with '/'")); @@ -895,7 +1083,7 @@ mod tests { } #[test] - fn binary_requires_add_endpoint() { + fn binary_requires_endpoint_addition_or_l7_append() { let error = build_policy_update_plan(&[], &[], &[], &[], &[], &["/usr/bin/gh".to_string()], None) .expect_err("plan should fail"); @@ -916,4 +1104,219 @@ mod tests { .expect_err("plan should fail"); assert!(error.to_string().contains("exactly one --add-endpoint")); } + + #[test] + fn l7_appends_require_each_scope_declaration_independently() { + for (rule_name, binaries, any_binary, expected_error) in [ + ( + None, + vec!["/usr/bin/curl".to_string()], + false, + "--rule-name", + ), + ( + Some(" "), + vec!["/usr/bin/curl".to_string()], + false, + "--rule-name", + ), + (Some("api"), vec![], false, "complete --binary list"), + ( + Some("api"), + vec!["/usr/bin/curl".to_string()], + true, + "mutually exclusive", + ), + ( + Some("api"), + vec![" ".to_string()], + false, + "must not be empty", + ), + ] { + for is_deny in [false, true] { + let specs = ["api.example.com:443:POST:/admin".to_string()]; + let error = build_policy_update_plan_with_options( + &[], + &[], + if is_deny { &specs } else { &[] }, + if is_deny { &[] } else { &specs }, + &[], + &binaries, + rule_name, + any_binary, + None, + ) + .expect_err("each L7 append must explicitly declare target scope"); + assert!(error.to_string().contains(expected_error), "{error}"); + } + } + } + + #[test] + fn l7_appends_reject_each_invalid_port() { + for ports in ["", "0", "65536", "443,", "443,,8443", "443,no"] { + let error = build_policy_update_plan( + &[], + &[], + &[], + &[format!("api.example.com:{ports}:GET:/v1/**")], + &[], + &["/usr/bin/curl".to_string()], + Some("api"), + ) + .expect_err("all declared ports must be valid"); + assert!(error.to_string().contains("port"), "{error}"); + } + } + + #[test] + fn l7_scope_flags_reject_non_l7_operations() { + for (any_binary, endpoint_path, expected_error) in [ + (true, None, "--any-binary"), + (false, Some(""), "--endpoint-path"), + (false, Some("/v1/**"), "--endpoint-path"), + ] { + let error = build_policy_update_plan_with_options( + &["api.example.com:443".to_string()], + &[], + &[], + &[], + &[], + &[], + None, + any_binary, + endpoint_path, + ) + .expect_err("L7-only flags must not be ignored for AddRule"); + assert!(error.to_string().contains(expected_error), "{error}"); + } + } + + #[test] + fn l7_appends_reject_mixed_add_endpoint_scope() { + for is_deny in [false, true] { + let specs = ["api.example.com:443:POST:/admin".to_string()]; + let error = build_policy_update_plan( + &["api.example.com:443".to_string()], + &[], + if is_deny { &specs } else { &[] }, + if is_deny { &[] } else { &specs }, + &[], + &["/usr/bin/curl".to_string()], + Some("api"), + ) + .expect_err("one binary declaration cannot both create and acknowledge scope"); + assert!(error.to_string().contains("cannot be combined"), "{error}"); + } + } + + #[test] + fn l7_appends_group_canonical_ports_and_preserve_preview_wire_scope() { + let plan = build_policy_update_plan_with_options( + &[], + &[], + &[ + "API.EXAMPLE.COM:8443,443:DELETE:/v1/a:b".to_string(), + "api.example.com:443,8443,443:PUT:/v1/a:b".to_string(), + ], + &[ + "API.EXAMPLE.COM:8443,443,443:POST:/v1/a:b".to_string(), + "api.example.com:443,8443:GET:/v1/a:b".to_string(), + ], + &[], + &[ + "/usr/bin/curl".to_string(), + "/usr/bin/python3".to_string(), + "/usr/bin/curl".to_string(), + ], + Some("api"), + false, + Some("/v1/**"), + ) + .expect("complete repeated scope should build"); + assert_eq!(plan.merge_operations.len(), 2); + assert_eq!(plan.preview_operations.len(), 2); + for (wire, preview) in plan.merge_operations.iter().zip(&plan.preview_operations) { + let (wire_target, target) = match (wire.operation.as_ref(), preview) { + ( + Some(Operation::AddAllowRules(wire)), + PolicyMergeOp::AddAllowRules { target, rules }, + ) => { + assert_eq!(wire.rules, *rules); + assert_eq!(rules.len(), 2); + assert_eq!( + rules[0].allow.as_ref().expect("allow matcher").path, + "/v1/a:b" + ); + (wire.target.as_ref().expect("wire target"), target) + } + ( + Some(Operation::AddDenyRules(wire)), + PolicyMergeOp::AddDenyRules { target, deny_rules }, + ) => { + assert_eq!(wire.deny_rules, *deny_rules); + assert_eq!(deny_rules.len(), 2); + assert_eq!(deny_rules[0].path, "/v1/a:b"); + (wire.target.as_ref().expect("wire target"), target) + } + _ => panic!("preview and wire operation kinds must agree"), + }; + assert_eq!(target.rule_name, "api"); + assert_eq!(target.host, "api.example.com"); + assert_eq!(target.ports, vec![443, 8443]); + assert_eq!(target.path.as_deref(), Some("/v1/**")); + let L7BinaryScope::Restricted(binaries) = &target.binaries else { + panic!("the explicit binary list must remain restricted"); + }; + assert_eq!(binaries.len(), 2); + assert_eq!(binaries[0].path, "/usr/bin/curl"); + assert_eq!(binaries[1].path, "/usr/bin/python3"); + assert_eq!(wire_target.rule_name, target.rule_name); + assert_eq!(wire_target.host, target.host); + assert_eq!(wire_target.ports, target.ports); + assert_eq!(wire_target.path, target.path); + assert_eq!(wire_target.binaries, *binaries); + assert!(!wire_target.any_binary); + } + } + + #[test] + fn l7_any_binary_and_endpoint_path_presence_survive_preview_and_wire() { + for endpoint_path in [None, Some(""), Some("/v1/**")] { + let plan = build_policy_update_plan_with_options( + &[], + &[], + &["api.example.com:443:DELETE:/v1/a:b".to_string()], + &["api.example.com:443:POST:/v1/a:b".to_string()], + &[], + &[], + Some("api"), + true, + endpoint_path, + ) + .expect("any-binary and endpoint selector should build"); + for (wire, preview) in plan.merge_operations.iter().zip(&plan.preview_operations) { + let (wire_target, target) = match (wire.operation.as_ref(), preview) { + ( + Some(Operation::AddAllowRules(wire)), + PolicyMergeOp::AddAllowRules { target, .. }, + ) => (wire.target.as_ref().expect("wire target"), target), + ( + Some(Operation::AddDenyRules(wire)), + PolicyMergeOp::AddDenyRules { target, .. }, + ) => (wire.target.as_ref().expect("wire target"), target), + _ => panic!("preview and wire operation kinds must agree"), + }; + assert_eq!(target.path.as_deref(), endpoint_path); + assert!(matches!(target.binaries, L7BinaryScope::Any)); + assert_eq!(wire_target.rule_name, target.rule_name); + assert_eq!(wire_target.host, target.host); + assert_eq!(wire_target.ports, target.ports); + assert_eq!(wire_target.path, target.path); + assert!(wire_target.any_binary); + assert!(wire_target.binaries.is_empty()); + } + } + } } diff --git a/crates/openshell-cli/src/run.rs b/crates/openshell-cli/src/run.rs index 817b7e7eaf..7483f63aba 100644 --- a/crates/openshell-cli/src/run.rs +++ b/crates/openshell-cli/src/run.rs @@ -4889,6 +4889,7 @@ pub async fn sandbox_policy_set( } } +/// Preview or atomically submit explicitly scoped incremental policy operations. #[allow(clippy::too_many_arguments)] pub async fn sandbox_policy_update( server: &str, @@ -4900,6 +4901,8 @@ pub async fn sandbox_policy_update( remove_rules: &[String], binaries: &[String], rule_name: Option<&str>, + any_binary: bool, + endpoint_path: Option<&str>, dry_run: bool, wait: bool, timeout_secs: u64, @@ -4918,6 +4921,8 @@ pub async fn sandbox_policy_update( remove_rules, binaries, rule_name, + any_binary, + endpoint_path, )?; let mut client = grpc_client(server, tls).await?; diff --git a/crates/openshell-policy/src/lib.rs b/crates/openshell-policy/src/lib.rs index a9d2ab0bbf..a40dfb05eb 100644 --- a/crates/openshell-policy/src/lib.rs +++ b/crates/openshell-policy/src/lib.rs @@ -41,8 +41,9 @@ pub use l7_validate::{ validate_explicit_tcp_additional_fields, validate_l7_endpoint_semantics, }; pub use merge::{ - PolicyMergeError, PolicyMergeOp, PolicyMergeResult, PolicyMergeWarning, - canonicalize_advisor_add_rule, generated_rule_name, merge_policy, policy_covers_rule, + L7BinaryScope, L7RuleTarget, PolicyMergeError, PolicyMergeOp, PolicyMergeResult, + PolicyMergeWarning, canonicalize_advisor_add_rule, generated_rule_name, merge_policy, + policy_covers_rule, }; pub use middleware::middleware_host_matches; pub use middleware::validate_json as validate_network_middleware_json; diff --git a/crates/openshell-policy/src/merge.rs b/crates/openshell-policy/src/merge.rs index 59b8bc7605..858e69248c 100644 --- a/crates/openshell-policy/src/merge.rs +++ b/crates/openshell-policy/src/merge.rs @@ -139,6 +139,83 @@ pub fn canonicalize_advisor_add_rule( Ok((target_name, canonical)) } +/// Binary authorization affected by an incremental L7 rule append. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum L7BinaryScope { + /// Explicitly acknowledge a rule that authorizes every binary. + Any, + /// Declare every binary path on the target rule; the list must be nonempty. + Restricted(Vec), +} + +/// One endpoint and the complete authorization scope affected by an L7 append. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct L7RuleTarget { + /// Exact key of the sandbox-owned network policy rule. + pub rule_name: String, + /// Endpoint host selector, compared literally without ASCII case sensitivity. + pub host: String, + /// Complete endpoint port set; duplicates and ordering do not change scope. + pub ports: Vec, + /// Exact endpoint path. Omission requires a unique endpoint; `Some("")` + /// selects only an endpoint without a path scope. + pub path: Option, + /// Complete binary scope of the named rule. + pub binaries: L7BinaryScope, +} + +impl L7RuleTarget { + /// Validate the target declaration without consulting or mutating a policy. + /// + /// # Errors + /// Returns [`PolicyMergeError::InvalidL7Target`] when identity, ports, or + /// binary scope is malformed, or the rule belongs to a provider. + pub fn validate(&self, operation_index: usize) -> Result<(), PolicyMergeError> { + let invalid = |reason: &str| PolicyMergeError::InvalidL7Target { + operation_index, + reason: reason.to_string(), + }; + if self.rule_name.trim().is_empty() + || self.rule_name.trim() != self.rule_name + || self.rule_name.chars().any(char::is_control) + { + return Err(invalid("rule_name must name a sandbox-owned rule")); + } + // Provider rules are composed by the gateway and cannot be edited by + // sandbox policy operations, even if a composed policy reaches this API. + if is_provider_rule_name(&self.rule_name) { + return Err(invalid("provider-owned rules cannot receive L7 appends")); + } + if self.host.is_empty() + || self.host.chars().any(|character| { + character.is_whitespace() + || character.is_control() + || matches!(character, '/' | '?' | '#' | '@') + }) + || crate::host_wildcard_shape_invalid(&self.host) + { + return Err(invalid("host must be a nonempty endpoint host selector")); + } + if self.ports.is_empty() + || self + .ports + .iter() + .any(|port| !(1..=u32::from(u16::MAX)).contains(port)) + { + return Err(invalid("ports must declare a nonempty set in 1..=65535")); + } + if let L7BinaryScope::Restricted(binaries) = &self.binaries + && (binaries.is_empty() || binaries.iter().any(|binary| binary.path.trim().is_empty())) + { + return Err(invalid( + "restricted binary scope must contain nonempty binary paths; use Any for an any-binary rule", + )); + } + Ok(()) + } +} + +/// An atomic policy mutation applied in request order by [`merge_policy`]. #[derive(Debug, Clone, PartialEq)] pub enum PolicyMergeOp { AddRule { @@ -154,13 +231,11 @@ pub enum PolicyMergeOp { rule_name: String, }, AddDenyRules { - host: String, - port: u32, + target: L7RuleTarget, deny_rules: Vec, }, AddAllowRules { - host: String, - port: u32, + target: L7RuleTarget, rules: Vec, }, RemoveBinary { @@ -364,14 +439,40 @@ pub enum PolicyMergeError { /// Rendered effective contracts found at this host and port, sorted. contracts: Vec, }, - /// Several rules carry the same endpoint, so an operation that identifies - /// its target by host and port alone cannot say which binary scope it means. - AmbiguousEndpointRule { + /// An L7 append did not provide a well-formed sandbox-owned target. + InvalidL7Target { + operation_index: usize, + reason: String, + }, + /// No endpoint in the named rule matches the declared selector. + L7TargetNotFound { + rule_name: String, host: String, - port: u32, - /// Rendered rule, and path where one is set, for each endpoint the host - /// and port resolves to. Sorted. - targets: Vec, + ports: Vec, + path: Option, + }, + /// More than one endpoint in the named rule matches the selector. + AmbiguousL7Target { + rule_name: String, + host: String, + ports: Vec, + /// Matching endpoint paths, sorted; an empty string is unscoped. + paths: Vec, + }, + /// The declared binary set differs from the rule's complete binary scope. + L7BinaryScopeMismatch { + rule_name: String, + /// Sorted binary paths or the single marker [`ANY_BINARY_SCOPE`]. + expected: Vec, + /// Sorted declared paths or the single marker [`ANY_BINARY_SCOPE`]. + declared: Vec, + }, + /// The declared ports differ from the selected endpoint's complete port set. + L7PortScopeMismatch { + rule_name: String, + host: String, + expected: Vec, + declared: Vec, }, /// A remove-binary operation targeted a rule that authorizes any binary, /// where there is no binary entry to remove. @@ -483,14 +584,47 @@ impl std::fmt::Display for PolicyMergeError { "{host}:{port} would carry more than one L7 inspection contract ({}); the sandbox resolves one contract per host and port, so these cannot coexist even in different rules or under different paths", contracts.join(", ") ), - Self::AmbiguousEndpointRule { + Self::InvalidL7Target { + operation_index, + reason, + } => write!( + f, + "merge operation {operation_index} has an invalid L7 target: {reason}" + ), + Self::L7TargetNotFound { + rule_name, host, - port, - targets, + ports, + path, + } => write!( + f, + "L7 target in rule '{rule_name}' for {host} on ports {ports:?} with endpoint path {path:?} was not found" + ), + Self::AmbiguousL7Target { + rule_name, + host, + ports, + paths, + } => write!( + f, + "L7 target in rule '{rule_name}' for {host} on ports {ports:?} matches endpoint paths {paths:?}; declare the exact endpoint path" + ), + Self::L7BinaryScopeMismatch { + rule_name, + expected, + declared, } => write!( f, - "endpoint {host}:{port} resolves to {}; this operation selects its target by host and port alone, so it cannot say which binary scope and L7 surface to widen. Replace the policy with the full YAML instead", - targets.join(", ") + "L7 target in rule '{rule_name}' declares binary scope {declared:?}, but the append affects {expected:?}; declare the complete binary scope" + ), + Self::L7PortScopeMismatch { + rule_name, + host, + expected, + declared, + } => write!( + f, + "L7 target in rule '{rule_name}' for {host} declares ports {declared:?}, but the append affects {expected:?}; declare the complete endpoint port set" ), Self::CannotRemoveBinaryFromAnyBinaryScope { operation_index, @@ -1062,6 +1196,11 @@ fn validate_operation( }); } } + if let PolicyMergeOp::AddAllowRules { target, .. } + | PolicyMergeOp::AddDenyRules { target, .. } = operation + { + target.validate(operation_index)?; + } Ok(()) } @@ -1094,37 +1233,25 @@ fn apply_operation( PolicyMergeOp::RemoveRule { rule_name } => { policy.network_policies.remove(rule_name); } - PolicyMergeOp::AddDenyRules { - host, - port, - deny_rules, - } => { - ensure_endpoint_target_is_unambiguous(policy, host, *port)?; - let endpoint = find_endpoint_mut(policy, host, *port).ok_or_else(|| { - PolicyMergeError::EndpointNotFound { - host: host.clone(), - port: *port, - } - })?; - ensure_method_path_endpoint(endpoint, host, *port)?; + PolicyMergeOp::AddDenyRules { target, deny_rules } => { + let endpoint = resolve_l7_target_mut(policy, target)?; + // Target validation guarantees a nonempty port set. Use its first + // port for the existing single-port protocol and preset messages. + let port = target.ports.first().copied().unwrap_or_default(); + ensure_method_path_endpoint(endpoint, &target.host, port)?; if endpoint.access.is_empty() && endpoint.rules.is_empty() { return Err(PolicyMergeError::EndpointHasNoAllowBase { - host: host.clone(), - port: *port, + host: target.host.clone(), + port, }); } append_unique_deny_rules(&mut endpoint.deny_rules, deny_rules); } - PolicyMergeOp::AddAllowRules { host, port, rules } => { - ensure_endpoint_target_is_unambiguous(policy, host, *port)?; - let endpoint = find_endpoint_mut(policy, host, *port).ok_or_else(|| { - PolicyMergeError::EndpointNotFound { - host: host.clone(), - port: *port, - } - })?; - ensure_method_path_endpoint(endpoint, host, *port)?; - expand_existing_access(endpoint, host, *port, warnings)?; + PolicyMergeOp::AddAllowRules { target, rules } => { + let endpoint = resolve_l7_target_mut(policy, target)?; + let port = target.ports.first().copied().unwrap_or_default(); + ensure_method_path_endpoint(endpoint, &target.host, port)?; + expand_existing_access(endpoint, &target.host, port, warnings)?; append_unique_l7_rules(&mut endpoint.rules, rules); } PolicyMergeOp::RemoveBinary { @@ -1339,11 +1466,15 @@ fn is_authorization_inheritance_conflict(error: &PolicyMergeError) -> bool { | PolicyMergeError::EndpointHasNoAllowBase { .. } | PolicyMergeError::EndpointNotFound { .. } | PolicyMergeError::InvalidEndpointReference { .. } - | PolicyMergeError::AmbiguousEndpointRule { .. } => false, + | PolicyMergeError::L7TargetNotFound { .. } + | PolicyMergeError::AmbiguousL7Target { .. } + | PolicyMergeError::L7BinaryScopeMismatch { .. } + | PolicyMergeError::L7PortScopeMismatch { .. } => false, // Malformed operations, and operations `merge_rules` never produces. // Neither is answered by choosing a different rule to write to. PolicyMergeError::InvalidInputPolicy { .. } + | PolicyMergeError::InvalidL7Target { .. } | PolicyMergeError::InvalidOperationPolicy { .. } | PolicyMergeError::InvalidMergedPolicy { .. } | PolicyMergeError::MissingRuleNameForAddRule @@ -1925,89 +2056,110 @@ fn find_matching_endpoint_mut<'a>( .find(|endpoint| endpoints_overlap(endpoint, target)) } -/// Every endpoint `host:port` resolves to, rendered with its owning rule. -/// -/// `endpoint_matches_host_port` deliberately ignores `path`, and -/// `endpoints_overlap` treats a different path as a different endpoint, so one -/// rule can own several matching endpoints. Counting rules alone would miss -/// that, so this counts endpoints. -fn matching_endpoint_targets(policy: &SandboxPolicy, host: &str, port: u32) -> Vec { - let mut targets: Vec = policy +/// Resolve one endpoint without changing it, then require the caller to +/// acknowledge every binary and port that shares its L7 permissions. +fn resolve_l7_target_mut<'a>( + policy: &'a mut SandboxPolicy, + target: &L7RuleTarget, +) -> Result<&'a mut NetworkEndpoint, PolicyMergeError> { + let not_found = || PolicyMergeError::L7TargetNotFound { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + ports: target.ports.clone(), + path: target.path.clone(), + }; + let rule = policy .network_policies + .get_mut(&target.rule_name) + .ok_or_else(not_found)?; + + // Port overlap selects candidates so an incomplete declaration reports the + // full affected port set instead of hiding the mismatch as a missing target. + // Host wildcards are literal selectors here, never destination matching. + let candidates = rule + .endpoints .iter() - .filter(|(key, _)| !is_provider_rule_name(key)) - .flat_map(|(key, rule)| { - rule.endpoints - .iter() - .filter(|endpoint| endpoint_matches_host_port(endpoint, host, port)) - .map(move |endpoint| { - if endpoint.path.is_empty() { - key.clone() - } else { - format!("{key} (path '{}')", endpoint.path) - } - }) + .enumerate() + .filter(|(_, endpoint)| { + endpoint.host.eq_ignore_ascii_case(&target.host) + && canonical_ports(endpoint) + .iter() + .any(|port| target.ports.contains(port)) + && target + .path + .as_ref() + .is_none_or(|path| endpoint.path == *path) }) - .collect(); - targets.sort(); - targets -} + .map(|(index, _)| index) + .collect::>(); + let [index] = candidates.as_slice() else { + if candidates.is_empty() { + return Err(not_found()); + } + let mut paths = candidates + .iter() + .filter_map(|index| rule.endpoints.get(*index)) + .map(|endpoint| endpoint.path.clone()) + .collect::>(); + paths.sort(); + return Err(PolicyMergeError::AmbiguousL7Target { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + ports: target.ports.clone(), + paths, + }); + }; -/// Fails closed when `host:port` resolves to more than one endpoint, because -/// appending an L7 rule widens authorization for every binary on whichever -/// endpoint is picked, and the operation cannot say which one it means. -fn ensure_endpoint_target_is_unambiguous( - policy: &SandboxPolicy, - host: &str, - port: u32, -) -> Result<(), PolicyMergeError> { - let targets = matching_endpoint_targets(policy, host, port); - if targets.len() > 1 { - return Err(PolicyMergeError::AmbiguousEndpointRule { - host: host.to_string(), - port, - targets, + // Compare binary paths as sets, while preserving the semantic distinction + // between any-binary and a restricted set. Diagnostic markers never decide + // scope equality, even if a declared path happens to match their text. + let mut expected_binaries = l7_binary_paths(&rule.binaries); + let mut declared_binaries = match &target.binaries { + L7BinaryScope::Any => Vec::new(), + L7BinaryScope::Restricted(binaries) => l7_binary_paths(binaries), + }; + if rule.binaries.is_empty() != matches!(target.binaries, L7BinaryScope::Any) + || expected_binaries != declared_binaries + { + if expected_binaries.is_empty() { + expected_binaries.push(ANY_BINARY_SCOPE.to_string()); + } + if matches!(target.binaries, L7BinaryScope::Any) { + declared_binaries.push(ANY_BINARY_SCOPE.to_string()); + } + return Err(PolicyMergeError::L7BinaryScopeMismatch { + rule_name: target.rule_name.clone(), + expected: expected_binaries, + declared: declared_binaries, }); } - Ok(()) -} -fn find_endpoint_mut<'a>( - policy: &'a mut SandboxPolicy, - host: &str, - port: u32, -) -> Option<&'a mut NetworkEndpoint> { - // `_provider_*` rules are excluded from this lookup for the same reason - // they're excluded from `add_rule`'s endpoint-overlap fallback: callers - // (`AddAllowRules`, `AddDenyRules`) must not mutate provider-injected - // rules in place. If the operation should target a provider rule, the - // caller should reference it by its exact name through the merge ops - // that take a `rule_name`. Defense-in-depth: even if a future caller - // accidentally passes a composed policy here, `AddAllowRules` would no - // longer be able to expand a provider rule's `access` shorthand into - // wildcard `path: "**"` rules (which would mask the prover's narrowness - // verdict on agent contributions). - let mut keys: Vec<_> = policy.network_policies.keys().cloned().collect(); - keys.sort(); - let target_key = keys - .into_iter() - .filter(|k| !is_provider_rule_name(k)) - .find(|key| { - policy.network_policies.get(key).is_some_and(|rule| { - rule.endpoints - .iter() - .any(|endpoint| endpoint_matches_host_port(endpoint, host, port)) - }) - })?; + let endpoint = rule.endpoints.get_mut(*index).ok_or_else(not_found)?; + let mut expected_ports = canonical_ports(endpoint); + expected_ports.sort_unstable(); + expected_ports.dedup(); + let mut declared_ports = target.ports.clone(); + declared_ports.sort_unstable(); + declared_ports.dedup(); + if expected_ports != declared_ports { + return Err(PolicyMergeError::L7PortScopeMismatch { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + expected: expected_ports, + declared: declared_ports, + }); + } + Ok(endpoint) +} - policy - .network_policies - .get_mut(&target_key) - .and_then(|rule| { - rule.endpoints - .iter_mut() - .find(|endpoint| endpoint_matches_host_port(endpoint, host, port)) - }) +fn l7_binary_paths(binaries: &[NetworkBinary]) -> Vec { + let mut paths = binaries + .iter() + .map(|binary| binary.path.clone()) + .collect::>(); + paths.sort(); + paths.dedup(); + paths } fn endpoint_matches_host_port(endpoint: &NetworkEndpoint, host: &str, port: u32) -> bool { @@ -2221,9 +2373,9 @@ mod tests { use std::collections::HashMap; use super::{ - ANY_BINARY_SCOPE, DEFAULT_JSON_RPC_MAX_BODY_BYTES, PolicyMergeError, PolicyMergeOp, - PolicyMergeWarning, canonical_ports, canonicalize_advisor_add_rule, generated_rule_name, - merge_policy, policy_covers_rule, + ANY_BINARY_SCOPE, DEFAULT_JSON_RPC_MAX_BODY_BYTES, L7BinaryScope, L7RuleTarget, + PolicyMergeError, PolicyMergeOp, PolicyMergeWarning, canonical_ports, + canonicalize_advisor_add_rule, generated_rule_name, merge_policy, policy_covers_rule, }; use crate::{restrictive_default_policy, validate_sandbox_policy}; use openshell_core::{ @@ -2269,6 +2421,44 @@ mod tests { } } + fn l7_target(rule_name: &str, host: &str, ports: &[u32], binaries: &[&str]) -> L7RuleTarget { + L7RuleTarget { + rule_name: rule_name.to_string(), + host: host.to_string(), + ports: ports.to_vec(), + path: None, + binaries: if binaries.is_empty() { + L7BinaryScope::Any + } else { + L7BinaryScope::Restricted( + binaries + .iter() + .map(|path| NetworkBinary { + path: (*path).to_string(), + }) + .collect(), + ) + }, + } + } + + fn l7_operations(target: L7RuleTarget) -> [PolicyMergeOp; 2] { + [ + PolicyMergeOp::AddAllowRules { + target: target.clone(), + rules: vec![rest_rule("POST", "/admin")], + }, + PolicyMergeOp::AddDenyRules { + target, + deny_rules: vec![L7DenyRule { + method: "POST".to_string(), + path: "/admin".to_string(), + ..Default::default() + }], + }, + ] + } + #[test] fn canonicalize_advisor_keeps_new_binary_separate_from_explicit_rule() { let mut existing_endpoint = endpoint("index.crates.io", 443); @@ -2715,8 +2905,7 @@ mod tests { fn merge_reports_the_first_failing_operation_in_request_order() { let operations = [ PolicyMergeOp::AddAllowRules { - host: "missing.example.com".to_string(), - port: 443, + target: l7_target("missing", "missing.example.com", &[443], &[]), rules: vec![rest_rule("GET", "/")], }, PolicyMergeOp::AddRule { @@ -2727,9 +2916,11 @@ mod tests { assert_eq!( merge_policy(restrictive_default_policy(), &operations), - Err(PolicyMergeError::EndpointNotFound { + Err(PolicyMergeError::L7TargetNotFound { + rule_name: "missing".to_string(), host: "missing.example.com".to_string(), - port: 443, + ports: vec![443], + path: None, }) ); } @@ -4060,8 +4251,7 @@ mod tests { let result = merge_policy( policy, &[PolicyMergeOp::AddAllowRules { - host: "api.github.com".to_string(), - port: 443, + target: l7_target("github", "api.github.com", &[443], &[]), rules: vec![rest_rule("POST", "/repos/*/issues")], }], ) @@ -4098,8 +4288,7 @@ mod tests { let result = merge_policy( policy, &[PolicyMergeOp::AddAllowRules { - host: "realtime.example.com".to_string(), - port: 443, + target: l7_target("realtime", "realtime.example.com", &[443], &[]), rules: vec![rest_rule("WEBSOCKET_TEXT", "/rooms/private/**")], }], ) @@ -4144,8 +4333,7 @@ mod tests { let result = merge_policy( policy, &[PolicyMergeOp::AddDenyRules { - host: "realtime.example.com".to_string(), - port: 443, + target: l7_target("realtime", "realtime.example.com", &[443], &[]), deny_rules: vec![L7DenyRule { method: "WEBSOCKET_TEXT".to_string(), path: "/admin/**".to_string(), @@ -4183,8 +4371,7 @@ mod tests { let error = merge_policy( policy, &[PolicyMergeOp::AddDenyRules { - host: "db.example.com".to_string(), - port: 5432, + target: l7_target("db", "db.example.com", &[5432], &[]), deny_rules: vec![L7DenyRule { method: "POST".to_string(), path: "/admin".to_string(), @@ -5429,12 +5616,10 @@ mod tests { )); } - /// `AddAllowRules` and `AddDenyRules` name their target by host and port - /// alone, so when two rules carry that endpoint they cannot say which binary - /// scope to widen. Picking one silently would add the rule to whichever key - /// sorts first. + /// Explicit rule identity selects one owner even when another rule carries + /// the same destination with a different binary scope. #[test] - fn l7_operations_reject_an_endpoint_carried_by_several_rules() { + fn l7_target_scope_selects_named_rule_among_shared_destinations() { let mut policy = policy_with_rule( "broad", rule_with_authorizations( @@ -5460,28 +5645,22 @@ mod tests { ), ); - for operation in [ - PolicyMergeOp::AddAllowRules { - host: "api.example.com".to_string(), - port: 443, - rules: vec![rest_rule("POST", "/admin")], - }, - PolicyMergeOp::AddDenyRules { - host: "api.example.com".to_string(), - port: 443, - deny_rules: Vec::new(), - }, - ] { - let error = merge_policy(policy.clone(), &[operation]) - .expect_err("two rules carry this endpoint, so the target is ambiguous"); - - assert!( - matches!( - &error, - PolicyMergeError::AmbiguousEndpointRule { targets, .. } - if targets == &["broad".to_string(), "narrow".to_string()] - ), - "got {error:?}" + for operation in l7_operations(l7_target( + "narrow", + "api.example.com", + &[443], + &["/usr/bin/other"], + )) { + let result = merge_policy(policy.clone(), &[operation]) + .expect("the explicit named rule and scope select the intended owner"); + assert!(result.changed); + assert_eq!( + result.policy.network_policies["broad"], + policy.network_policies["broad"] + ); + assert_ne!( + result.policy.network_policies["narrow"], + policy.network_policies["narrow"] ); } } @@ -5491,7 +5670,7 @@ mod tests { /// Counting owning rules would miss this and let the operation land on /// whichever endpoint happens to sit first in the vector. #[test] - fn l7_operations_reject_two_paths_on_one_host_and_port_within_a_rule() { + fn l7_target_scope_rejects_two_paths_without_exact_selection() { let policy = policy_with_rule( "versioned", rule_with_authorizations( @@ -5517,8 +5696,12 @@ mod tests { let error = merge_policy( policy, &[PolicyMergeOp::AddAllowRules { - host: "api.example.com".to_string(), - port: 443, + target: l7_target( + "versioned", + "api.example.com", + &[443], + &["/usr/bin/trusted"], + ), rules: vec![rest_rule("POST", "/admin")], }], ) @@ -5527,11 +5710,8 @@ mod tests { assert!( matches!( &error, - PolicyMergeError::AmbiguousEndpointRule { targets, .. } - if targets == &[ - "versioned (path '/v1')".to_string(), - "versioned (path '/v2')".to_string(), - ] + PolicyMergeError::AmbiguousL7Target { paths, .. } + if paths == &["/v1".to_string(), "/v2".to_string()] ), "got {error:?}" ); @@ -5557,8 +5737,7 @@ mod tests { let result = merge_policy( policy, &[PolicyMergeOp::AddAllowRules { - host: "api.example.com".to_string(), - port: 443, + target: l7_target("only", "api.example.com", &[443], &["/usr/bin/trusted"]), rules: vec![rest_rule("POST", "/issues")], }], ) @@ -5572,6 +5751,407 @@ mod tests { ); } + fn l7_scope_policy(binaries: &[&str], ports: &[u32]) -> SandboxPolicy { + policy_with_rule( + "scoped", + rule_with_authorizations( + "display-name-is-not-the-rule-key", + vec![NetworkEndpoint { + protocol: "rest".to_string(), + rules: vec![rest_rule("GET", "/public")], + ports: ports.to_vec(), + ..endpoint("api.example.com", ports[0]) + }], + binaries, + ), + ) + } + + #[test] + fn l7_target_scope_requires_all_binaries_independently_of_ports() { + let policy = l7_scope_policy(&["/usr/bin/trusted", "/usr/bin/limited"], &[443, 8443]); + for binaries in [ + vec!["/usr/bin/trusted"], + vec!["/usr/bin/limited", "/usr/bin/trusted", "/usr/bin/extra"], + vec!["/usr/bin/trusted", "/usr/bin/other"], + Vec::new(), + ] { + for operation in l7_operations(l7_target( + "scoped", + "api.example.com", + &[443, 8443], + &binaries, + )) { + let error = merge_policy(policy.clone(), &[operation]) + .expect_err("every binary on the rule shares the appended permissions"); + assert!(matches!( + error, + PolicyMergeError::L7BinaryScopeMismatch { expected, .. } + if expected == ["/usr/bin/limited", "/usr/bin/trusted"] + )); + } + } + } + + #[test] + fn l7_target_scope_requires_all_ports_independently_of_binaries() { + let policy = l7_scope_policy(&["/usr/bin/trusted"], &[443, 8443]); + for ports in [ + vec![443], + vec![8443], + vec![443, 8443, 9443], + vec![443, 9443], + ] { + for operation in l7_operations(l7_target( + "scoped", + "api.example.com", + &ports, + &["/usr/bin/trusted"], + )) { + let error = merge_policy(policy.clone(), &[operation]) + .expect_err("all endpoint ports share the appended permissions"); + assert_eq!( + error, + PolicyMergeError::L7PortScopeMismatch { + rule_name: "scoped".to_string(), + host: "api.example.com".to_string(), + expected: vec![443, 8443], + declared: ports.clone(), + } + ); + } + } + } + + #[test] + fn l7_target_scope_complete_sets_apply_once_without_changing_siblings() { + let mut policy = l7_scope_policy(&["/usr/bin/trusted", "/usr/bin/limited"], &[443, 8443]); + let sibling = NetworkEndpoint { + protocol: "rest".to_string(), + rules: vec![rest_rule("GET", "/public")], + ..endpoint("other.example.com", 443) + }; + policy + .network_policies + .get_mut("scoped") + .unwrap() + .endpoints + .push(sibling.clone()); + for operation in l7_operations(l7_target( + "scoped", + "api.example.com", + &[443, 8443], + &["/usr/bin/trusted", "/usr/bin/limited"], + )) { + let result = merge_policy(policy.clone(), std::slice::from_ref(&operation)) + .expect("complete affected scope authorizes the append"); + let rule = &result.policy.network_policies["scoped"]; + assert!(result.changed); + assert_eq!(rule.binaries, policy.network_policies["scoped"].binaries); + assert_eq!(canonical_ports(&rule.endpoints[0]), vec![443, 8443]); + assert_eq!(rule.endpoints[1], sibling); + match &operation { + PolicyMergeOp::AddAllowRules { rules, .. } => { + assert!(rule.endpoints[0].rules.contains(&rules[0])); + } + PolicyMergeOp::AddDenyRules { deny_rules, .. } => { + assert_eq!(rule.endpoints[0].deny_rules, *deny_rules); + } + _ => unreachable!("test fixture only emits L7 appends"), + } + let replay = + merge_policy(result.policy, &[operation]).expect("repeated append remains valid"); + assert!(!replay.changed, "duplicate rules must remain idempotent"); + } + } + + #[test] + fn l7_target_scope_normalizes_case_and_duplicate_set_entries() { + let policy = l7_scope_policy( + &["/usr/bin/trusted", "/usr/bin/limited", "/usr/bin/trusted"], + &[8443, 443, 443], + ); + for operation in l7_operations(l7_target( + "scoped", + "API.EXAMPLE.COM", + &[443, 8443, 8443], + &["/usr/bin/limited", "/usr/bin/trusted", "/usr/bin/limited"], + )) { + let result = merge_policy(policy.clone(), &[operation]) + .expect("host case, ordering, and duplicated declarations do not change scope"); + assert!(result.changed); + } + } + + #[test] + fn l7_target_scope_any_binary_requires_explicit_any_declaration() { + let policy = l7_scope_policy(&[], &[443]); + for operation in l7_operations(l7_target("scoped", "api.example.com", &[443], &[])) { + assert!( + merge_policy(policy.clone(), &[operation]) + .expect("Any explicitly names wildcard scope") + .changed + ); + } + for binaries in [vec!["/usr/bin/trusted"], vec![ANY_BINARY_SCOPE]] { + for operation in + l7_operations(l7_target("scoped", "api.example.com", &[443], &binaries)) + { + let error = merge_policy(policy.clone(), &[operation]) + .expect_err("concrete paths cannot acknowledge any-binary scope"); + assert_eq!( + error, + PolicyMergeError::L7BinaryScopeMismatch { + rule_name: "scoped".to_string(), + expected: vec![ANY_BINARY_SCOPE.to_string()], + declared: binaries.iter().map(|path| (*path).to_string()).collect(), + } + ); + } + } + } + + #[test] + fn l7_target_scope_rejects_malformed_declarations_at_library_boundary() { + let valid = l7_target("scoped", "api.example.com", &[443], &["/usr/bin/trusted"]); + let invalid = [ + L7RuleTarget { + rule_name: String::new(), + ..valid.clone() + }, + L7RuleTarget { + rule_name: " scoped ".to_string(), + ..valid.clone() + }, + L7RuleTarget { + host: " ".to_string(), + ..valid.clone() + }, + L7RuleTarget { + host: "https://api.example.com".to_string(), + ..valid.clone() + }, + L7RuleTarget { + host: "*".to_string(), + ..valid.clone() + }, + L7RuleTarget { + ports: Vec::new(), + ..valid.clone() + }, + L7RuleTarget { + ports: vec![0], + ..valid.clone() + }, + L7RuleTarget { + ports: vec![65536], + ..valid.clone() + }, + L7RuleTarget { + binaries: L7BinaryScope::Restricted(Vec::new()), + ..valid.clone() + }, + L7RuleTarget { + binaries: L7BinaryScope::Restricted(vec![NetworkBinary { + path: " ".to_string(), + }]), + ..valid + }, + ]; + let policy = l7_scope_policy(&["/usr/bin/trusted"], &[443]); + for target in invalid { + assert!(matches!( + target.validate(7), + Err(PolicyMergeError::InvalidL7Target { + operation_index: 7, + .. + }) + )); + for operation in l7_operations(target) { + assert!(matches!( + merge_policy(policy.clone(), &[operation]), + Err(PolicyMergeError::InvalidL7Target { + operation_index: 0, + .. + }) + )); + } + } + } + + #[test] + fn l7_target_scope_never_falls_back_from_missing_explicit_target() { + let valid = l7_target("scoped", "api.example.com", &[443], &["/usr/bin/trusted"]); + let missing = [ + L7RuleTarget { + rule_name: "display-name-is-not-the-rule-key".to_string(), + ..valid.clone() + }, + L7RuleTarget { + host: "other.example.com".to_string(), + ..valid.clone() + }, + L7RuleTarget { + ports: vec![8443], + ..valid.clone() + }, + L7RuleTarget { + path: Some("/missing".to_string()), + ..valid + }, + ]; + let policy = l7_scope_policy(&["/usr/bin/trusted"], &[443]); + for target in missing { + for operation in l7_operations(target.clone()) { + assert_eq!( + merge_policy(policy.clone(), &[operation]), + Err(PolicyMergeError::L7TargetNotFound { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + ports: target.ports.clone(), + path: target.path.clone(), + }) + ); + } + } + } + + #[test] + fn l7_target_scope_selects_exact_path_including_unscoped_endpoint() { + let mut policy = l7_scope_policy(&["/usr/bin/trusted"], &[443]); + let rule = policy.network_policies.get_mut("scoped").unwrap(); + let mut versioned = rule.endpoints[0].clone(); + versioned.path = "/v1".to_string(); + rule.endpoints.push(versioned); + let valid = l7_target("scoped", "api.example.com", &[443], &["/usr/bin/trusted"]); + for operation in l7_operations(valid.clone()) { + assert!( + matches!(merge_policy(policy.clone(), &[operation]), Err(PolicyMergeError::AmbiguousL7Target { paths, .. }) if paths == ["", "/v1"]) + ); + } + for (selected, path) in ["", "/v1"].iter().enumerate() { + let target = L7RuleTarget { + path: Some((*path).to_string()), + ..valid.clone() + }; + for operation in l7_operations(target) { + let result = merge_policy(policy.clone(), &[operation]) + .expect("exact endpoint path selects one target"); + let endpoints = &result.policy.network_policies["scoped"].endpoints; + assert_ne!( + endpoints[selected], + policy.network_policies["scoped"].endpoints[selected] + ); + assert_eq!( + endpoints[1 - selected], + policy.network_policies["scoped"].endpoints[1 - selected] + ); + } + } + for operation in l7_operations(L7RuleTarget { + path: Some("/V1".to_string()), + ..valid + }) { + assert!(matches!( + merge_policy(policy.clone(), &[operation]), + Err(PolicyMergeError::L7TargetNotFound { .. }) + )); + } + } + + #[test] + fn l7_target_scope_host_wildcards_are_literal_endpoint_selectors() { + let mut policy = l7_scope_policy(&["/usr/bin/trusted"], &[443]); + policy.network_policies.get_mut("scoped").unwrap().endpoints[0].host = + "*.example.com".to_string(); + for operation in l7_operations(l7_target( + "scoped", + "api.example.com", + &[443], + &["/usr/bin/trusted"], + )) { + assert!(matches!( + merge_policy(policy.clone(), &[operation]), + Err(PolicyMergeError::L7TargetNotFound { .. }) + )); + } + for operation in l7_operations(l7_target( + "scoped", + "*.EXAMPLE.COM", + &[443], + &["/usr/bin/trusted"], + )) { + assert!( + merge_policy(policy.clone(), &[operation]) + .expect("the complete wildcard selector is explicit") + .changed + ); + } + } + + #[test] + fn l7_target_scope_provider_owned_rule_is_immutable() { + let mut policy = l7_scope_policy(&[], &[443]); + let provider = policy.network_policies.remove("scoped").unwrap(); + policy + .network_policies + .insert("_provider_api".to_string(), provider); + for operation in l7_operations(l7_target("_provider_api", "api.example.com", &[443], &[])) { + assert!(matches!( + merge_policy(policy.clone(), &[operation]), + Err(PolicyMergeError::InvalidL7Target { .. }) + )); + } + } + + #[test] + fn l7_target_scope_rejects_duplicate_endpoint_candidates_even_with_exact_path() { + let mut policy = l7_scope_policy(&["/usr/bin/trusted"], &[443]); + let rule = policy.network_policies.get_mut("scoped").unwrap(); + let mut overlapping = rule.endpoints[0].clone(); + overlapping.ports = vec![443, 8443]; + rule.endpoints.push(overlapping); + let mut target = l7_target( + "scoped", + "api.example.com", + &[443, 8443], + &["/usr/bin/trusted"], + ); + target.path = Some(String::new()); + for operation in l7_operations(target) { + assert!( + matches!(merge_policy(policy.clone(), &[operation]), Err(PolicyMergeError::AmbiguousL7Target { paths, .. }) if paths == ["", ""]) + ); + } + } + + #[test] + fn l7_target_scope_batch_uses_scope_after_earlier_operations() { + let policy = l7_scope_policy(&["/usr/bin/trusted", "/usr/bin/limited"], &[443]); + for operation in l7_operations(l7_target( + "scoped", + "api.example.com", + &[443], + &["/usr/bin/trusted", "/usr/bin/limited"], + )) { + let error = merge_policy( + policy.clone(), + &[ + PolicyMergeOp::RemoveBinary { + rule_name: "scoped".to_string(), + binary_path: "/usr/bin/limited".to_string(), + }, + operation, + ], + ) + .expect_err("stale declarations reject the complete batch"); + assert!( + matches!(error, PolicyMergeError::L7BinaryScopeMismatch { expected, declared, .. } + if expected == ["/usr/bin/trusted"] && declared == ["/usr/bin/limited", "/usr/bin/trusted"]) + ); + } + } + /// Removing a binary from an any-binary rule has no entry to drop, so /// reporting success would leave the operator believing a revocation landed /// while the rule still authorizes every binary. diff --git a/crates/openshell-server/src/grpc/policy.rs b/crates/openshell-server/src/grpc/policy.rs index 36afaf7aa6..d874143cf7 100644 --- a/crates/openshell-server/src/grpc/policy.rs +++ b/crates/openshell-server/src/grpc/policy.rs @@ -50,12 +50,13 @@ use openshell_core::proto::{ GetSandboxConfigResponse, GetSandboxLogsRequest, GetSandboxLogsResponse, GetSandboxPolicyStatusRequest, GetSandboxPolicyStatusResponse, GetSandboxProviderEnvironmentRequest, GetSandboxProviderEnvironmentResponse, - ListSandboxPoliciesRequest, ListSandboxPoliciesResponse, PolicyChunk, PolicyMergeOperation, - PolicySource, PolicyStatus, ProviderReadinessReason, PushSandboxLogsRequest, - PushSandboxLogsResponse, RejectDraftChunkRequest, RejectDraftChunkResponse, - ReportPolicyStatusRequest, ReportPolicyStatusResponse, SandboxLogLine, SandboxPolicyRevision, - SettingScope, SettingValue, SubmitPolicyAnalysisRequest, SubmitPolicyAnalysisResponse, - UndoDraftChunkRequest, UndoDraftChunkResponse, UpdateConfigRequest, UpdateConfigResponse, + L7RuleTarget as ProtoL7RuleTarget, ListSandboxPoliciesRequest, ListSandboxPoliciesResponse, + PolicyChunk, PolicyMergeOperation, PolicySource, PolicyStatus, ProviderReadinessReason, + PushSandboxLogsRequest, PushSandboxLogsResponse, RejectDraftChunkRequest, + RejectDraftChunkResponse, ReportPolicyStatusRequest, ReportPolicyStatusResponse, + SandboxLogLine, SandboxPolicyRevision, SettingScope, SettingValue, SubmitPolicyAnalysisRequest, + SubmitPolicyAnalysisResponse, UndoDraftChunkRequest, UndoDraftChunkResponse, + UpdateConfigRequest, UpdateConfigResponse, }; use openshell_core::proto::{ L7DenyRule, L7Rule, NetworkBinary, NetworkEndpoint, NetworkPolicyRule, Provider, Sandbox, @@ -74,8 +75,9 @@ use openshell_ocsf::{ ConfigStateChangeBuilder, EventContext, OCSF_TARGET, OcsfEvent, SeverityId, StateId, StatusId, }; use openshell_policy::{ - PolicyMergeOp, ProviderPolicyLayer, canonicalize_advisor_add_rule, compose_effective_policy, - merge_policy, policy_covers_rule, serialize_sandbox_policy, strip_provider_rule_names, + L7BinaryScope, L7RuleTarget, PolicyMergeOp, ProviderPolicyLayer, canonicalize_advisor_add_rule, + compose_effective_policy, merge_policy, policy_covers_rule, serialize_sandbox_policy, + strip_provider_rule_names, }; use openshell_prover::{ credentials::{Credential, CredentialSet}, @@ -368,20 +370,18 @@ fn summarize_cli_policy_merge_op(operation: &PolicyMergeOp) -> String { |rule_name| format!("remove-endpoint {host}:{port} from rule {rule_name}"), ), PolicyMergeOp::RemoveRule { rule_name } => format!("remove-rule {rule_name}"), - PolicyMergeOp::AddDenyRules { - host, - port, - deny_rules, - } => format!( - "add-deny {host}:{port} [{}]", + PolicyMergeOp::AddDenyRules { target, deny_rules } => format!( + "add-deny {} [{}]", + summarize_l7_target(target), deny_rules .iter() .map(summarize_l7_deny_rule) .collect::>() .join(", ") ), - PolicyMergeOp::AddAllowRules { host, port, rules } => format!( - "add-allow {host}:{port} [{}]", + PolicyMergeOp::AddAllowRules { target, rules } => format!( + "add-allow {} [{}]", + summarize_l7_target(target), rules .iter() .map(summarize_l7_rule) @@ -395,6 +395,29 @@ fn summarize_cli_policy_merge_op(operation: &PolicyMergeOp) -> String { } } +fn summarize_l7_target(target: &L7RuleTarget) -> String { + let ports = target + .ports + .iter() + .map(u32::to_string) + .collect::>() + .join(","); + let binaries = match &target.binaries { + L7BinaryScope::Any => "any".to_string(), + L7BinaryScope::Restricted(binaries) => binaries + .iter() + .map(|binary| binary.path.as_str()) + .collect::>() + .join(", "), + }; + // Preserve optional path presence in the audit trail: None means unique + // endpoint selection, while Some("") selects an endpoint with no path scope. + format!( + "{}:{ports} rule={} endpoint-path={:?} binaries=[{binaries}]", + target.host, target.rule_name, target.path, + ) +} + fn ensure_chunk_belongs_to_sandbox( chunk: &DraftChunkRecord, sandbox_id: &str, @@ -6471,18 +6494,14 @@ fn parse_proto_add_deny_rules( index: usize, add_deny_rules: &ProtoAddDenyRules, ) -> Result { - if add_deny_rules.host.trim().is_empty() - || add_deny_rules.port == 0 - || add_deny_rules.deny_rules.is_empty() - { + if add_deny_rules.deny_rules.is_empty() { return Err(Status::invalid_argument(format!( - "merge_operations[{index}].add_deny_rules requires host, non-zero port, and at least one deny rule" + "merge_operations[{index}].add_deny_rules requires at least one deny rule" ))); } Ok(PolicyMergeOp::AddDenyRules { - host: add_deny_rules.host.trim().to_string(), - port: add_deny_rules.port, + target: parse_proto_l7_target(index, add_deny_rules.target.as_ref())?, deny_rules: add_deny_rules.deny_rules.clone(), }) } @@ -6491,12 +6510,9 @@ fn parse_proto_add_allow_rules( index: usize, add_allow_rules: &ProtoAddAllowRules, ) -> Result { - if add_allow_rules.host.trim().is_empty() - || add_allow_rules.port == 0 - || add_allow_rules.rules.is_empty() - { + if add_allow_rules.rules.is_empty() { return Err(Status::invalid_argument(format!( - "merge_operations[{index}].add_allow_rules requires host, non-zero port, and at least one allow rule" + "merge_operations[{index}].add_allow_rules requires at least one allow rule" ))); } if add_allow_rules @@ -6510,12 +6526,40 @@ fn parse_proto_add_allow_rules( } Ok(PolicyMergeOp::AddAllowRules { - host: add_allow_rules.host.trim().to_string(), - port: add_allow_rules.port, + target: parse_proto_l7_target(index, add_allow_rules.target.as_ref())?, rules: add_allow_rules.rules.clone(), }) } +fn parse_proto_l7_target( + index: usize, + target: Option<&ProtoL7RuleTarget>, +) -> Result { + let target = target.ok_or_else(|| { + Status::invalid_argument(format!("merge_operations[{index}] requires an L7 target")) + })?; + // An omitted binary declaration must never become any-binary authority. + // The wire format permits both fields, so enforce the exclusive choice here. + let binaries = match (target.any_binary, target.binaries.is_empty()) { + (true, true) => L7BinaryScope::Any, + (false, false) => L7BinaryScope::Restricted(target.binaries.clone()), + _ => { + return Err(Status::invalid_argument(format!( + "merge_operations[{index}].target requires exactly one of any_binary=true or nonempty binaries" + ))); + } + }; + let target = L7RuleTarget { + rule_name: target.rule_name.clone(), + host: target.host.clone(), + ports: target.ports.clone(), + path: target.path.clone(), + binaries, + }; + target.validate(index).map_err(map_policy_merge_error)?; + Ok(target) +} + fn validate_merge_operations_for_server(operations: &[PolicyMergeOp]) -> Result<(), Status> { for operation in operations { match operation { @@ -6527,7 +6571,9 @@ fn validate_merge_operations_for_server(operations: &[PolicyMergeOp]) -> Result< } validate_rule_not_always_blocked(rule)?; } - PolicyMergeOp::AddAllowRules { host, .. } => validate_host_not_always_blocked(host)?, + PolicyMergeOp::AddAllowRules { target, .. } => { + validate_host_not_always_blocked(&target.host)?; + } _ => {} } } @@ -6540,6 +6586,7 @@ fn map_policy_merge_error(error: openshell_policy::PolicyMergeError) -> Status { | openshell_policy::PolicyMergeError::MissingRuleNameForAddRule | openshell_policy::PolicyMergeError::EmptyAddRuleEndpoints { .. } | openshell_policy::PolicyMergeError::InvalidEndpointReference { .. } + | openshell_policy::PolicyMergeError::InvalidL7Target { .. } | openshell_policy::PolicyMergeError::UnsupportedAccessPreset { .. } => { Status::invalid_argument(error.to_string()) } @@ -6551,7 +6598,9 @@ fn map_policy_merge_error(error: openshell_policy::PolicyMergeError) -> Status { } | openshell_policy::PolicyMergeError::UndeclaredPortWouldChange { .. } | openshell_policy::PolicyMergeError::ConflictingInspectionContracts { .. } - | openshell_policy::PolicyMergeError::AmbiguousEndpointRule { .. } + | openshell_policy::PolicyMergeError::AmbiguousL7Target { .. } + | openshell_policy::PolicyMergeError::L7BinaryScopeMismatch { .. } + | openshell_policy::PolicyMergeError::L7PortScopeMismatch { .. } | openshell_policy::PolicyMergeError::CannotRemoveBinaryFromAnyBinaryScope { .. } | openshell_policy::PolicyMergeError::EndpointNotFound { .. } | openshell_policy::PolicyMergeError::EndpointHasNoL7Inspection { .. } @@ -6562,6 +6611,9 @@ fn map_policy_merge_error(error: openshell_policy::PolicyMergeError) -> Status { openshell_policy::PolicyMergeError::InvalidMergedPolicy { .. } => { Status::internal(error.to_string()) } + openshell_policy::PolicyMergeError::L7TargetNotFound { .. } => { + Status::not_found(error.to_string()) + } } } @@ -9361,6 +9413,408 @@ mod tests { assert!(err.message().contains("reserved '_provider_' prefix")); } + fn l7_scope_target() -> ProtoL7RuleTarget { + ProtoL7RuleTarget { + rule_name: "selected".to_string(), + host: "api.example.com".to_string(), + ports: vec![443, 8443], + path: Some(String::new()), + binaries: vec![ + NetworkBinary { + path: "/usr/bin/curl".to_string(), + }, + NetworkBinary { + path: "/usr/bin/python3".to_string(), + }, + ], + any_binary: false, + } + } + + fn l7_scope_operation(target: Option, deny: bool) -> PolicyMergeOperation { + let operation = if deny { + policy_merge_operation::Operation::AddDenyRules(ProtoAddDenyRules { + target, + deny_rules: vec![L7DenyRule { + method: "POST".to_string(), + path: "/admin".to_string(), + ..Default::default() + }], + }) + } else { + policy_merge_operation::Operation::AddAllowRules(ProtoAddAllowRules { + target, + rules: vec![L7Rule { + allow: Some(openshell_core::proto::L7Allow { + method: "POST".to_string(), + path: "/admin".to_string(), + ..Default::default() + }), + }], + }) + }; + PolicyMergeOperation { + operation: Some(operation), + } + } + + fn l7_scope_policy() -> ProtoSandboxPolicy { + let endpoint = NetworkEndpoint { + host: "api.example.com".to_string(), + port: 443, + ports: vec![443, 8443], + protocol: "rest".to_string(), + tls: "terminate".to_string(), + access: "read-only".to_string(), + ..Default::default() + }; + let selected = NetworkPolicyRule { + name: "selected".to_string(), + endpoints: vec![ + endpoint.clone(), + NetworkEndpoint { + path: "/v1/**".to_string(), + ..endpoint.clone() + }, + ], + binaries: l7_scope_target().binaries, + }; + let sibling = NetworkPolicyRule { + name: "sibling".to_string(), + endpoints: vec![endpoint], + binaries: vec![NetworkBinary { + path: "/usr/bin/wget".to_string(), + }], + }; + validate_and_canonicalize_policy(ProtoSandboxPolicy { + network_policies: HashMap::from([ + ("selected".to_string(), selected), + ("sibling".to_string(), sibling), + ]), + ..Default::default() + }) + .expect("L7 scope fixture must be a valid policy") + } + + #[test] + fn l7_target_scope_ingress_requires_target_and_exclusive_binary_declaration() { + for deny in [false, true] { + let missing = parse_merge_operations(&[l7_scope_operation(None, deny)]).unwrap_err(); + assert_eq!(missing.code(), Code::InvalidArgument); + + let mut omitted = l7_scope_target(); + omitted.binaries.clear(); + let mut contradictory = l7_scope_target(); + contradictory.any_binary = true; + for target in [omitted, contradictory] { + let error = parse_merge_operations(&[l7_scope_operation(Some(target), deny)]) + .expect_err("binary scope must be explicit and exclusive"); + assert_eq!(error.code(), Code::InvalidArgument); + assert!(error.message().contains("exactly one")); + } + + let mut any = l7_scope_target(); + any.any_binary = true; + any.binaries.clear(); + let operations = + parse_merge_operations(&[l7_scope_operation(Some(any), deny)]).unwrap(); + let (PolicyMergeOp::AddAllowRules { target, .. } + | PolicyMergeOp::AddDenyRules { target, .. }) = &operations[0] + else { + panic!("L7 operation expected"); + }; + assert_eq!(target.binaries, L7BinaryScope::Any); + assert_eq!(target.path.as_deref(), Some("")); + } + } + + #[test] + fn l7_target_scope_ingress_rejects_malformed_targets() { + let mut invalid_targets = Vec::new(); + let mut target = l7_scope_target(); + target.rule_name.clear(); + invalid_targets.push(target); + let mut target = l7_scope_target(); + target.rule_name = "_provider_example".to_string(); + invalid_targets.push(target); + let mut target = l7_scope_target(); + target.host = "https://api.example.com".to_string(); + invalid_targets.push(target); + for ports in [vec![], vec![0], vec![65536]] { + let mut target = l7_scope_target(); + target.ports = ports; + invalid_targets.push(target); + } + let mut target = l7_scope_target(); + target.binaries[0].path.clear(); + invalid_targets.push(target); + + for target in invalid_targets { + for deny in [false, true] { + let error = + parse_merge_operations(&[l7_scope_operation(Some(target.clone()), deny)]) + .expect_err("malformed L7 target must fail at request ingress"); + assert_eq!(error.code(), Code::InvalidArgument, "{target:?}"); + } + } + } + + #[test] + fn l7_target_scope_ingress_preserves_existing_payload_guards() { + for operation in [ + policy_merge_operation::Operation::AddAllowRules(ProtoAddAllowRules { + target: Some(l7_scope_target()), + rules: vec![], + }), + policy_merge_operation::Operation::AddDenyRules(ProtoAddDenyRules { + target: Some(l7_scope_target()), + deny_rules: vec![], + }), + policy_merge_operation::Operation::AddAllowRules(ProtoAddAllowRules { + target: Some(l7_scope_target()), + rules: vec![L7Rule { allow: None }], + }), + ] { + let error = parse_merge_operations(&[PolicyMergeOperation { + operation: Some(operation), + }]) + .expect_err("target presence does not make an empty payload valid"); + assert_eq!(error.code(), Code::InvalidArgument); + } + } + + #[tokio::test] + async fn l7_target_scope_update_config_rejects_batch_without_persistence() { + let state = test_server_state().await; + let policy = l7_scope_policy(); + let sandbox_id = "l7-scope-rejected"; + let mut sandbox = test_sandbox(sandbox_id, sandbox_id, policy.clone(), Vec::new()); + sandbox.metadata.as_mut().unwrap().annotations = + HashMap::from([("example.com/owner".to_string(), "original".to_string())]); + state.store.put_message(&sandbox).await.unwrap(); + state + .store + .put_policy_revision( + "l7-scope-seed", + sandbox_id, + "default", + 1, + &policy.encode_to_vec(), + &deterministic_policy_hash(&policy), + ) + .await + .unwrap(); + let before = state + .store + .get_message_by_name::("default", sandbox_id) + .await + .unwrap() + .unwrap(); + let before_revision = state + .store + .get_latest_policy(sandbox_id) + .await + .unwrap() + .unwrap(); + + let mut missing_binary = l7_scope_target(); + missing_binary.binaries.pop(); + let mut missing_port = l7_scope_target(); + missing_port.ports = vec![443]; + let mut ambiguous = l7_scope_target(); + ambiguous.path = None; + let mut missing_rule = l7_scope_target(); + missing_rule.rule_name = "absent".to_string(); + let mut wrong_any = l7_scope_target(); + wrong_any.binaries.clear(); + wrong_any.any_binary = true; + let cases = [ + (None, Code::InvalidArgument, "target"), + ( + Some(missing_binary), + Code::FailedPrecondition, + "/usr/bin/python3", + ), + (Some(missing_port), Code::FailedPrecondition, "8443"), + (Some(ambiguous), Code::FailedPrecondition, "/v1/**"), + (Some(missing_rule), Code::NotFound, "absent"), + (Some(wrong_any), Code::FailedPrecondition, "/usr/bin/curl"), + ]; + + for (target, code, detail) in cases { + for deny in [false, true] { + // The first operation is valid and changes the private candidate. + // A failure in the second must roll back policy and metadata together. + let error = handle_update_config( + &state, + with_user(Request::new(UpdateConfigRequest { + name: sandbox_id.to_string(), + merge_operations: vec![ + l7_scope_operation(Some(l7_scope_target()), false), + l7_scope_operation(target.clone(), deny), + ], + expected_resource_version: before + .metadata + .as_ref() + .unwrap() + .resource_version, + annotations: HashMap::from([( + "example.com/change".to_string(), + "rejected".to_string(), + )]), + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + ..Default::default() + })), + ) + .await + .expect_err("incomplete or ambiguous target must reject the batch"); + assert_eq!(error.code(), code, "{detail}, deny={deny}: {error}"); + assert!(error.message().contains(detail), "{error}"); + let after = state + .store + .get_message_by_name::("default", sandbox_id) + .await + .unwrap() + .unwrap(); + assert_eq!( + after, before, + "rejected batch must preserve all sandbox metadata and spec" + ); + let revision = state + .store + .get_latest_policy(sandbox_id) + .await + .unwrap() + .unwrap(); + assert_eq!(revision.version, before_revision.version); + assert_eq!(revision.policy_hash, before_revision.policy_hash); + assert_eq!(revision.policy_payload, before_revision.policy_payload); + assert_eq!( + state + .store + .list_policies(sandbox_id, 10, 0) + .await + .unwrap() + .len(), + 1 + ); + } + } + } + + #[tokio::test] + async fn l7_target_scope_update_config_changes_only_selected_endpoint() { + for deny in [false, true] { + let state = test_server_state().await; + let policy = l7_scope_policy(); + let sandbox_id = "l7-scope-selected"; + state + .store + .put_message(&test_sandbox( + sandbox_id, + sandbox_id, + policy.clone(), + Vec::new(), + )) + .await + .unwrap(); + let initial_hash = deterministic_policy_hash(&policy); + state + .store + .put_policy_revision( + "l7-scope-seed", + sandbox_id, + "default", + 1, + &policy.encode_to_vec(), + &initial_hash, + ) + .await + .unwrap(); + let before = state + .store + .get_message_by_name::("default", sandbox_id) + .await + .unwrap() + .unwrap(); + let mut target = l7_scope_target(); + target.host = "API.EXAMPLE.COM".to_string(); + target.ports = vec![8443, 443, 8443]; + target.binaries.reverse(); + target.binaries.push(target.binaries[0].clone()); + let response = handle_update_config( + &state, + with_user(Request::new(UpdateConfigRequest { + name: sandbox_id.to_string(), + merge_operations: vec![l7_scope_operation(Some(target), deny)], + expected_resource_version: before.metadata.as_ref().unwrap().resource_version, + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + ..Default::default() + })), + ) + .await + .expect("complete explicit scope must resolve the selected endpoint") + .into_inner(); + assert_eq!(response.version, 2); + assert_ne!(response.policy_hash, initial_hash); + let revision = state + .store + .get_latest_policy(sandbox_id) + .await + .unwrap() + .unwrap(); + let after = ProtoSandboxPolicy::decode(revision.policy_payload.as_slice()).unwrap(); + assert_eq!( + after.network_policies["sibling"], + policy.network_policies["sibling"] + ); + let before_rule = &policy.network_policies["selected"]; + let after_rule = &after.network_policies["selected"]; + assert_eq!(after_rule.binaries, before_rule.binaries); + assert_eq!(after_rule.endpoints.len(), before_rule.endpoints.len()); + assert_eq!( + after_rule + .endpoints + .iter() + .find(|endpoint| !endpoint.path.is_empty()), + before_rule + .endpoints + .iter() + .find(|endpoint| !endpoint.path.is_empty()), + ); + let endpoint = after_rule + .endpoints + .iter() + .find(|endpoint| endpoint.path.is_empty()) + .unwrap(); + if deny { + assert!( + endpoint + .deny_rules + .iter() + .any(|rule| rule.method == "POST" && rule.path == "/admin") + ); + } else { + assert!(endpoint.rules.iter().any(|rule| { + rule.allow + .as_ref() + .is_some_and(|allow| allow.method == "POST" && allow.path == "/admin") + })); + } + assert_eq!( + state + .store + .list_policies(sandbox_id, 10, 0) + .await + .unwrap() + .len(), + 2 + ); + assert_eq!(revision.policy_hash, response.policy_hash); + assert_eq!(revision.policy_hash, deterministic_policy_hash(&after)); + } + } + #[test] fn policy_merge_error_mapping_distinguishes_request_shape_from_state_conflicts() { let invalid_operation = @@ -9414,18 +9868,53 @@ mod tests { // detail must survive into the status message. assert!(existing_scope.message().contains("/usr/bin/other")); - // Both of these describe a well-formed request the current policy state - // forbids, so they are preconditions rather than argument errors. + let invalid_target = + map_policy_merge_error(openshell_policy::PolicyMergeError::InvalidL7Target { + operation_index: 0, + reason: "ports are required".to_string(), + }); + assert_eq!(invalid_target.code(), Code::InvalidArgument); + + let missing = + map_policy_merge_error(openshell_policy::PolicyMergeError::L7TargetNotFound { + rule_name: "missing".to_string(), + host: "api.example.com".to_string(), + ports: vec![443], + path: None, + }); + assert_eq!(missing.code(), Code::NotFound); + + // Ambiguous or incomplete declarations describe a well-formed request + // the current policy forbids, so they are preconditions. let ambiguous = - map_policy_merge_error(openshell_policy::PolicyMergeError::AmbiguousEndpointRule { + map_policy_merge_error(openshell_policy::PolicyMergeError::AmbiguousL7Target { + rule_name: "selected".to_string(), host: "api.example.com".to_string(), - port: 443, - targets: vec!["broad".to_string(), "narrow".to_string()], + ports: vec![443], + paths: vec!["/v1/**".to_string(), "/v2/**".to_string()], }); assert_eq!(ambiguous.code(), Code::FailedPrecondition); - // The operator has to know which rules collide to pick a way forward. - assert!(ambiguous.message().contains("broad")); - assert!(ambiguous.message().contains("narrow")); + assert!(ambiguous.message().contains("/v1/**")); + assert!(ambiguous.message().contains("/v2/**")); + + let binary_scope = + map_policy_merge_error(openshell_policy::PolicyMergeError::L7BinaryScopeMismatch { + rule_name: "selected".to_string(), + expected: vec!["/usr/bin/curl".to_string(), "/usr/bin/python3".to_string()], + declared: vec!["/usr/bin/curl".to_string()], + }); + assert_eq!(binary_scope.code(), Code::FailedPrecondition); + assert!(binary_scope.message().contains("/usr/bin/python3")); + + let port_scope = + map_policy_merge_error(openshell_policy::PolicyMergeError::L7PortScopeMismatch { + rule_name: "selected".to_string(), + host: "api.example.com".to_string(), + expected: vec![443, 8443], + declared: vec![443], + }); + assert_eq!(port_scope.code(), Code::FailedPrecondition); + assert!(port_scope.message().contains("8443")); let undeclared_port = map_policy_merge_error( openshell_policy::PolicyMergeError::UndeclaredPortWouldChange { @@ -17839,8 +18328,15 @@ mod tests { #[test] fn summarize_cli_policy_merge_op_formats_rest_allow_rules() { let operation = PolicyMergeOp::AddAllowRules { - host: "api.github.com".to_string(), - port: 443, + target: L7RuleTarget { + rule_name: "github".to_string(), + host: "api.github.com".to_string(), + ports: vec![443], + path: Some(String::new()), + binaries: L7BinaryScope::Restricted(vec![NetworkBinary { + path: "/usr/bin/curl".to_string(), + }]), + }, rules: vec![L7Rule { allow: Some(openshell_core::proto::L7Allow { method: "POST".to_string(), @@ -17857,7 +18353,7 @@ mod tests { assert_eq!( summarize_cli_policy_merge_op(&operation), - "add-allow api.github.com:443 [POST /repos/*/issues]" + "add-allow api.github.com:443 rule=github endpoint-path=Some(\"\") binaries=[/usr/bin/curl] [POST /repos/*/issues]" ); } @@ -18234,8 +18730,13 @@ mod tests { .unwrap(); let add_allow = [PolicyMergeOp::AddAllowRules { - host: "api.github.com".to_string(), - port: 443, + target: L7RuleTarget { + rule_name: "github".to_string(), + host: "api.github.com".to_string(), + ports: vec![443], + path: None, + binaries: L7BinaryScope::Any, + }, rules: vec![L7Rule { allow: Some(L7Allow { method: "POST".to_string(), @@ -18250,8 +18751,13 @@ mod tests { }], }]; let add_deny = [PolicyMergeOp::AddDenyRules { - host: "api.github.com".to_string(), - port: 443, + target: L7RuleTarget { + rule_name: "github".to_string(), + host: "api.github.com".to_string(), + ports: vec![443], + path: None, + binaries: L7BinaryScope::Any, + }, deny_rules: vec![L7DenyRule { method: "POST".to_string(), path: "/admin".to_string(), @@ -18405,8 +18911,13 @@ mod tests { #[test] fn validate_merge_operations_rejects_add_allow_for_known_metadata_hostname() { let operation = PolicyMergeOp::AddAllowRules { - host: "metadata.google.internal".to_string(), - port: 80, + target: L7RuleTarget { + rule_name: "metadata".to_string(), + host: "metadata.google.internal".to_string(), + ports: vec![80], + path: None, + binaries: L7BinaryScope::Any, + }, rules: vec![L7Rule { allow: Some(openshell_core::proto::L7Allow { method: "GET".to_string(), diff --git a/crates/openshell-server/src/storage_proto.rs b/crates/openshell-server/src/storage_proto.rs index 32250b5c77..6e53903178 100644 --- a/crates/openshell-server/src/storage_proto.rs +++ b/crates/openshell-server/src/storage_proto.rs @@ -118,7 +118,7 @@ mod tests { const STORAGE_V1_SCHEMA_SHA256: &str = "d68401809d8cea445c35233ef32412bbd041cb2ac5acaf368a0d0bf74d2ddf17"; const PUBLIC_RPC_SCHEMA_SHA256: &str = - "418130a28d1a5398d3d7f73f11b7f025d027c70f215be320dfe8e58371769f83"; + "beea342cc79c06b6efda934370a2425e444b8dab1c795b2858e9f241dec1ca2b"; const DURABLE_SCHEMA_SHA256: &str = "557ca283c55fd46b213d5573b950ba8604cc3f4b31bad3e433eb9c5f9975138d"; const PUBLIC_DURABLE_OVERLAP_SHA256: &str = @@ -570,7 +570,7 @@ mod tests { overlap_hash.as_str(), ), ( - (294, 20), + (295, 20), (90, 15), (78, 15), PUBLIC_RPC_SCHEMA_SHA256, diff --git a/docs/sandboxes/policies.mdx b/docs/sandboxes/policies.mdx index f4202319ae..749dd0c5a4 100644 --- a/docs/sandboxes/policies.mdx +++ b/docs/sandboxes/policies.mdx @@ -230,11 +230,13 @@ The following steps outline the hot-reload policy update workflow. --wait openshell policy update \ + --rule-name allow_api_github_com_443 \ + --binary /usr/bin/gh \ --add-allow 'api.github.com:443:POST:/repos/*/issues' \ --wait ``` - `--add-allow` and `--add-deny` target existing `protocol: rest` or `protocol: websocket` endpoints. If you pass multiple update flags in one command, OpenShell applies them as one atomic merge batch and persists at most one new revision. + `--add-allow` and `--add-deny` target existing `protocol: rest` or `protocol: websocket` endpoints. They require the rule name and complete affected binary and port scope. Run endpoint creation and L7 appends as separate commands; `--add-endpoint` cannot share a command with `--add-allow` or `--add-deny`. Compatible update flags in one command form one atomic merge batch and persist at most one new revision. 4. For larger edits, pull the current base policy and edit the YAML directly. The base policy is the user-authored policy without provider-composed `_provider_*` entries, so it is safe to round-trip through `openshell policy set`. Before reusing the file, strip the metadata header above the `---` line. @@ -329,8 +331,10 @@ The incremental update surface is split into endpoint-level operations and metho | `--remove-rule ` | Deletes a named `network_policies` entry. | Remove a whole rule by name when you no longer need it. | | `--add-allow ` | Appends method/path allow rules to an existing REST or WebSocket endpoint. | Permit one additional REST method/path or WebSocket `WEBSOCKET_TEXT` path on an API that is already configured. | | `--add-deny ` | Appends method/path deny rules to an existing REST or WebSocket endpoint. | Block a sensitive REST path or WebSocket text-message path under an endpoint that is otherwise allowed. | -| `--binary ` | Adds binaries to every `--add-endpoint` rule in the same command. | Bind a new endpoint to one or more executables. | -| `--rule-name ` | Overrides the generated rule name. | Keep a stable human-chosen rule name when adding exactly one endpoint. | +| `--binary ` | Adds binaries for `--add-endpoint`; declares the complete existing binary set for L7 appends. | Repeat for every executable sharing the target rule. | +| `--rule-name ` | Names one new endpoint rule or selects the existing rule for L7 appends. | Required for `--add-allow` and `--add-deny`. | +| `--any-binary` | Explicitly acknowledges an existing rule that authorizes every binary. | Use for L7 appends instead of `--binary` when the target rule has no binary restriction. | +| `--endpoint-path ` | Selects an exact existing endpoint path for L7 appends. | Resolve path ambiguity; pass `''` to select an endpoint without a path scope. | | `--dry-run` | Shows the merged policy locally and does not call the gateway. | Review the result before persisting it. | | `--wait` | Polls until the sandbox reports that the new revision loaded. | Confirm the change took effect before continuing. | | `--timeout ` | Sets the timeout for `--wait`. | Extend the wait window for slower sandboxes. | @@ -430,7 +434,7 @@ In shell commands, quote the full `SPEC` when it contains `*` or `**` so your sh | Segment | Meaning | |---|---| | `host` | Existing endpoint host. | -| `port` | Existing endpoint port. | +| `port` | Complete comma-separated port set of the existing endpoint, such as `443,8443`. | | `METHOD` | HTTP method for REST endpoints, or `GET` / `WEBSOCKET_TEXT` for WebSocket endpoints. The CLI normalizes it to uppercase. | | `path_glob` | URL path glob. For WebSocket text messages, this still matches the upgraded request path, not message payload content. It must start with `/`, or be `**`, or start with `**/`. | @@ -455,7 +459,9 @@ Path globs follow the same semantics as YAML allow and deny rules: - `/repos/*/issues` matches any intervening text, including multiple path segments. - `/repos/**` matches everything under `/repos/`. -The rule-level commands only modify method and path constraints. They do not change binaries, hostnames, ports, protocol settings, or WebSocket message payload matching. +The rule-level commands only modify method and path constraints. They do not change binaries, hostnames, ports, protocol settings, or WebSocket message payload matching. Each change applies to every binary and port on the target endpoint. Supply `--rule-name` and every binary with repeated `--binary`, or use `--any-binary` when the stored rule has an empty binary list. The declared binary and port sets must match the stored scope exactly; OpenShell reports the expected scope when they differ. + +Use `--endpoint-path` to select an endpoint by its stored path when the rule contains more than one endpoint matching the host and ports. `--endpoint-path ''` selects an endpoint without a path selector. This selector is separate from the request path in the allow or deny rule. All L7 additions in one command use the same rule name, binary declaration, and endpoint-path selector. ### Common Workflows @@ -496,6 +502,8 @@ Use `--add-allow` after the REST endpoint already exists. ```shell openshell policy update demo \ --add-allow 'api.github.com:443:POST:/repos/*/issues' \ + --rule-name allow_api_github_com_443 \ + --binary /usr/bin/gh \ --wait ``` @@ -508,6 +516,8 @@ Use `--add-deny` when you want to carve out a blocked subtree under an existing ```shell openshell policy update demo \ --add-deny 'api.github.com:443:POST:/admin/**' \ + --rule-name allow_api_github_com_443 \ + --binary /usr/bin/gh \ --wait ``` @@ -533,6 +543,8 @@ Use `WEBSOCKET_TEXT` when you want to refine client-to-server text-frame policy ```shell openshell policy update demo \ --add-deny 'realtime.example.com:443:WEBSOCKET_TEXT:/v1/admin/**' \ + --rule-name allow_realtime_example_com_443 \ + --binary /usr/bin/node \ --wait ``` @@ -568,6 +580,8 @@ Use `--dry-run` when you want to inspect the merged YAML before you send it to t ```shell openshell policy update demo \ --add-allow 'api.github.com:443:GET:/repos/**' \ + --rule-name allow_api_github_com_443 \ + --binary /usr/bin/gh \ --dry-run ``` @@ -577,7 +591,7 @@ The CLI validates the argument shapes before it sends the request. The gateway t - a port is outside `1` through `65535`. - `--add-allow` or `--add-deny` points at an endpoint that does not exist. - `--add-allow` or `--add-deny` targets an endpoint that is neither REST nor WebSocket. -- `--add-allow` or `--add-deny` targets a host and port that resolves to more than one endpoint. +- `--add-allow` or `--add-deny` omits the rule name or binary declaration, names incomplete binary or port scope, or still matches several endpoints within the selected rule. - `--add-deny` targets an endpoint that has no base allow set. - an update names an existing rule and adds a binary to it without declaring every endpoint and port that rule already authorizes. - an update names an existing rule and adds or changes an endpoint on it without declaring every binary that rule already authorizes. @@ -595,7 +609,20 @@ The sandbox picks the parser for a request by most-specific path, but it authori To grant one binary access to only part of an existing rule's endpoints, send it under its own `--rule-name`. The gateway normally folds an update into an existing rule that shares an endpoint, but it keeps your rule name whenever folding would grant authorization you did not declare, so the narrow grant lands as its own rule authorizing exactly what you asked for. The update reports that it kept your rule name and names the rule it would otherwise have folded into. An MCP contract conflict is the exception: one host and port carry a single MCP contract regardless of which rule holds them, so a conflicting update is rejected rather than moved to a separate rule. -Once a host and port appears in more than one rule, `--add-allow` and `--add-deny` can no longer target it. They select an endpoint by host and port alone, so they cannot say which rule's binary scope to widen, and the gateway rejects the update rather than guessing. The same applies when one rule carries two endpoints on that host and port under different paths. Use full YAML replacement to change L7 rules on an endpoint that appears more than once. +When several rules contain the same host and port, `--rule-name` selects the rule to change. Within that rule, use `--endpoint-path` if several endpoints match. OpenShell rejects missing, ambiguous, or mismatched targets atomically. Provider-owned rules cannot be changed through these operations; update the provider profile instead. + +For example, this appends one permission to an endpoint shared by two binaries on two ports: + +```shell +openshell policy update demo \ + --rule-name internal_api \ + --binary /usr/bin/curl \ + --binary /usr/bin/python3 \ + --add-allow 'api.example.com:443,8443:POST:/admin' \ + --wait +``` + +The command explicitly declares all four binary-to-port combinations affected by the new permission. Omitting either binary or either port rejects the whole update. To grant a permission to a smaller scope, create a separate rule with `--add-endpoint` or edit the policy structure first. ## Global Policy Override @@ -648,7 +675,7 @@ for the complete authorization model. For small changes, prefer `openshell policy update` over rewriting the full YAML: ```shell -openshell policy update --add-allow 'api.github.com:443:GET:/repos/**' --wait +openshell policy update --rule-name allow_api_github_com_443 --binary /usr/bin/gh --add-allow 'api.github.com:443:GET:/repos/**' --wait ``` ## Examples diff --git a/e2e/rust/tests/live_policy_update.rs b/e2e/rust/tests/live_policy_update.rs index ce47d3c8b7..3577e20a3c 100644 --- a/e2e/rust/tests/live_policy_update.rs +++ b/e2e/rust/tests/live_policy_update.rs @@ -37,7 +37,8 @@ use tempfile::NamedTempFile; // --------------------------------------------------------------------------- /// Build a policy YAML that allows any binary to reach the given hosts on -/// port 443. +/// port 443. Keep its filesystem paths aligned with the empty-network policy +/// so live network updates do not remove startup filesystem access. /// /// NOTE: The indentation in the format string is load-bearing YAML structure. fn write_policy(hosts: &[&str]) -> Result { @@ -64,6 +65,7 @@ fn write_policy(hosts: &[&str]) -> Result { filesystem_policy: include_workdir: true read_only: + - /bin - /usr - /lib - /proc @@ -90,7 +92,8 @@ network_policies: Ok(file) } -/// Build a minimal policy YAML with no network rules. +/// Build a minimal policy YAML with no network rules. Both /bin and /usr +/// are readable so shell entrypoints work on merged and unmerged images. fn write_empty_network_policy() -> Result { let mut file = NamedTempFile::new().map_err(|e| format!("create temp policy file: {e}"))?; @@ -99,6 +102,7 @@ fn write_empty_network_policy() -> Result { filesystem_policy: include_workdir: true read_only: + - /bin - /usr - /lib - /proc @@ -181,6 +185,172 @@ fn list_output_contains_version(output: &str, version: u32) -> bool { // Tests // --------------------------------------------------------------------------- +/// Read the effective policy through the same CLI boundary used by operators. +async fn l7_scope_snapshot(name: &str) -> serde_json::Value { + let result = run_cli(&["policy", "get", name, "--full", "--output", "json"]).await; + assert!(result.success, "policy snapshot failed: {}", result.output); + let snapshot: serde_json::Value = + serde_json::from_str(&result.output).expect("policy get returns JSON"); + assert!(snapshot["version"].as_u64().is_some()); + assert!( + snapshot["hash"] + .as_str() + .is_some_and(|hash| !hash.is_empty()) + ); + assert!(snapshot["policy"]["network_policies"].is_object()); + snapshot +} + +/// Incomplete declarations reject without a revision; an explicit target +/// changes only its endpoint even when another rule shares the host and ports. +#[tokio::test] +#[allow(clippy::too_many_lines)] +async fn l7_append_target_scope_round_trip() { + let mut policy = write_empty_network_policy().expect("write base policy"); + policy + .write_all( + br" +network_policies: + internal_api: + name: internal_api + binaries: + - path: /usr/bin/curl + - path: /usr/bin/python3 + endpoints: + - host: api.example.com + ports: [443, 8443] + protocol: rest + access: read-only + - host: other.example.com + port: 443 + protocol: rest + access: read-only + sibling: + name: sibling + binaries: + - path: /usr/bin/wget + endpoints: + - host: api.example.com + ports: [443, 8443] + protocol: rest + access: read-only +", + ) + .expect("write scoped policy"); + policy.flush().expect("flush scoped policy"); + let path = policy.path().to_str().expect("UTF-8 policy path"); + let mut guard = SandboxGuard::create_keep_with_args( + &["--policy", path, "--no-tty"], + &["sh", "-c", "echo Ready && sleep infinity"], + "Ready", + ) + .await + .expect("create scoped-policy sandbox"); + let before = l7_scope_snapshot(&guard.name).await; + + // Check each independent axis with the other fully declared, so a guard + // requiring both mismatches at once cannot satisfy this regression. + for (ports, binaries) in [ + ( + "api.example.com:443:POST:/admin", + vec!["/usr/bin/curl", "/usr/bin/python3"], + ), + ( + "api.example.com:443,8443:POST:/admin", + vec!["/usr/bin/curl"], + ), + ] { + let mut args = vec![ + "policy", + "update", + &guard.name, + "--rule-name", + "internal_api", + "--add-allow", + ports, + ]; + for binary in binaries { + args.extend(["--binary", binary]); + } + let rejected = run_cli(&args).await; + assert!( + !rejected.success, + "partial scope was accepted: {}", + rejected.output + ); + let unchanged = l7_scope_snapshot(&guard.name).await; + for field in ["version", "hash", "policy"] { + assert_eq!(unchanged[field], before[field], "rejection changed {field}"); + } + } + + let common = [ + "policy", + "update", + &guard.name, + "--rule-name", + "internal_api", + "--binary", + "/usr/bin/curl", + "--binary", + "/usr/bin/python3", + ]; + let mut allow_args = common.to_vec(); + allow_args.extend([ + "--add-allow", + "api.example.com:443,8443:POST:/admin", + "--wait", + ]); + let accepted = run_cli(&allow_args).await; + assert!( + accepted.success, + "explicit allow failed: {}", + accepted.output + ); + let after_allow = l7_scope_snapshot(&guard.name).await; + assert!(after_allow["version"].as_u64() > before["version"].as_u64()); + assert_ne!(after_allow["hash"], before["hash"]); + let rules = &after_allow["policy"]["network_policies"]; + assert_eq!( + rules["sibling"], + before["policy"]["network_policies"]["sibling"] + ); + assert_eq!( + rules["internal_api"]["endpoints"][1], + before["policy"]["network_policies"]["internal_api"]["endpoints"][1] + ); + assert!( + rules["internal_api"]["endpoints"][0]["rules"] + .as_array() + .expect("allow rules") + .iter() + .any(|rule| rule["allow"]["method"] == "POST" && rule["allow"]["path"] == "/admin") + ); + + let mut deny_args = common.to_vec(); + deny_args.extend([ + "--add-deny", + "api.example.com:443,8443:POST:/admin/private", + "--wait", + ]); + let denied = run_cli(&deny_args).await; + assert!(denied.success, "explicit deny failed: {}", denied.output); + let after_deny = l7_scope_snapshot(&guard.name).await; + assert!(after_deny["version"].as_u64() > after_allow["version"].as_u64()); + assert_eq!( + after_deny["policy"]["network_policies"]["sibling"], + before["policy"]["network_policies"]["sibling"] + ); + assert!( + after_deny["policy"]["network_policies"]["internal_api"]["endpoints"][0]["deny_rules"] + .as_array() + .expect("deny rules") + .iter() + .any(|rule| rule["method"] == "POST" && rule["path"] == "/admin/private") + ); + guard.cleanup().await; +} + /// Test the full live policy update lifecycle: /// /// 1. Create sandbox with policy A and `--keep` diff --git a/proto/openshell.proto b/proto/openshell.proto index 77bc32496b..91c0365863 100644 --- a/proto/openshell.proto +++ b/proto/openshell.proto @@ -2659,16 +2659,32 @@ message RemoveNetworkRule { string rule_name = 1; } +// Exact endpoint and complete authorization scope affected by an L7 append. +// All ports and binaries must match the stored target; omitted scope is invalid. +message L7RuleTarget { + string rule_name = 1; + string host = 2; + repeated uint32 ports = 3; + // An absent path requires a unique endpoint. An empty path selects an + // endpoint without a path selector. This is not the appended request path. + optional string path = 4; + // Declare either a nonempty binary list or any_binary, never both. + repeated openshell.sandbox.v1.NetworkBinary binaries = 5; + bool any_binary = 6; +} + message AddDenyRules { - string host = 1; - uint32 port = 2; + reserved 1, 2; + reserved "host", "port"; repeated openshell.sandbox.v1.L7DenyRule deny_rules = 3; + L7RuleTarget target = 4; } message AddAllowRules { - string host = 1; - uint32 port = 2; + reserved 1, 2; + reserved "host", "port"; repeated openshell.sandbox.v1.L7Rule rules = 3; + L7RuleTarget target = 4; } message RemoveNetworkBinary { diff --git a/sdk/go/docs/src/api/policy.md b/sdk/go/docs/src/api/policy.md index e4107ee5b9..3d2573c086 100644 --- a/sdk/go/docs/src/api/policy.md +++ b/sdk/go/docs/src/api/policy.md @@ -91,4 +91,38 @@ if err != nil { } ``` +## Append allow or deny rules + +Use `client.Config().Update` with `AddAllowRules` or `AddDenyRules` to append request matchers to an existing base-policy endpoint. Both operations require an `L7RuleTarget` naming the rule, host, every affected port, and every binary governed by that rule. The gateway rejects missing scope or a scope that differs from the current policy without applying the merge batch. + +```go +result, err := client.Config().Update(ctx, "default", &v1.ConfigUpdate{ + Name: "my-sandbox", + MergeOperations: []v1.PolicyMergeOperation{{ + AddAllowRules: &v1.AddAllowRules{ + Target: &v1.L7RuleTarget{ + RuleName: "api", + Host: "api.example.com", + Ports: []uint32{443, 8443}, + Binaries: []v1.PolicyNetworkBinary{ + {Path: "/usr/bin/curl"}, + {Path: "/usr/bin/wget"}, + }, + }, + Rules: []v1.L7Rule{{ + Allow: &v1.L7Allow{Method: "POST", Path: "/admin"}, + }}, + }, + }}, +}) +if err != nil { + log.Fatal(err) +} +fmt.Printf("Policy version: %d\n", result.Version) +``` + +This example explicitly permits both binaries to make the new request on both ports. For a rule that permits any binary, set `AnyBinary: true` and omit `Binaries`. Omitting both fields is invalid; the SDK never infers any-binary permission. + +`Target.Path` selects the existing endpoint path and is separate from the appended request matcher's path. Leave it `nil` when the rule, host, and ports identify a unique endpoint. To choose an endpoint with a specific path, pass a pointer to that path; a pointer to an empty string selects an endpoint without a path selector. Use `AddDenyRules` with the same target shape and a `DenyRules` payload to append deny matchers. + See also: [Error Handling](../error-handling.md), [Testing](../testing.md) diff --git a/sdk/go/openshell/v1/config_client_test.go b/sdk/go/openshell/v1/config_client_test.go index 9fa8675ff2..75a0f7f11a 100644 --- a/sdk/go/openshell/v1/config_client_test.go +++ b/sdk/go/openshell/v1/config_client_test.go @@ -547,6 +547,76 @@ func TestConfigUpdate_MergeOperationsAccepted(t *testing.T) { assert.NotEmpty(t, req.GetMergeOperations(), "MergeOperations should be serialized to proto") } +func TestConfigUpdate_L7TargetScopeSurvivesTransport(t *testing.T) { + mock := newMockConfigServer() + mock.updateResp = &pb.UpdateConfigResponse{Version: 3} + client, cleanup := setupConfigTest(t, mock) + defer cleanup() + + path := "" + _, err := client.Update(context.Background(), "default", &ConfigUpdate{ + Name: "my-sandbox", + MergeOperations: []PolicyMergeOperation{ + {AddAllowRules: &AddAllowRules{ + Target: &L7RuleTarget{ + RuleName: "api", + Host: "api.example.com", + Ports: []uint32{443, 8443}, + Path: &path, + Binaries: []PolicyNetworkBinary{{Path: "/usr/bin/curl"}, {Path: "/usr/bin/wget"}}, + }, + Rules: []L7Rule{{Allow: &L7Allow{Method: "POST", Path: "/admin"}}}, + }}, + {AddDenyRules: &AddDenyRules{ + Target: &L7RuleTarget{ + RuleName: "public-api", + Host: "public.example.com", + Ports: []uint32{443}, + AnyBinary: true, + }, + DenyRules: []L7DenyRule{{Method: "DELETE", Path: "/admin"}}, + }}, + }, + }) + require.NoError(t, err) + + mock.mu.Lock() + req := mock.lastUpdateReq + mock.mu.Unlock() + require.NotNil(t, req) + require.Len(t, req.GetMergeOperations(), 2) + allow := req.GetMergeOperations()[0].GetAddAllowRules() + require.NotNil(t, allow) + allowTarget := allow.GetTarget() + require.NotNil(t, allowTarget) + assert.Equal(t, "api", allowTarget.GetRuleName()) + assert.Equal(t, "api.example.com", allowTarget.GetHost()) + assert.Equal(t, []uint32{443, 8443}, allowTarget.GetPorts()) + require.NotNil(t, allowTarget.Path, "empty endpoint path must survive protobuf encoding") + assert.Empty(t, *allowTarget.Path) + require.Len(t, allowTarget.GetBinaries(), 2) + assert.Equal(t, "/usr/bin/curl", allowTarget.GetBinaries()[0].GetPath()) + assert.Equal(t, "/usr/bin/wget", allowTarget.GetBinaries()[1].GetPath()) + assert.False(t, allowTarget.GetAnyBinary()) + require.Len(t, allow.GetRules(), 1) + assert.Equal(t, "POST", allow.GetRules()[0].GetAllow().GetMethod()) + assert.Equal(t, "/admin", allow.GetRules()[0].GetAllow().GetPath()) + + deny := req.GetMergeOperations()[1].GetAddDenyRules() + require.NotNil(t, deny) + denyTarget := deny.GetTarget() + require.NotNil(t, denyTarget) + assert.Equal(t, "public-api", denyTarget.GetRuleName()) + assert.Equal(t, "public.example.com", denyTarget.GetHost()) + assert.Equal(t, []uint32{443}, denyTarget.GetPorts()) + assert.Nil(t, denyTarget.Path) + assert.Empty(t, denyTarget.GetBinaries()) + assert.True(t, denyTarget.GetAnyBinary()) + require.Len(t, deny.GetDenyRules(), 1) + assert.Equal(t, "DELETE", deny.GetDenyRules()[0].GetMethod()) + assert.Equal(t, "/admin", deny.GetDenyRules()[0].GetPath()) +} + func TestConfigUpdate_ErrorConflict(t *testing.T) { mock := newMockConfigServer() mock.updateErr = status.Error(codes.Aborted, "resource version conflict") diff --git a/sdk/go/openshell/v1/internal/converter/setting.go b/sdk/go/openshell/v1/internal/converter/setting.go index 495545938d..5c95ac8b7d 100644 --- a/sdk/go/openshell/v1/internal/converter/setting.go +++ b/sdk/go/openshell/v1/internal/converter/setting.go @@ -5,6 +5,7 @@ package converter import ( "fmt" + "slices" v1 "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" @@ -258,8 +259,7 @@ func PolicyMergeOperationToProto(op *v1.PolicyMergeOperation) (*pb.PolicyMergeOp } pmo.Operation = &pb.PolicyMergeOperation_AddDenyRules{ AddDenyRules: &pb.AddDenyRules{ - Host: op.AddDenyRules.Host, - Port: op.AddDenyRules.Port, + Target: l7RuleTargetToProto(op.AddDenyRules.Target), DenyRules: denyRules, }, } @@ -273,9 +273,8 @@ func PolicyMergeOperationToProto(op *v1.PolicyMergeOperation) (*pb.PolicyMergeOp } pmo.Operation = &pb.PolicyMergeOperation_AddAllowRules{ AddAllowRules: &pb.AddAllowRules{ - Host: op.AddAllowRules.Host, - Port: op.AddAllowRules.Port, - Rules: rules, + Target: l7RuleTargetToProto(op.AddAllowRules.Target), + Rules: rules, }, } case op.RemoveBinary != nil: @@ -289,6 +288,33 @@ func PolicyMergeOperationToProto(op *v1.PolicyMergeOperation) (*pb.PolicyMergeOp return pmo, nil } +// l7RuleTargetToProto preserves the caller's declaration without inferring scope. +// The gateway rejects missing or mismatched scope against the current policy. +func l7RuleTargetToProto(target *v1.L7RuleTarget) *pb.L7RuleTarget { + if target == nil { + return nil + } + result := &pb.L7RuleTarget{ + RuleName: target.RuleName, + Host: target.Host, + Ports: slices.Clone(target.Ports), + AnyBinary: target.AnyBinary, + } + // Copy optional presence as well as value: an empty path selects an + // unscoped endpoint, while nil leaves path disambiguation to the gateway. + if target.Path != nil { + path := *target.Path + result.Path = &path + } + if target.Binaries != nil { + result.Binaries = make([]*sbv1.NetworkBinary, len(target.Binaries)) + for i, binary := range target.Binaries { + result.Binaries[i] = &sbv1.NetworkBinary{Path: binary.Path} + } + } + return result +} + // --- ConfigUpdateResult --- // ConfigUpdateResultFromProto converts an UpdateConfigResponse to an SDK ConfigUpdateResult. diff --git a/sdk/go/openshell/v1/internal/converter/setting_test.go b/sdk/go/openshell/v1/internal/converter/setting_test.go index f546902429..f51683fcd1 100644 --- a/sdk/go/openshell/v1/internal/converter/setting_test.go +++ b/sdk/go/openshell/v1/internal/converter/setting_test.go @@ -666,10 +666,16 @@ func TestPolicyMergeOperationToProto_RemoveRule(t *testing.T) { } func TestPolicyMergeOperationToProto_AddDenyRules(t *testing.T) { + path := "/api" op := &v1.PolicyMergeOperation{ AddDenyRules: &v1.AddDenyRules{ - Host: "blocked.example.com", - Port: 443, + Target: &v1.L7RuleTarget{ + RuleName: "blocked-api", + Host: "blocked.example.com", + Ports: []uint32{443, 8443}, + Path: &path, + Binaries: []v1.PolicyNetworkBinary{{Path: "/usr/bin/curl"}, {Path: "/usr/bin/wget"}}, + }, DenyRules: []v1.L7DenyRule{ { Method: "POST", @@ -690,8 +696,16 @@ func TestPolicyMergeOperationToProto_AddDenyRules(t *testing.T) { require.NotNil(t, pmo) adr := pmo.GetAddDenyRules() require.NotNil(t, adr, "expected AddDenyRules variant") - assert.Equal(t, "blocked.example.com", adr.GetHost()) - assert.Equal(t, uint32(443), adr.GetPort()) + require.NotNil(t, adr.GetTarget()) + assert.Equal(t, "blocked-api", adr.GetTarget().GetRuleName()) + assert.Equal(t, "blocked.example.com", adr.GetTarget().GetHost()) + assert.Equal(t, []uint32{443, 8443}, adr.GetTarget().GetPorts()) + require.NotNil(t, adr.GetTarget().Path) + assert.Equal(t, "/api", adr.GetTarget().GetPath()) + require.Len(t, adr.GetTarget().GetBinaries(), 2) + assert.Equal(t, "/usr/bin/curl", adr.GetTarget().GetBinaries()[0].GetPath()) + assert.Equal(t, "/usr/bin/wget", adr.GetTarget().GetBinaries()[1].GetPath()) + assert.False(t, adr.GetTarget().GetAnyBinary()) require.Len(t, adr.GetDenyRules(), 2) assert.Equal(t, "POST", adr.GetDenyRules()[0].GetMethod()) assert.Equal(t, "/admin", adr.GetDenyRules()[0].GetPath()) @@ -701,8 +715,12 @@ func TestPolicyMergeOperationToProto_AddDenyRules(t *testing.T) { func TestPolicyMergeOperationToProto_AddAllowRules(t *testing.T) { op := &v1.PolicyMergeOperation{ AddAllowRules: &v1.AddAllowRules{ - Host: "api.example.com", - Port: 443, + Target: &v1.L7RuleTarget{ + RuleName: "public-api", + Host: "api.example.com", + Ports: []uint32{443}, + AnyBinary: true, + }, Rules: []v1.L7Rule{ { Allow: &v1.L7Allow{ @@ -720,14 +738,101 @@ func TestPolicyMergeOperationToProto_AddAllowRules(t *testing.T) { require.NotNil(t, pmo) aar := pmo.GetAddAllowRules() require.NotNil(t, aar, "expected AddAllowRules variant") - assert.Equal(t, "api.example.com", aar.GetHost()) - assert.Equal(t, uint32(443), aar.GetPort()) + require.NotNil(t, aar.GetTarget()) + assert.Equal(t, "public-api", aar.GetTarget().GetRuleName()) + assert.Equal(t, "api.example.com", aar.GetTarget().GetHost()) + assert.Equal(t, []uint32{443}, aar.GetTarget().GetPorts()) + assert.Nil(t, aar.GetTarget().Path) + assert.Empty(t, aar.GetTarget().GetBinaries()) + assert.True(t, aar.GetTarget().GetAnyBinary()) require.Len(t, aar.GetRules(), 1) require.NotNil(t, aar.GetRules()[0].GetAllow()) assert.Equal(t, "GET", aar.GetRules()[0].GetAllow().GetMethod()) assert.Equal(t, "/health", aar.GetRules()[0].GetAllow().GetPath()) } +func TestPolicyMergeOperationToProto_L7TargetDeepCopy(t *testing.T) { + for _, kind := range []string{"allow", "deny"} { + t.Run(kind, func(t *testing.T) { + path := "" + target := &v1.L7RuleTarget{ + RuleName: "api", + Host: "api.example.com", + Ports: []uint32{443, 8443}, + Path: &path, + Binaries: []v1.PolicyNetworkBinary{{Path: "/usr/bin/curl"}}, + } + op := &v1.PolicyMergeOperation{} + if kind == "allow" { + op.AddAllowRules = &v1.AddAllowRules{Target: target} + } else { + op.AddDenyRules = &v1.AddDenyRules{Target: target} + } + converted, err := PolicyMergeOperationToProto(op) + require.NoError(t, err) + wireTarget := converted.GetAddAllowRules().GetTarget() + if kind == "deny" { + wireTarget = converted.GetAddDenyRules().GetTarget() + } + require.NotNil(t, wireTarget) + require.NotNil(t, wireTarget.Path) + assert.Empty(t, *wireTarget.Path, "explicit empty path must retain presence") + + // Editing the caller's declaration must not change the queued request. + target.Ports[0] = 80 + target.Binaries[0].Path = "/usr/bin/python" + path = "/changed" + assert.Equal(t, []uint32{443, 8443}, wireTarget.GetPorts()) + assert.Equal(t, "/usr/bin/curl", wireTarget.GetBinaries()[0].GetPath()) + assert.Empty(t, *wireTarget.Path) + + // Editing the wire request must not mutate the caller's objects either. + wireTarget.Ports[1] = 8080 + wireTarget.Binaries[0].Path = "/usr/bin/node" + *wireTarget.Path = "/wire" + assert.Equal(t, []uint32{80, 8443}, target.Ports) + assert.Equal(t, "/usr/bin/python", target.Binaries[0].Path) + assert.Equal(t, "/changed", path) + }) + } +} + +func TestPolicyMergeOperationToProto_L7TargetDoesNotInferScope(t *testing.T) { + for _, kind := range []string{"allow", "deny"} { + for _, tc := range []struct { + name string + target *v1.L7RuleTarget + }{ + {name: "missing"}, + {name: "omitted_scope", target: &v1.L7RuleTarget{RuleName: "api", Host: "api.example.com"}}, + } { + t.Run(kind+"/"+tc.name, func(t *testing.T) { + op := &v1.PolicyMergeOperation{} + if kind == "allow" { + op.AddAllowRules = &v1.AddAllowRules{Target: tc.target} + } else { + op.AddDenyRules = &v1.AddDenyRules{Target: tc.target} + } + converted, err := PolicyMergeOperationToProto(op) + require.NoError(t, err) + target := converted.GetAddAllowRules().GetTarget() + if kind == "deny" { + target = converted.GetAddDenyRules().GetTarget() + } + if tc.target == nil { + assert.Nil(t, target) + return + } + require.NotNil(t, target) + assert.False(t, target.GetAnyBinary()) + assert.Nil(t, target.GetBinaries()) + assert.Nil(t, target.GetPorts()) + assert.Nil(t, target.Path) + }) + } + } +} + func TestPolicyMergeOperationToProto_RemoveBinary(t *testing.T) { op := &v1.PolicyMergeOperation{ RemoveBinary: &v1.RemoveNetworkBinary{ diff --git a/sdk/go/openshell/v1/types/network_policy.go b/sdk/go/openshell/v1/types/network_policy.go index 69e44e1242..ab0da1b928 100644 --- a/sdk/go/openshell/v1/types/network_policy.go +++ b/sdk/go/openshell/v1/types/network_policy.go @@ -159,22 +159,38 @@ type RemoveNetworkRule struct { RuleName string } +// L7RuleTarget identifies an endpoint and declares its complete affected scope. +// The gateway requires the ports and binary scope to match the stored endpoint +// and rule before appending any layer-7 rules. +type L7RuleTarget struct { + // RuleName names the base-policy rule containing the endpoint. + RuleName string + // Host is the endpoint host, matched case-insensitively. + Host string + // Ports lists every port affected by the append, not only a lookup port. + Ports []uint32 + // Path selects the endpoint path, distinct from an appended request path. + // Nil requires a unique endpoint; a pointer to "" selects an unscoped endpoint. + Path *string + // Binaries lists every binary governed by the containing rule. + // Exactly one of a nonempty Binaries list or AnyBinary=true is required. + Binaries []PolicyNetworkBinary + // AnyBinary explicitly acknowledges a rule with unrestricted binary scope. + AnyBinary bool +} + // AddDenyRules appends layer-7 deny rules to a specific endpoint. type AddDenyRules struct { - // Host identifies the target endpoint host. - Host string - // Port identifies the target endpoint port. - Port uint32 + // Target is required and declares the full scope affected by the append. + Target *L7RuleTarget // DenyRules are the deny rules to append. DenyRules []L7DenyRule } // AddAllowRules appends layer-7 allow rules to a specific endpoint. type AddAllowRules struct { - // Host identifies the target endpoint host. - Host string - // Port identifies the target endpoint port. - Port uint32 + // Target is required and declares the full scope affected by the append. + Target *L7RuleTarget // Rules are the allow rules to append. Rules []L7Rule } diff --git a/sdk/go/openshell/v1/types_reexport.go b/sdk/go/openshell/v1/types_reexport.go index b92aa80bc8..c1f4f9a27e 100644 --- a/sdk/go/openshell/v1/types_reexport.go +++ b/sdk/go/openshell/v1/types_reexport.go @@ -50,6 +50,9 @@ type RemoveNetworkRule = types.RemoveNetworkRule // AddDenyRules appends layer-7 deny rules to a specific endpoint. type AddDenyRules = types.AddDenyRules +// L7RuleTarget identifies an endpoint and declares its complete affected scope. +type L7RuleTarget = types.L7RuleTarget + // AddAllowRules appends layer-7 allow rules to a specific endpoint. type AddAllowRules = types.AddAllowRules diff --git a/sdk/go/proto/openshellv1/openshell.pb.go b/sdk/go/proto/openshellv1/openshell.pb.go index c7cdc8e850..d5f2b8aff4 100644 --- a/sdk/go/proto/openshellv1/openshell.pb.go +++ b/sdk/go/proto/openshellv1/openshell.pb.go @@ -11271,29 +11271,37 @@ func (x *RemoveNetworkRule) GetRuleName() string { return "" } -type AddDenyRules struct { - state protoimpl.MessageState `protogen:"open.v1"` - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - DenyRules []*sandboxv1.L7DenyRule `protobuf:"bytes,3,rep,name=deny_rules,json=denyRules,proto3" json:"deny_rules,omitempty"` +// Exact endpoint and complete authorization scope affected by an L7 append. +// All ports and binaries must match the stored target; omitted scope is invalid. +type L7RuleTarget struct { + state protoimpl.MessageState `protogen:"open.v1"` + RuleName string `protobuf:"bytes,1,opt,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + Ports []uint32 `protobuf:"varint,3,rep,packed,name=ports,proto3" json:"ports,omitempty"` + // An absent path requires a unique endpoint. An empty path selects an + // endpoint without a path selector. This is not the appended request path. + Path *string `protobuf:"bytes,4,opt,name=path,proto3,oneof" json:"path,omitempty"` + // Declare either a nonempty binary list or any_binary, never both. + Binaries []*sandboxv1.NetworkBinary `protobuf:"bytes,5,rep,name=binaries,proto3" json:"binaries,omitempty"` + AnyBinary bool `protobuf:"varint,6,opt,name=any_binary,json=anyBinary,proto3" json:"any_binary,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *AddDenyRules) Reset() { - *x = AddDenyRules{} +func (x *L7RuleTarget) Reset() { + *x = L7RuleTarget{} mi := &file_openshell_proto_msgTypes[143] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *AddDenyRules) String() string { +func (x *L7RuleTarget) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddDenyRules) ProtoMessage() {} +func (*L7RuleTarget) ProtoMessage() {} -func (x *AddDenyRules) ProtoReflect() protoreflect.Message { +func (x *L7RuleTarget) ProtoReflect() protoreflect.Message { mi := &file_openshell_proto_msgTypes[143] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -11305,23 +11313,89 @@ func (x *AddDenyRules) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddDenyRules.ProtoReflect.Descriptor instead. -func (*AddDenyRules) Descriptor() ([]byte, []int) { +// Deprecated: Use L7RuleTarget.ProtoReflect.Descriptor instead. +func (*L7RuleTarget) Descriptor() ([]byte, []int) { return file_openshell_proto_rawDescGZIP(), []int{143} } -func (x *AddDenyRules) GetHost() string { +func (x *L7RuleTarget) GetRuleName() string { + if x != nil { + return x.RuleName + } + return "" +} + +func (x *L7RuleTarget) GetHost() string { if x != nil { return x.Host } return "" } -func (x *AddDenyRules) GetPort() uint32 { +func (x *L7RuleTarget) GetPorts() []uint32 { if x != nil { - return x.Port + return x.Ports } - return 0 + return nil +} + +func (x *L7RuleTarget) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +func (x *L7RuleTarget) GetBinaries() []*sandboxv1.NetworkBinary { + if x != nil { + return x.Binaries + } + return nil +} + +func (x *L7RuleTarget) GetAnyBinary() bool { + if x != nil { + return x.AnyBinary + } + return false +} + +type AddDenyRules struct { + state protoimpl.MessageState `protogen:"open.v1"` + DenyRules []*sandboxv1.L7DenyRule `protobuf:"bytes,3,rep,name=deny_rules,json=denyRules,proto3" json:"deny_rules,omitempty"` + Target *L7RuleTarget `protobuf:"bytes,4,opt,name=target,proto3" json:"target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AddDenyRules) Reset() { + *x = AddDenyRules{} + mi := &file_openshell_proto_msgTypes[144] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AddDenyRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddDenyRules) ProtoMessage() {} + +func (x *AddDenyRules) ProtoReflect() protoreflect.Message { + mi := &file_openshell_proto_msgTypes[144] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddDenyRules.ProtoReflect.Descriptor instead. +func (*AddDenyRules) Descriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{144} } func (x *AddDenyRules) GetDenyRules() []*sandboxv1.L7DenyRule { @@ -11331,18 +11405,24 @@ func (x *AddDenyRules) GetDenyRules() []*sandboxv1.L7DenyRule { return nil } +func (x *AddDenyRules) GetTarget() *L7RuleTarget { + if x != nil { + return x.Target + } + return nil +} + type AddAllowRules struct { state protoimpl.MessageState `protogen:"open.v1"` - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` Rules []*sandboxv1.L7Rule `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules,omitempty"` + Target *L7RuleTarget `protobuf:"bytes,4,opt,name=target,proto3" json:"target,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *AddAllowRules) Reset() { *x = AddAllowRules{} - mi := &file_openshell_proto_msgTypes[144] + mi := &file_openshell_proto_msgTypes[145] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11354,7 +11434,7 @@ func (x *AddAllowRules) String() string { func (*AddAllowRules) ProtoMessage() {} func (x *AddAllowRules) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[144] + mi := &file_openshell_proto_msgTypes[145] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11367,26 +11447,19 @@ func (x *AddAllowRules) ProtoReflect() protoreflect.Message { // Deprecated: Use AddAllowRules.ProtoReflect.Descriptor instead. func (*AddAllowRules) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{144} + return file_openshell_proto_rawDescGZIP(), []int{145} } -func (x *AddAllowRules) GetHost() string { +func (x *AddAllowRules) GetRules() []*sandboxv1.L7Rule { if x != nil { - return x.Host + return x.Rules } - return "" + return nil } -func (x *AddAllowRules) GetPort() uint32 { +func (x *AddAllowRules) GetTarget() *L7RuleTarget { if x != nil { - return x.Port - } - return 0 -} - -func (x *AddAllowRules) GetRules() []*sandboxv1.L7Rule { - if x != nil { - return x.Rules + return x.Target } return nil } @@ -11401,7 +11474,7 @@ type RemoveNetworkBinary struct { func (x *RemoveNetworkBinary) Reset() { *x = RemoveNetworkBinary{} - mi := &file_openshell_proto_msgTypes[145] + mi := &file_openshell_proto_msgTypes[146] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11413,7 +11486,7 @@ func (x *RemoveNetworkBinary) String() string { func (*RemoveNetworkBinary) ProtoMessage() {} func (x *RemoveNetworkBinary) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[145] + mi := &file_openshell_proto_msgTypes[146] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11426,7 +11499,7 @@ func (x *RemoveNetworkBinary) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveNetworkBinary.ProtoReflect.Descriptor instead. func (*RemoveNetworkBinary) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{145} + return file_openshell_proto_rawDescGZIP(), []int{146} } func (x *RemoveNetworkBinary) GetRuleName() string { @@ -11462,7 +11535,7 @@ type UpdateConfigResponse struct { func (x *UpdateConfigResponse) Reset() { *x = UpdateConfigResponse{} - mi := &file_openshell_proto_msgTypes[146] + mi := &file_openshell_proto_msgTypes[147] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11474,7 +11547,7 @@ func (x *UpdateConfigResponse) String() string { func (*UpdateConfigResponse) ProtoMessage() {} func (x *UpdateConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[146] + mi := &file_openshell_proto_msgTypes[147] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11487,7 +11560,7 @@ func (x *UpdateConfigResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateConfigResponse.ProtoReflect.Descriptor instead. func (*UpdateConfigResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{146} + return file_openshell_proto_rawDescGZIP(), []int{147} } func (x *UpdateConfigResponse) GetVersion() uint32 { @@ -11543,7 +11616,7 @@ type GetSandboxPolicyStatusRequest struct { func (x *GetSandboxPolicyStatusRequest) Reset() { *x = GetSandboxPolicyStatusRequest{} - mi := &file_openshell_proto_msgTypes[147] + mi := &file_openshell_proto_msgTypes[148] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11555,7 +11628,7 @@ func (x *GetSandboxPolicyStatusRequest) String() string { func (*GetSandboxPolicyStatusRequest) ProtoMessage() {} func (x *GetSandboxPolicyStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[147] + mi := &file_openshell_proto_msgTypes[148] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11568,7 +11641,7 @@ func (x *GetSandboxPolicyStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxPolicyStatusRequest.ProtoReflect.Descriptor instead. func (*GetSandboxPolicyStatusRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{147} + return file_openshell_proto_rawDescGZIP(), []int{148} } func (x *GetSandboxPolicyStatusRequest) GetName() string { @@ -11612,7 +11685,7 @@ type GetSandboxPolicyStatusResponse struct { func (x *GetSandboxPolicyStatusResponse) Reset() { *x = GetSandboxPolicyStatusResponse{} - mi := &file_openshell_proto_msgTypes[148] + mi := &file_openshell_proto_msgTypes[149] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11624,7 +11697,7 @@ func (x *GetSandboxPolicyStatusResponse) String() string { func (*GetSandboxPolicyStatusResponse) ProtoMessage() {} func (x *GetSandboxPolicyStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[148] + mi := &file_openshell_proto_msgTypes[149] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11637,7 +11710,7 @@ func (x *GetSandboxPolicyStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxPolicyStatusResponse.ProtoReflect.Descriptor instead. func (*GetSandboxPolicyStatusResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{148} + return file_openshell_proto_rawDescGZIP(), []int{149} } func (x *GetSandboxPolicyStatusResponse) GetRevision() *SandboxPolicyRevision { @@ -11676,7 +11749,7 @@ type ListSandboxPoliciesRequest struct { func (x *ListSandboxPoliciesRequest) Reset() { *x = ListSandboxPoliciesRequest{} - mi := &file_openshell_proto_msgTypes[149] + mi := &file_openshell_proto_msgTypes[150] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11688,7 +11761,7 @@ func (x *ListSandboxPoliciesRequest) String() string { func (*ListSandboxPoliciesRequest) ProtoMessage() {} func (x *ListSandboxPoliciesRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[149] + mi := &file_openshell_proto_msgTypes[150] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11701,7 +11774,7 @@ func (x *ListSandboxPoliciesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSandboxPoliciesRequest.ProtoReflect.Descriptor instead. func (*ListSandboxPoliciesRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{149} + return file_openshell_proto_rawDescGZIP(), []int{150} } func (x *ListSandboxPoliciesRequest) GetName() string { @@ -11753,7 +11826,7 @@ type ListSandboxPoliciesResponse struct { func (x *ListSandboxPoliciesResponse) Reset() { *x = ListSandboxPoliciesResponse{} - mi := &file_openshell_proto_msgTypes[150] + mi := &file_openshell_proto_msgTypes[151] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11765,7 +11838,7 @@ func (x *ListSandboxPoliciesResponse) String() string { func (*ListSandboxPoliciesResponse) ProtoMessage() {} func (x *ListSandboxPoliciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[150] + mi := &file_openshell_proto_msgTypes[151] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11778,7 +11851,7 @@ func (x *ListSandboxPoliciesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSandboxPoliciesResponse.ProtoReflect.Descriptor instead. func (*ListSandboxPoliciesResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{150} + return file_openshell_proto_rawDescGZIP(), []int{151} } func (x *ListSandboxPoliciesResponse) GetRevisions() []*SandboxPolicyRevision { @@ -11812,7 +11885,7 @@ type ReportPolicyStatusRequest struct { func (x *ReportPolicyStatusRequest) Reset() { *x = ReportPolicyStatusRequest{} - mi := &file_openshell_proto_msgTypes[151] + mi := &file_openshell_proto_msgTypes[152] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11824,7 +11897,7 @@ func (x *ReportPolicyStatusRequest) String() string { func (*ReportPolicyStatusRequest) ProtoMessage() {} func (x *ReportPolicyStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[151] + mi := &file_openshell_proto_msgTypes[152] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11837,7 +11910,7 @@ func (x *ReportPolicyStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportPolicyStatusRequest.ProtoReflect.Descriptor instead. func (*ReportPolicyStatusRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{151} + return file_openshell_proto_rawDescGZIP(), []int{152} } func (x *ReportPolicyStatusRequest) GetSandboxId() string { @@ -11877,7 +11950,7 @@ type ReportPolicyStatusResponse struct { func (x *ReportPolicyStatusResponse) Reset() { *x = ReportPolicyStatusResponse{} - mi := &file_openshell_proto_msgTypes[152] + mi := &file_openshell_proto_msgTypes[153] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11889,7 +11962,7 @@ func (x *ReportPolicyStatusResponse) String() string { func (*ReportPolicyStatusResponse) ProtoMessage() {} func (x *ReportPolicyStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[152] + mi := &file_openshell_proto_msgTypes[153] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11902,7 +11975,7 @@ func (x *ReportPolicyStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportPolicyStatusResponse.ProtoReflect.Descriptor instead. func (*ReportPolicyStatusResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{152} + return file_openshell_proto_rawDescGZIP(), []int{153} } // A versioned policy revision with metadata. @@ -11935,7 +12008,7 @@ type SandboxPolicyRevision struct { func (x *SandboxPolicyRevision) Reset() { *x = SandboxPolicyRevision{} - mi := &file_openshell_proto_msgTypes[153] + mi := &file_openshell_proto_msgTypes[154] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11947,7 +12020,7 @@ func (x *SandboxPolicyRevision) String() string { func (*SandboxPolicyRevision) ProtoMessage() {} func (x *SandboxPolicyRevision) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[153] + mi := &file_openshell_proto_msgTypes[154] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11960,7 +12033,7 @@ func (x *SandboxPolicyRevision) ProtoReflect() protoreflect.Message { // Deprecated: Use SandboxPolicyRevision.ProtoReflect.Descriptor instead. func (*SandboxPolicyRevision) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{153} + return file_openshell_proto_rawDescGZIP(), []int{154} } func (x *SandboxPolicyRevision) GetVersion() uint32 { @@ -12040,7 +12113,7 @@ type GetSandboxLogsRequest struct { func (x *GetSandboxLogsRequest) Reset() { *x = GetSandboxLogsRequest{} - mi := &file_openshell_proto_msgTypes[154] + mi := &file_openshell_proto_msgTypes[155] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12052,7 +12125,7 @@ func (x *GetSandboxLogsRequest) String() string { func (*GetSandboxLogsRequest) ProtoMessage() {} func (x *GetSandboxLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[154] + mi := &file_openshell_proto_msgTypes[155] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12065,7 +12138,7 @@ func (x *GetSandboxLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxLogsRequest.ProtoReflect.Descriptor instead. func (*GetSandboxLogsRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{154} + return file_openshell_proto_rawDescGZIP(), []int{155} } func (x *GetSandboxLogsRequest) GetSandboxId() string { @@ -12123,7 +12196,7 @@ type PushSandboxLogsRequest struct { func (x *PushSandboxLogsRequest) Reset() { *x = PushSandboxLogsRequest{} - mi := &file_openshell_proto_msgTypes[155] + mi := &file_openshell_proto_msgTypes[156] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12135,7 +12208,7 @@ func (x *PushSandboxLogsRequest) String() string { func (*PushSandboxLogsRequest) ProtoMessage() {} func (x *PushSandboxLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[155] + mi := &file_openshell_proto_msgTypes[156] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12148,7 +12221,7 @@ func (x *PushSandboxLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PushSandboxLogsRequest.ProtoReflect.Descriptor instead. func (*PushSandboxLogsRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{155} + return file_openshell_proto_rawDescGZIP(), []int{156} } func (x *PushSandboxLogsRequest) GetSandboxId() string { @@ -12174,7 +12247,7 @@ type PushSandboxLogsResponse struct { func (x *PushSandboxLogsResponse) Reset() { *x = PushSandboxLogsResponse{} - mi := &file_openshell_proto_msgTypes[156] + mi := &file_openshell_proto_msgTypes[157] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12186,7 +12259,7 @@ func (x *PushSandboxLogsResponse) String() string { func (*PushSandboxLogsResponse) ProtoMessage() {} func (x *PushSandboxLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[156] + mi := &file_openshell_proto_msgTypes[157] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12199,7 +12272,7 @@ func (x *PushSandboxLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PushSandboxLogsResponse.ProtoReflect.Descriptor instead. func (*PushSandboxLogsResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{156} + return file_openshell_proto_rawDescGZIP(), []int{157} } // Get sandbox logs response. @@ -12215,7 +12288,7 @@ type GetSandboxLogsResponse struct { func (x *GetSandboxLogsResponse) Reset() { *x = GetSandboxLogsResponse{} - mi := &file_openshell_proto_msgTypes[157] + mi := &file_openshell_proto_msgTypes[158] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12227,7 +12300,7 @@ func (x *GetSandboxLogsResponse) String() string { func (*GetSandboxLogsResponse) ProtoMessage() {} func (x *GetSandboxLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[157] + mi := &file_openshell_proto_msgTypes[158] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12240,7 +12313,7 @@ func (x *GetSandboxLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxLogsResponse.ProtoReflect.Descriptor instead. func (*GetSandboxLogsResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{157} + return file_openshell_proto_rawDescGZIP(), []int{158} } func (x *GetSandboxLogsResponse) GetLogs() []*SandboxLogLine { @@ -12273,7 +12346,7 @@ type SupervisorMessage struct { func (x *SupervisorMessage) Reset() { *x = SupervisorMessage{} - mi := &file_openshell_proto_msgTypes[158] + mi := &file_openshell_proto_msgTypes[159] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12285,7 +12358,7 @@ func (x *SupervisorMessage) String() string { func (*SupervisorMessage) ProtoMessage() {} func (x *SupervisorMessage) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[158] + mi := &file_openshell_proto_msgTypes[159] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12298,7 +12371,7 @@ func (x *SupervisorMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorMessage.ProtoReflect.Descriptor instead. func (*SupervisorMessage) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{158} + return file_openshell_proto_rawDescGZIP(), []int{159} } func (x *SupervisorMessage) GetPayload() isSupervisorMessage_Payload { @@ -12389,7 +12462,7 @@ type GatewayMessage struct { func (x *GatewayMessage) Reset() { *x = GatewayMessage{} - mi := &file_openshell_proto_msgTypes[159] + mi := &file_openshell_proto_msgTypes[160] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12401,7 +12474,7 @@ func (x *GatewayMessage) String() string { func (*GatewayMessage) ProtoMessage() {} func (x *GatewayMessage) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[159] + mi := &file_openshell_proto_msgTypes[160] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12414,7 +12487,7 @@ func (x *GatewayMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use GatewayMessage.ProtoReflect.Descriptor instead. func (*GatewayMessage) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{159} + return file_openshell_proto_rawDescGZIP(), []int{160} } func (x *GatewayMessage) GetPayload() isGatewayMessage_Payload { @@ -12518,7 +12591,7 @@ type SupervisorHello struct { func (x *SupervisorHello) Reset() { *x = SupervisorHello{} - mi := &file_openshell_proto_msgTypes[160] + mi := &file_openshell_proto_msgTypes[161] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12530,7 +12603,7 @@ func (x *SupervisorHello) String() string { func (*SupervisorHello) ProtoMessage() {} func (x *SupervisorHello) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[160] + mi := &file_openshell_proto_msgTypes[161] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12543,7 +12616,7 @@ func (x *SupervisorHello) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorHello.ProtoReflect.Descriptor instead. func (*SupervisorHello) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{160} + return file_openshell_proto_rawDescGZIP(), []int{161} } func (x *SupervisorHello) GetSandboxId() string { @@ -12580,7 +12653,7 @@ type SessionAccepted struct { func (x *SessionAccepted) Reset() { *x = SessionAccepted{} - mi := &file_openshell_proto_msgTypes[161] + mi := &file_openshell_proto_msgTypes[162] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12592,7 +12665,7 @@ func (x *SessionAccepted) String() string { func (*SessionAccepted) ProtoMessage() {} func (x *SessionAccepted) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[161] + mi := &file_openshell_proto_msgTypes[162] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12605,7 +12678,7 @@ func (x *SessionAccepted) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionAccepted.ProtoReflect.Descriptor instead. func (*SessionAccepted) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{161} + return file_openshell_proto_rawDescGZIP(), []int{162} } func (x *SessionAccepted) GetSessionId() string { @@ -12633,7 +12706,7 @@ type SessionRejected struct { func (x *SessionRejected) Reset() { *x = SessionRejected{} - mi := &file_openshell_proto_msgTypes[162] + mi := &file_openshell_proto_msgTypes[163] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12645,7 +12718,7 @@ func (x *SessionRejected) String() string { func (*SessionRejected) ProtoMessage() {} func (x *SessionRejected) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[162] + mi := &file_openshell_proto_msgTypes[163] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12658,7 +12731,7 @@ func (x *SessionRejected) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionRejected.ProtoReflect.Descriptor instead. func (*SessionRejected) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{162} + return file_openshell_proto_rawDescGZIP(), []int{163} } func (x *SessionRejected) GetReason() string { @@ -12677,7 +12750,7 @@ type SupervisorHeartbeat struct { func (x *SupervisorHeartbeat) Reset() { *x = SupervisorHeartbeat{} - mi := &file_openshell_proto_msgTypes[163] + mi := &file_openshell_proto_msgTypes[164] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12689,7 +12762,7 @@ func (x *SupervisorHeartbeat) String() string { func (*SupervisorHeartbeat) ProtoMessage() {} func (x *SupervisorHeartbeat) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[163] + mi := &file_openshell_proto_msgTypes[164] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12702,7 +12775,7 @@ func (x *SupervisorHeartbeat) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorHeartbeat.ProtoReflect.Descriptor instead. func (*SupervisorHeartbeat) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{163} + return file_openshell_proto_rawDescGZIP(), []int{164} } // Gateway heartbeat. @@ -12714,7 +12787,7 @@ type GatewayHeartbeat struct { func (x *GatewayHeartbeat) Reset() { *x = GatewayHeartbeat{} - mi := &file_openshell_proto_msgTypes[164] + mi := &file_openshell_proto_msgTypes[165] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12726,7 +12799,7 @@ func (x *GatewayHeartbeat) String() string { func (*GatewayHeartbeat) ProtoMessage() {} func (x *GatewayHeartbeat) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[164] + mi := &file_openshell_proto_msgTypes[165] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12739,7 +12812,7 @@ func (x *GatewayHeartbeat) ProtoReflect() protoreflect.Message { // Deprecated: Use GatewayHeartbeat.ProtoReflect.Descriptor instead. func (*GatewayHeartbeat) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{164} + return file_openshell_proto_rawDescGZIP(), []int{165} } // Terminal result reported before the supervisor shuts down. A successful RPC @@ -12756,7 +12829,7 @@ type ReportMainProcessExitRequest struct { func (x *ReportMainProcessExitRequest) Reset() { *x = ReportMainProcessExitRequest{} - mi := &file_openshell_proto_msgTypes[165] + mi := &file_openshell_proto_msgTypes[166] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12768,7 +12841,7 @@ func (x *ReportMainProcessExitRequest) String() string { func (*ReportMainProcessExitRequest) ProtoMessage() {} func (x *ReportMainProcessExitRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[165] + mi := &file_openshell_proto_msgTypes[166] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12781,7 +12854,7 @@ func (x *ReportMainProcessExitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportMainProcessExitRequest.ProtoReflect.Descriptor instead. func (*ReportMainProcessExitRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{165} + return file_openshell_proto_rawDescGZIP(), []int{166} } func (x *ReportMainProcessExitRequest) GetSandboxId() string { @@ -12813,7 +12886,7 @@ type ReportMainProcessExitResponse struct { func (x *ReportMainProcessExitResponse) Reset() { *x = ReportMainProcessExitResponse{} - mi := &file_openshell_proto_msgTypes[166] + mi := &file_openshell_proto_msgTypes[167] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12825,7 +12898,7 @@ func (x *ReportMainProcessExitResponse) String() string { func (*ReportMainProcessExitResponse) ProtoMessage() {} func (x *ReportMainProcessExitResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[166] + mi := &file_openshell_proto_msgTypes[167] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12838,7 +12911,7 @@ func (x *ReportMainProcessExitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportMainProcessExitResponse.ProtoReflect.Descriptor instead. func (*ReportMainProcessExitResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{166} + return file_openshell_proto_rawDescGZIP(), []int{167} } // Terminal-delivery completion reported after all expected foreground SSH @@ -12853,7 +12926,7 @@ type FinalizeMainProcessExitRequest struct { func (x *FinalizeMainProcessExitRequest) Reset() { *x = FinalizeMainProcessExitRequest{} - mi := &file_openshell_proto_msgTypes[167] + mi := &file_openshell_proto_msgTypes[168] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12865,7 +12938,7 @@ func (x *FinalizeMainProcessExitRequest) String() string { func (*FinalizeMainProcessExitRequest) ProtoMessage() {} func (x *FinalizeMainProcessExitRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[167] + mi := &file_openshell_proto_msgTypes[168] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12878,7 +12951,7 @@ func (x *FinalizeMainProcessExitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeMainProcessExitRequest.ProtoReflect.Descriptor instead. func (*FinalizeMainProcessExitRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{167} + return file_openshell_proto_rawDescGZIP(), []int{168} } func (x *FinalizeMainProcessExitRequest) GetSandboxId() string { @@ -12903,7 +12976,7 @@ type FinalizeMainProcessExitResponse struct { func (x *FinalizeMainProcessExitResponse) Reset() { *x = FinalizeMainProcessExitResponse{} - mi := &file_openshell_proto_msgTypes[168] + mi := &file_openshell_proto_msgTypes[169] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12915,7 +12988,7 @@ func (x *FinalizeMainProcessExitResponse) String() string { func (*FinalizeMainProcessExitResponse) ProtoMessage() {} func (x *FinalizeMainProcessExitResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[168] + mi := &file_openshell_proto_msgTypes[169] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12928,7 +13001,7 @@ func (x *FinalizeMainProcessExitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeMainProcessExitResponse.ProtoReflect.Descriptor instead. func (*FinalizeMainProcessExitResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{168} + return file_openshell_proto_rawDescGZIP(), []int{169} } // Gateway requests the supervisor to open a relay channel. @@ -12957,7 +13030,7 @@ type RelayOpen struct { func (x *RelayOpen) Reset() { *x = RelayOpen{} - mi := &file_openshell_proto_msgTypes[169] + mi := &file_openshell_proto_msgTypes[170] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12969,7 +13042,7 @@ func (x *RelayOpen) String() string { func (*RelayOpen) ProtoMessage() {} func (x *RelayOpen) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[169] + mi := &file_openshell_proto_msgTypes[170] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12982,7 +13055,7 @@ func (x *RelayOpen) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayOpen.ProtoReflect.Descriptor instead. func (*RelayOpen) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{169} + return file_openshell_proto_rawDescGZIP(), []int{170} } func (x *RelayOpen) GetChannelId() string { @@ -13049,7 +13122,7 @@ type SshRelayTarget struct { func (x *SshRelayTarget) Reset() { *x = SshRelayTarget{} - mi := &file_openshell_proto_msgTypes[170] + mi := &file_openshell_proto_msgTypes[171] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13061,7 +13134,7 @@ func (x *SshRelayTarget) String() string { func (*SshRelayTarget) ProtoMessage() {} func (x *SshRelayTarget) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[170] + mi := &file_openshell_proto_msgTypes[171] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13074,7 +13147,7 @@ func (x *SshRelayTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use SshRelayTarget.ProtoReflect.Descriptor instead. func (*SshRelayTarget) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{170} + return file_openshell_proto_rawDescGZIP(), []int{171} } // TCP target dialed by the supervisor from inside the sandbox. @@ -13090,7 +13163,7 @@ type TcpRelayTarget struct { func (x *TcpRelayTarget) Reset() { *x = TcpRelayTarget{} - mi := &file_openshell_proto_msgTypes[171] + mi := &file_openshell_proto_msgTypes[172] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13102,7 +13175,7 @@ func (x *TcpRelayTarget) String() string { func (*TcpRelayTarget) ProtoMessage() {} func (x *TcpRelayTarget) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[171] + mi := &file_openshell_proto_msgTypes[172] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13115,7 +13188,7 @@ func (x *TcpRelayTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use TcpRelayTarget.ProtoReflect.Descriptor instead. func (*TcpRelayTarget) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{171} + return file_openshell_proto_rawDescGZIP(), []int{172} } func (x *TcpRelayTarget) GetHost() string { @@ -13143,7 +13216,7 @@ type RelayInit struct { func (x *RelayInit) Reset() { *x = RelayInit{} - mi := &file_openshell_proto_msgTypes[172] + mi := &file_openshell_proto_msgTypes[173] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13155,7 +13228,7 @@ func (x *RelayInit) String() string { func (*RelayInit) ProtoMessage() {} func (x *RelayInit) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[172] + mi := &file_openshell_proto_msgTypes[173] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13168,7 +13241,7 @@ func (x *RelayInit) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayInit.ProtoReflect.Descriptor instead. func (*RelayInit) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{172} + return file_openshell_proto_rawDescGZIP(), []int{173} } func (x *RelayInit) GetChannelId() string { @@ -13195,7 +13268,7 @@ type RelayFrame struct { func (x *RelayFrame) Reset() { *x = RelayFrame{} - mi := &file_openshell_proto_msgTypes[173] + mi := &file_openshell_proto_msgTypes[174] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13207,7 +13280,7 @@ func (x *RelayFrame) String() string { func (*RelayFrame) ProtoMessage() {} func (x *RelayFrame) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[173] + mi := &file_openshell_proto_msgTypes[174] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13220,7 +13293,7 @@ func (x *RelayFrame) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayFrame.ProtoReflect.Descriptor instead. func (*RelayFrame) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{173} + return file_openshell_proto_rawDescGZIP(), []int{174} } func (x *RelayFrame) GetPayload() isRelayFrame_Payload { @@ -13279,7 +13352,7 @@ type RelayOpenResult struct { func (x *RelayOpenResult) Reset() { *x = RelayOpenResult{} - mi := &file_openshell_proto_msgTypes[174] + mi := &file_openshell_proto_msgTypes[175] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13291,7 +13364,7 @@ func (x *RelayOpenResult) String() string { func (*RelayOpenResult) ProtoMessage() {} func (x *RelayOpenResult) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[174] + mi := &file_openshell_proto_msgTypes[175] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13304,7 +13377,7 @@ func (x *RelayOpenResult) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayOpenResult.ProtoReflect.Descriptor instead. func (*RelayOpenResult) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{174} + return file_openshell_proto_rawDescGZIP(), []int{175} } func (x *RelayOpenResult) GetChannelId() string { @@ -13341,7 +13414,7 @@ type RelayClose struct { func (x *RelayClose) Reset() { *x = RelayClose{} - mi := &file_openshell_proto_msgTypes[175] + mi := &file_openshell_proto_msgTypes[176] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13353,7 +13426,7 @@ func (x *RelayClose) String() string { func (*RelayClose) ProtoMessage() {} func (x *RelayClose) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[175] + mi := &file_openshell_proto_msgTypes[176] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13366,7 +13439,7 @@ func (x *RelayClose) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayClose.ProtoReflect.Descriptor instead. func (*RelayClose) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{175} + return file_openshell_proto_rawDescGZIP(), []int{176} } func (x *RelayClose) GetChannelId() string { @@ -13400,7 +13473,7 @@ type L7RequestSample struct { func (x *L7RequestSample) Reset() { *x = L7RequestSample{} - mi := &file_openshell_proto_msgTypes[176] + mi := &file_openshell_proto_msgTypes[177] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13412,7 +13485,7 @@ func (x *L7RequestSample) String() string { func (*L7RequestSample) ProtoMessage() {} func (x *L7RequestSample) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[176] + mi := &file_openshell_proto_msgTypes[177] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13425,7 +13498,7 @@ func (x *L7RequestSample) ProtoReflect() protoreflect.Message { // Deprecated: Use L7RequestSample.ProtoReflect.Descriptor instead. func (*L7RequestSample) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{176} + return file_openshell_proto_rawDescGZIP(), []int{177} } func (x *L7RequestSample) GetMethod() string { @@ -13499,7 +13572,7 @@ type DenialSummary struct { func (x *DenialSummary) Reset() { *x = DenialSummary{} - mi := &file_openshell_proto_msgTypes[177] + mi := &file_openshell_proto_msgTypes[178] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13511,7 +13584,7 @@ func (x *DenialSummary) String() string { func (*DenialSummary) ProtoMessage() {} func (x *DenialSummary) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[177] + mi := &file_openshell_proto_msgTypes[178] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13524,7 +13597,7 @@ func (x *DenialSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use DenialSummary.ProtoReflect.Descriptor instead. func (*DenialSummary) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{177} + return file_openshell_proto_rawDescGZIP(), []int{178} } func (x *DenialSummary) GetSandboxId() string { @@ -13659,7 +13732,7 @@ type DenialGroupCount struct { func (x *DenialGroupCount) Reset() { *x = DenialGroupCount{} - mi := &file_openshell_proto_msgTypes[178] + mi := &file_openshell_proto_msgTypes[179] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13671,7 +13744,7 @@ func (x *DenialGroupCount) String() string { func (*DenialGroupCount) ProtoMessage() {} func (x *DenialGroupCount) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[178] + mi := &file_openshell_proto_msgTypes[179] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13684,7 +13757,7 @@ func (x *DenialGroupCount) ProtoReflect() protoreflect.Message { // Deprecated: Use DenialGroupCount.ProtoReflect.Descriptor instead. func (*DenialGroupCount) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{178} + return file_openshell_proto_rawDescGZIP(), []int{179} } func (x *DenialGroupCount) GetDenyGroup() string { @@ -13717,7 +13790,7 @@ type NetworkActivitySummary struct { func (x *NetworkActivitySummary) Reset() { *x = NetworkActivitySummary{} - mi := &file_openshell_proto_msgTypes[179] + mi := &file_openshell_proto_msgTypes[180] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13729,7 +13802,7 @@ func (x *NetworkActivitySummary) String() string { func (*NetworkActivitySummary) ProtoMessage() {} func (x *NetworkActivitySummary) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[179] + mi := &file_openshell_proto_msgTypes[180] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13742,7 +13815,7 @@ func (x *NetworkActivitySummary) ProtoReflect() protoreflect.Message { // Deprecated: Use NetworkActivitySummary.ProtoReflect.Descriptor instead. func (*NetworkActivitySummary) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{179} + return file_openshell_proto_rawDescGZIP(), []int{180} } func (x *NetworkActivitySummary) GetNetworkActivityCount() uint32 { @@ -13830,7 +13903,7 @@ type PolicyChunk struct { func (x *PolicyChunk) Reset() { *x = PolicyChunk{} - mi := &file_openshell_proto_msgTypes[180] + mi := &file_openshell_proto_msgTypes[181] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13842,7 +13915,7 @@ func (x *PolicyChunk) String() string { func (*PolicyChunk) ProtoMessage() {} func (x *PolicyChunk) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[180] + mi := &file_openshell_proto_msgTypes[181] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13855,7 +13928,7 @@ func (x *PolicyChunk) ProtoReflect() protoreflect.Message { // Deprecated: Use PolicyChunk.ProtoReflect.Descriptor instead. func (*PolicyChunk) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{180} + return file_openshell_proto_rawDescGZIP(), []int{181} } func (x *PolicyChunk) GetId() string { @@ -14043,7 +14116,7 @@ type DraftPolicyUpdate struct { func (x *DraftPolicyUpdate) Reset() { *x = DraftPolicyUpdate{} - mi := &file_openshell_proto_msgTypes[181] + mi := &file_openshell_proto_msgTypes[182] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14055,7 +14128,7 @@ func (x *DraftPolicyUpdate) String() string { func (*DraftPolicyUpdate) ProtoMessage() {} func (x *DraftPolicyUpdate) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[181] + mi := &file_openshell_proto_msgTypes[182] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14068,7 +14141,7 @@ func (x *DraftPolicyUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftPolicyUpdate.ProtoReflect.Descriptor instead. func (*DraftPolicyUpdate) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{181} + return file_openshell_proto_rawDescGZIP(), []int{182} } func (x *DraftPolicyUpdate) GetDraftVersion() uint64 { @@ -14126,7 +14199,7 @@ type SubmitPolicyAnalysisRequest struct { func (x *SubmitPolicyAnalysisRequest) Reset() { *x = SubmitPolicyAnalysisRequest{} - mi := &file_openshell_proto_msgTypes[182] + mi := &file_openshell_proto_msgTypes[183] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14138,7 +14211,7 @@ func (x *SubmitPolicyAnalysisRequest) String() string { func (*SubmitPolicyAnalysisRequest) ProtoMessage() {} func (x *SubmitPolicyAnalysisRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[182] + mi := &file_openshell_proto_msgTypes[183] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14151,7 +14224,7 @@ func (x *SubmitPolicyAnalysisRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitPolicyAnalysisRequest.ProtoReflect.Descriptor instead. func (*SubmitPolicyAnalysisRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{182} + return file_openshell_proto_rawDescGZIP(), []int{183} } func (x *SubmitPolicyAnalysisRequest) GetSummaries() []*DenialSummary { @@ -14214,7 +14287,7 @@ type SubmitPolicyAnalysisResponse struct { func (x *SubmitPolicyAnalysisResponse) Reset() { *x = SubmitPolicyAnalysisResponse{} - mi := &file_openshell_proto_msgTypes[183] + mi := &file_openshell_proto_msgTypes[184] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14226,7 +14299,7 @@ func (x *SubmitPolicyAnalysisResponse) String() string { func (*SubmitPolicyAnalysisResponse) ProtoMessage() {} func (x *SubmitPolicyAnalysisResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[183] + mi := &file_openshell_proto_msgTypes[184] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14239,7 +14312,7 @@ func (x *SubmitPolicyAnalysisResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitPolicyAnalysisResponse.ProtoReflect.Descriptor instead. func (*SubmitPolicyAnalysisResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{183} + return file_openshell_proto_rawDescGZIP(), []int{184} } func (x *SubmitPolicyAnalysisResponse) GetAcceptedChunks() uint32 { @@ -14285,7 +14358,7 @@ type GetDraftPolicyRequest struct { func (x *GetDraftPolicyRequest) Reset() { *x = GetDraftPolicyRequest{} - mi := &file_openshell_proto_msgTypes[184] + mi := &file_openshell_proto_msgTypes[185] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14297,7 +14370,7 @@ func (x *GetDraftPolicyRequest) String() string { func (*GetDraftPolicyRequest) ProtoMessage() {} func (x *GetDraftPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[184] + mi := &file_openshell_proto_msgTypes[185] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14310,7 +14383,7 @@ func (x *GetDraftPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftPolicyRequest.ProtoReflect.Descriptor instead. func (*GetDraftPolicyRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{184} + return file_openshell_proto_rawDescGZIP(), []int{185} } func (x *GetDraftPolicyRequest) GetName() string { @@ -14350,7 +14423,7 @@ type GetDraftPolicyResponse struct { func (x *GetDraftPolicyResponse) Reset() { *x = GetDraftPolicyResponse{} - mi := &file_openshell_proto_msgTypes[185] + mi := &file_openshell_proto_msgTypes[186] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14362,7 +14435,7 @@ func (x *GetDraftPolicyResponse) String() string { func (*GetDraftPolicyResponse) ProtoMessage() {} func (x *GetDraftPolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[185] + mi := &file_openshell_proto_msgTypes[186] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14375,7 +14448,7 @@ func (x *GetDraftPolicyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftPolicyResponse.ProtoReflect.Descriptor instead. func (*GetDraftPolicyResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{185} + return file_openshell_proto_rawDescGZIP(), []int{186} } func (x *GetDraftPolicyResponse) GetChunks() []*PolicyChunk { @@ -14427,7 +14500,7 @@ type ApproveDraftChunkRequest struct { func (x *ApproveDraftChunkRequest) Reset() { *x = ApproveDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[186] + mi := &file_openshell_proto_msgTypes[187] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14439,7 +14512,7 @@ func (x *ApproveDraftChunkRequest) String() string { func (*ApproveDraftChunkRequest) ProtoMessage() {} func (x *ApproveDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[186] + mi := &file_openshell_proto_msgTypes[187] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14452,7 +14525,7 @@ func (x *ApproveDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveDraftChunkRequest.ProtoReflect.Descriptor instead. func (*ApproveDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{186} + return file_openshell_proto_rawDescGZIP(), []int{187} } func (x *ApproveDraftChunkRequest) GetName() string { @@ -14502,7 +14575,7 @@ type ApproveDraftChunkResponse struct { func (x *ApproveDraftChunkResponse) Reset() { *x = ApproveDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[187] + mi := &file_openshell_proto_msgTypes[188] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14514,7 +14587,7 @@ func (x *ApproveDraftChunkResponse) String() string { func (*ApproveDraftChunkResponse) ProtoMessage() {} func (x *ApproveDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[187] + mi := &file_openshell_proto_msgTypes[188] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14527,7 +14600,7 @@ func (x *ApproveDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveDraftChunkResponse.ProtoReflect.Descriptor instead. func (*ApproveDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{187} + return file_openshell_proto_rawDescGZIP(), []int{188} } func (x *ApproveDraftChunkResponse) GetPolicyVersion() uint32 { @@ -14564,7 +14637,7 @@ type RejectDraftChunkRequest struct { func (x *RejectDraftChunkRequest) Reset() { *x = RejectDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[188] + mi := &file_openshell_proto_msgTypes[189] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14576,7 +14649,7 @@ func (x *RejectDraftChunkRequest) String() string { func (*RejectDraftChunkRequest) ProtoMessage() {} func (x *RejectDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[188] + mi := &file_openshell_proto_msgTypes[189] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14589,7 +14662,7 @@ func (x *RejectDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RejectDraftChunkRequest.ProtoReflect.Descriptor instead. func (*RejectDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{188} + return file_openshell_proto_rawDescGZIP(), []int{189} } func (x *RejectDraftChunkRequest) GetName() string { @@ -14635,7 +14708,7 @@ type RejectDraftChunkResponse struct { func (x *RejectDraftChunkResponse) Reset() { *x = RejectDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[189] + mi := &file_openshell_proto_msgTypes[190] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14647,7 +14720,7 @@ func (x *RejectDraftChunkResponse) String() string { func (*RejectDraftChunkResponse) ProtoMessage() {} func (x *RejectDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[189] + mi := &file_openshell_proto_msgTypes[190] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14660,7 +14733,7 @@ func (x *RejectDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RejectDraftChunkResponse.ProtoReflect.Descriptor instead. func (*RejectDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{189} + return file_openshell_proto_rawDescGZIP(), []int{190} } // Approve all pending chunks. @@ -14674,7 +14747,7 @@ type DraftChunkApproval struct { func (x *DraftChunkApproval) Reset() { *x = DraftChunkApproval{} - mi := &file_openshell_proto_msgTypes[190] + mi := &file_openshell_proto_msgTypes[191] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14686,7 +14759,7 @@ func (x *DraftChunkApproval) String() string { func (*DraftChunkApproval) ProtoMessage() {} func (x *DraftChunkApproval) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[190] + mi := &file_openshell_proto_msgTypes[191] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14699,7 +14772,7 @@ func (x *DraftChunkApproval) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftChunkApproval.ProtoReflect.Descriptor instead. func (*DraftChunkApproval) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{190} + return file_openshell_proto_rawDescGZIP(), []int{191} } func (x *DraftChunkApproval) GetChunkId() string { @@ -14736,7 +14809,7 @@ type ApproveAllDraftChunksRequest struct { func (x *ApproveAllDraftChunksRequest) Reset() { *x = ApproveAllDraftChunksRequest{} - mi := &file_openshell_proto_msgTypes[191] + mi := &file_openshell_proto_msgTypes[192] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14748,7 +14821,7 @@ func (x *ApproveAllDraftChunksRequest) String() string { func (*ApproveAllDraftChunksRequest) ProtoMessage() {} func (x *ApproveAllDraftChunksRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[191] + mi := &file_openshell_proto_msgTypes[192] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14761,7 +14834,7 @@ func (x *ApproveAllDraftChunksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveAllDraftChunksRequest.ProtoReflect.Descriptor instead. func (*ApproveAllDraftChunksRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{191} + return file_openshell_proto_rawDescGZIP(), []int{192} } func (x *ApproveAllDraftChunksRequest) GetName() string { @@ -14816,7 +14889,7 @@ type ApproveAllDraftChunksResponse struct { func (x *ApproveAllDraftChunksResponse) Reset() { *x = ApproveAllDraftChunksResponse{} - mi := &file_openshell_proto_msgTypes[192] + mi := &file_openshell_proto_msgTypes[193] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14828,7 +14901,7 @@ func (x *ApproveAllDraftChunksResponse) String() string { func (*ApproveAllDraftChunksResponse) ProtoMessage() {} func (x *ApproveAllDraftChunksResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[192] + mi := &file_openshell_proto_msgTypes[193] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14841,7 +14914,7 @@ func (x *ApproveAllDraftChunksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveAllDraftChunksResponse.ProtoReflect.Descriptor instead. func (*ApproveAllDraftChunksResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{192} + return file_openshell_proto_rawDescGZIP(), []int{193} } func (x *ApproveAllDraftChunksResponse) GetPolicyVersion() uint32 { @@ -14892,7 +14965,7 @@ type EditDraftChunkRequest struct { func (x *EditDraftChunkRequest) Reset() { *x = EditDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[193] + mi := &file_openshell_proto_msgTypes[194] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14904,7 +14977,7 @@ func (x *EditDraftChunkRequest) String() string { func (*EditDraftChunkRequest) ProtoMessage() {} func (x *EditDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[193] + mi := &file_openshell_proto_msgTypes[194] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14917,7 +14990,7 @@ func (x *EditDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EditDraftChunkRequest.ProtoReflect.Descriptor instead. func (*EditDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{193} + return file_openshell_proto_rawDescGZIP(), []int{194} } func (x *EditDraftChunkRequest) GetName() string { @@ -14963,7 +15036,7 @@ type EditDraftChunkResponse struct { func (x *EditDraftChunkResponse) Reset() { *x = EditDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[194] + mi := &file_openshell_proto_msgTypes[195] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14975,7 +15048,7 @@ func (x *EditDraftChunkResponse) String() string { func (*EditDraftChunkResponse) ProtoMessage() {} func (x *EditDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[194] + mi := &file_openshell_proto_msgTypes[195] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14988,7 +15061,7 @@ func (x *EditDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EditDraftChunkResponse.ProtoReflect.Descriptor instead. func (*EditDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{194} + return file_openshell_proto_rawDescGZIP(), []int{195} } // Reverse an approval (remove merged rule from active policy). @@ -15009,7 +15082,7 @@ type UndoDraftChunkRequest struct { func (x *UndoDraftChunkRequest) Reset() { *x = UndoDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[195] + mi := &file_openshell_proto_msgTypes[196] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15021,7 +15094,7 @@ func (x *UndoDraftChunkRequest) String() string { func (*UndoDraftChunkRequest) ProtoMessage() {} func (x *UndoDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[195] + mi := &file_openshell_proto_msgTypes[196] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15034,7 +15107,7 @@ func (x *UndoDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDraftChunkRequest.ProtoReflect.Descriptor instead. func (*UndoDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{195} + return file_openshell_proto_rawDescGZIP(), []int{196} } func (x *UndoDraftChunkRequest) GetName() string { @@ -15077,7 +15150,7 @@ type UndoDraftChunkResponse struct { func (x *UndoDraftChunkResponse) Reset() { *x = UndoDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[196] + mi := &file_openshell_proto_msgTypes[197] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15089,7 +15162,7 @@ func (x *UndoDraftChunkResponse) String() string { func (*UndoDraftChunkResponse) ProtoMessage() {} func (x *UndoDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[196] + mi := &file_openshell_proto_msgTypes[197] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15102,7 +15175,7 @@ func (x *UndoDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDraftChunkResponse.ProtoReflect.Descriptor instead. func (*UndoDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{196} + return file_openshell_proto_rawDescGZIP(), []int{197} } func (x *UndoDraftChunkResponse) GetPolicyVersion() uint32 { @@ -15135,7 +15208,7 @@ type ClearDraftChunksRequest struct { func (x *ClearDraftChunksRequest) Reset() { *x = ClearDraftChunksRequest{} - mi := &file_openshell_proto_msgTypes[197] + mi := &file_openshell_proto_msgTypes[198] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15147,7 +15220,7 @@ func (x *ClearDraftChunksRequest) String() string { func (*ClearDraftChunksRequest) ProtoMessage() {} func (x *ClearDraftChunksRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[197] + mi := &file_openshell_proto_msgTypes[198] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15160,7 +15233,7 @@ func (x *ClearDraftChunksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearDraftChunksRequest.ProtoReflect.Descriptor instead. func (*ClearDraftChunksRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{197} + return file_openshell_proto_rawDescGZIP(), []int{198} } func (x *ClearDraftChunksRequest) GetName() string { @@ -15194,7 +15267,7 @@ type ClearDraftChunksResponse struct { func (x *ClearDraftChunksResponse) Reset() { *x = ClearDraftChunksResponse{} - mi := &file_openshell_proto_msgTypes[198] + mi := &file_openshell_proto_msgTypes[199] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15206,7 +15279,7 @@ func (x *ClearDraftChunksResponse) String() string { func (*ClearDraftChunksResponse) ProtoMessage() {} func (x *ClearDraftChunksResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[198] + mi := &file_openshell_proto_msgTypes[199] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15219,7 +15292,7 @@ func (x *ClearDraftChunksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearDraftChunksResponse.ProtoReflect.Descriptor instead. func (*ClearDraftChunksResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{198} + return file_openshell_proto_rawDescGZIP(), []int{199} } func (x *ClearDraftChunksResponse) GetChunksCleared() uint32 { @@ -15242,7 +15315,7 @@ type GetDraftHistoryRequest struct { func (x *GetDraftHistoryRequest) Reset() { *x = GetDraftHistoryRequest{} - mi := &file_openshell_proto_msgTypes[199] + mi := &file_openshell_proto_msgTypes[200] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15254,7 +15327,7 @@ func (x *GetDraftHistoryRequest) String() string { func (*GetDraftHistoryRequest) ProtoMessage() {} func (x *GetDraftHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[199] + mi := &file_openshell_proto_msgTypes[200] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15267,7 +15340,7 @@ func (x *GetDraftHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftHistoryRequest.ProtoReflect.Descriptor instead. func (*GetDraftHistoryRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{199} + return file_openshell_proto_rawDescGZIP(), []int{200} } func (x *GetDraftHistoryRequest) GetName() string { @@ -15301,7 +15374,7 @@ type DraftHistoryEntry struct { func (x *DraftHistoryEntry) Reset() { *x = DraftHistoryEntry{} - mi := &file_openshell_proto_msgTypes[200] + mi := &file_openshell_proto_msgTypes[201] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15313,7 +15386,7 @@ func (x *DraftHistoryEntry) String() string { func (*DraftHistoryEntry) ProtoMessage() {} func (x *DraftHistoryEntry) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[200] + mi := &file_openshell_proto_msgTypes[201] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15326,7 +15399,7 @@ func (x *DraftHistoryEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftHistoryEntry.ProtoReflect.Descriptor instead. func (*DraftHistoryEntry) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{200} + return file_openshell_proto_rawDescGZIP(), []int{201} } func (x *DraftHistoryEntry) GetEventTime() *timestamppb.Timestamp { @@ -15367,7 +15440,7 @@ type GetDraftHistoryResponse struct { func (x *GetDraftHistoryResponse) Reset() { *x = GetDraftHistoryResponse{} - mi := &file_openshell_proto_msgTypes[201] + mi := &file_openshell_proto_msgTypes[202] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15379,7 +15452,7 @@ func (x *GetDraftHistoryResponse) String() string { func (*GetDraftHistoryResponse) ProtoMessage() {} func (x *GetDraftHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[201] + mi := &file_openshell_proto_msgTypes[202] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15392,7 +15465,7 @@ func (x *GetDraftHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftHistoryResponse.ProtoReflect.Descriptor instead. func (*GetDraftHistoryResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{201} + return file_openshell_proto_rawDescGZIP(), []int{202} } func (x *GetDraftHistoryResponse) GetEntries() []*DraftHistoryEntry { @@ -15417,7 +15490,7 @@ type CreateWorkspaceRequest struct { func (x *CreateWorkspaceRequest) Reset() { *x = CreateWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[202] + mi := &file_openshell_proto_msgTypes[203] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15429,7 +15502,7 @@ func (x *CreateWorkspaceRequest) String() string { func (*CreateWorkspaceRequest) ProtoMessage() {} func (x *CreateWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[202] + mi := &file_openshell_proto_msgTypes[203] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15442,7 +15515,7 @@ func (x *CreateWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWorkspaceRequest.ProtoReflect.Descriptor instead. func (*CreateWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{202} + return file_openshell_proto_rawDescGZIP(), []int{203} } func (x *CreateWorkspaceRequest) GetName() string { @@ -15476,7 +15549,7 @@ type CreateWorkspaceResponse struct { func (x *CreateWorkspaceResponse) Reset() { *x = CreateWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[203] + mi := &file_openshell_proto_msgTypes[204] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15488,7 +15561,7 @@ func (x *CreateWorkspaceResponse) String() string { func (*CreateWorkspaceResponse) ProtoMessage() {} func (x *CreateWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[203] + mi := &file_openshell_proto_msgTypes[204] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15501,7 +15574,7 @@ func (x *CreateWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWorkspaceResponse.ProtoReflect.Descriptor instead. func (*CreateWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{203} + return file_openshell_proto_rawDescGZIP(), []int{204} } func (x *CreateWorkspaceResponse) GetWorkspace() *datamodelv1.Workspace { @@ -15522,7 +15595,7 @@ type GetWorkspaceRequest struct { func (x *GetWorkspaceRequest) Reset() { *x = GetWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[204] + mi := &file_openshell_proto_msgTypes[205] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15534,7 +15607,7 @@ func (x *GetWorkspaceRequest) String() string { func (*GetWorkspaceRequest) ProtoMessage() {} func (x *GetWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[204] + mi := &file_openshell_proto_msgTypes[205] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15547,7 +15620,7 @@ func (x *GetWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWorkspaceRequest.ProtoReflect.Descriptor instead. func (*GetWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{204} + return file_openshell_proto_rawDescGZIP(), []int{205} } func (x *GetWorkspaceRequest) GetName() string { @@ -15567,7 +15640,7 @@ type GetWorkspaceResponse struct { func (x *GetWorkspaceResponse) Reset() { *x = GetWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[205] + mi := &file_openshell_proto_msgTypes[206] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15579,7 +15652,7 @@ func (x *GetWorkspaceResponse) String() string { func (*GetWorkspaceResponse) ProtoMessage() {} func (x *GetWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[205] + mi := &file_openshell_proto_msgTypes[206] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15592,7 +15665,7 @@ func (x *GetWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWorkspaceResponse.ProtoReflect.Descriptor instead. func (*GetWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{205} + return file_openshell_proto_rawDescGZIP(), []int{206} } func (x *GetWorkspaceResponse) GetWorkspace() *datamodelv1.Workspace { @@ -15619,7 +15692,7 @@ type ListWorkspacesRequest struct { func (x *ListWorkspacesRequest) Reset() { *x = ListWorkspacesRequest{} - mi := &file_openshell_proto_msgTypes[206] + mi := &file_openshell_proto_msgTypes[207] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15631,7 +15704,7 @@ func (x *ListWorkspacesRequest) String() string { func (*ListWorkspacesRequest) ProtoMessage() {} func (x *ListWorkspacesRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[206] + mi := &file_openshell_proto_msgTypes[207] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15644,7 +15717,7 @@ func (x *ListWorkspacesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspacesRequest.ProtoReflect.Descriptor instead. func (*ListWorkspacesRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{206} + return file_openshell_proto_rawDescGZIP(), []int{207} } func (x *ListWorkspacesRequest) GetPageSize() int32 { @@ -15680,7 +15753,7 @@ type ListWorkspacesResponse struct { func (x *ListWorkspacesResponse) Reset() { *x = ListWorkspacesResponse{} - mi := &file_openshell_proto_msgTypes[207] + mi := &file_openshell_proto_msgTypes[208] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15692,7 +15765,7 @@ func (x *ListWorkspacesResponse) String() string { func (*ListWorkspacesResponse) ProtoMessage() {} func (x *ListWorkspacesResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[207] + mi := &file_openshell_proto_msgTypes[208] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15705,7 +15778,7 @@ func (x *ListWorkspacesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspacesResponse.ProtoReflect.Descriptor instead. func (*ListWorkspacesResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{207} + return file_openshell_proto_rawDescGZIP(), []int{208} } func (x *ListWorkspacesResponse) GetWorkspaces() []*datamodelv1.Workspace { @@ -15736,7 +15809,7 @@ type DeleteWorkspaceRequest struct { func (x *DeleteWorkspaceRequest) Reset() { *x = DeleteWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[208] + mi := &file_openshell_proto_msgTypes[209] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15748,7 +15821,7 @@ func (x *DeleteWorkspaceRequest) String() string { func (*DeleteWorkspaceRequest) ProtoMessage() {} func (x *DeleteWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[208] + mi := &file_openshell_proto_msgTypes[209] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15761,7 +15834,7 @@ func (x *DeleteWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteWorkspaceRequest.ProtoReflect.Descriptor instead. func (*DeleteWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{208} + return file_openshell_proto_rawDescGZIP(), []int{209} } func (x *DeleteWorkspaceRequest) GetName() string { @@ -15795,7 +15868,7 @@ type DeleteWorkspaceResponse struct { func (x *DeleteWorkspaceResponse) Reset() { *x = DeleteWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[209] + mi := &file_openshell_proto_msgTypes[210] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15807,7 +15880,7 @@ func (x *DeleteWorkspaceResponse) String() string { func (*DeleteWorkspaceResponse) ProtoMessage() {} func (x *DeleteWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[209] + mi := &file_openshell_proto_msgTypes[210] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15820,7 +15893,7 @@ func (x *DeleteWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteWorkspaceResponse.ProtoReflect.Descriptor instead. func (*DeleteWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{209} + return file_openshell_proto_rawDescGZIP(), []int{210} } func (x *DeleteWorkspaceResponse) GetOutcome() DeletionOutcome { @@ -15844,7 +15917,7 @@ type WorkspaceMember struct { func (x *WorkspaceMember) Reset() { *x = WorkspaceMember{} - mi := &file_openshell_proto_msgTypes[210] + mi := &file_openshell_proto_msgTypes[211] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15856,7 +15929,7 @@ func (x *WorkspaceMember) String() string { func (*WorkspaceMember) ProtoMessage() {} func (x *WorkspaceMember) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[210] + mi := &file_openshell_proto_msgTypes[211] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15869,7 +15942,7 @@ func (x *WorkspaceMember) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkspaceMember.ProtoReflect.Descriptor instead. func (*WorkspaceMember) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{210} + return file_openshell_proto_rawDescGZIP(), []int{211} } func (x *WorkspaceMember) GetMetadata() *datamodelv1.ObjectMeta { @@ -15910,7 +15983,7 @@ type AddWorkspaceMemberRequest struct { func (x *AddWorkspaceMemberRequest) Reset() { *x = AddWorkspaceMemberRequest{} - mi := &file_openshell_proto_msgTypes[211] + mi := &file_openshell_proto_msgTypes[212] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15922,7 +15995,7 @@ func (x *AddWorkspaceMemberRequest) String() string { func (*AddWorkspaceMemberRequest) ProtoMessage() {} func (x *AddWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[211] + mi := &file_openshell_proto_msgTypes[212] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15935,7 +16008,7 @@ func (x *AddWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddWorkspaceMemberRequest.ProtoReflect.Descriptor instead. func (*AddWorkspaceMemberRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{211} + return file_openshell_proto_rawDescGZIP(), []int{212} } func (x *AddWorkspaceMemberRequest) GetWorkspace() string { @@ -15976,7 +16049,7 @@ type AddWorkspaceMemberResponse struct { func (x *AddWorkspaceMemberResponse) Reset() { *x = AddWorkspaceMemberResponse{} - mi := &file_openshell_proto_msgTypes[212] + mi := &file_openshell_proto_msgTypes[213] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15988,7 +16061,7 @@ func (x *AddWorkspaceMemberResponse) String() string { func (*AddWorkspaceMemberResponse) ProtoMessage() {} func (x *AddWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[212] + mi := &file_openshell_proto_msgTypes[213] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16001,7 +16074,7 @@ func (x *AddWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddWorkspaceMemberResponse.ProtoReflect.Descriptor instead. func (*AddWorkspaceMemberResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{212} + return file_openshell_proto_rawDescGZIP(), []int{213} } func (x *AddWorkspaceMemberResponse) GetMember() *WorkspaceMember { @@ -16027,7 +16100,7 @@ type RemoveWorkspaceMemberRequest struct { func (x *RemoveWorkspaceMemberRequest) Reset() { *x = RemoveWorkspaceMemberRequest{} - mi := &file_openshell_proto_msgTypes[213] + mi := &file_openshell_proto_msgTypes[214] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16039,7 +16112,7 @@ func (x *RemoveWorkspaceMemberRequest) String() string { func (*RemoveWorkspaceMemberRequest) ProtoMessage() {} func (x *RemoveWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[213] + mi := &file_openshell_proto_msgTypes[214] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16052,7 +16125,7 @@ func (x *RemoveWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveWorkspaceMemberRequest.ProtoReflect.Descriptor instead. func (*RemoveWorkspaceMemberRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{213} + return file_openshell_proto_rawDescGZIP(), []int{214} } func (x *RemoveWorkspaceMemberRequest) GetWorkspace() string { @@ -16093,7 +16166,7 @@ type RemoveWorkspaceMemberResponse struct { func (x *RemoveWorkspaceMemberResponse) Reset() { *x = RemoveWorkspaceMemberResponse{} - mi := &file_openshell_proto_msgTypes[214] + mi := &file_openshell_proto_msgTypes[215] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16105,7 +16178,7 @@ func (x *RemoveWorkspaceMemberResponse) String() string { func (*RemoveWorkspaceMemberResponse) ProtoMessage() {} func (x *RemoveWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[214] + mi := &file_openshell_proto_msgTypes[215] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16118,7 +16191,7 @@ func (x *RemoveWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveWorkspaceMemberResponse.ProtoReflect.Descriptor instead. func (*RemoveWorkspaceMemberResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{214} + return file_openshell_proto_rawDescGZIP(), []int{215} } func (x *RemoveWorkspaceMemberResponse) GetOutcome() DeletionOutcome { @@ -16145,7 +16218,7 @@ type ListWorkspaceMembersRequest struct { func (x *ListWorkspaceMembersRequest) Reset() { *x = ListWorkspaceMembersRequest{} - mi := &file_openshell_proto_msgTypes[215] + mi := &file_openshell_proto_msgTypes[216] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16157,7 +16230,7 @@ func (x *ListWorkspaceMembersRequest) String() string { func (*ListWorkspaceMembersRequest) ProtoMessage() {} func (x *ListWorkspaceMembersRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[215] + mi := &file_openshell_proto_msgTypes[216] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16170,7 +16243,7 @@ func (x *ListWorkspaceMembersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspaceMembersRequest.ProtoReflect.Descriptor instead. func (*ListWorkspaceMembersRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{215} + return file_openshell_proto_rawDescGZIP(), []int{216} } func (x *ListWorkspaceMembersRequest) GetWorkspace() string { @@ -16206,7 +16279,7 @@ type ListWorkspaceMembersResponse struct { func (x *ListWorkspaceMembersResponse) Reset() { *x = ListWorkspaceMembersResponse{} - mi := &file_openshell_proto_msgTypes[216] + mi := &file_openshell_proto_msgTypes[217] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16218,7 +16291,7 @@ func (x *ListWorkspaceMembersResponse) String() string { func (*ListWorkspaceMembersResponse) ProtoMessage() {} func (x *ListWorkspaceMembersResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[216] + mi := &file_openshell_proto_msgTypes[217] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16231,7 +16304,7 @@ func (x *ListWorkspaceMembersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspaceMembersResponse.ProtoReflect.Descriptor instead. func (*ListWorkspaceMembersResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{216} + return file_openshell_proto_rawDescGZIP(), []int{217} } func (x *ListWorkspaceMembersResponse) GetMembers() []*WorkspaceMember { @@ -16266,7 +16339,7 @@ type ExtensionServiceCredential struct { func (x *ExtensionServiceCredential) Reset() { *x = ExtensionServiceCredential{} - mi := &file_openshell_proto_msgTypes[217] + mi := &file_openshell_proto_msgTypes[218] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16278,7 +16351,7 @@ func (x *ExtensionServiceCredential) String() string { func (*ExtensionServiceCredential) ProtoMessage() {} func (x *ExtensionServiceCredential) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[217] + mi := &file_openshell_proto_msgTypes[218] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16291,7 +16364,7 @@ func (x *ExtensionServiceCredential) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtensionServiceCredential.ProtoReflect.Descriptor instead. func (*ExtensionServiceCredential) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{217} + return file_openshell_proto_rawDescGZIP(), []int{218} } func (x *ExtensionServiceCredential) GetServiceName() string { @@ -16328,7 +16401,7 @@ type EndpointObservation struct { func (x *EndpointObservation) Reset() { *x = EndpointObservation{} - mi := &file_openshell_proto_msgTypes[218] + mi := &file_openshell_proto_msgTypes[219] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16340,7 +16413,7 @@ func (x *EndpointObservation) String() string { func (*EndpointObservation) ProtoMessage() {} func (x *EndpointObservation) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[218] + mi := &file_openshell_proto_msgTypes[219] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16353,7 +16426,7 @@ func (x *EndpointObservation) ProtoReflect() protoreflect.Message { // Deprecated: Use EndpointObservation.ProtoReflect.Descriptor instead. func (*EndpointObservation) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{218} + return file_openshell_proto_rawDescGZIP(), []int{219} } func (x *EndpointObservation) GetEndpointId() string { @@ -16396,7 +16469,7 @@ type ReportEndpointStatusRequest struct { func (x *ReportEndpointStatusRequest) Reset() { *x = ReportEndpointStatusRequest{} - mi := &file_openshell_proto_msgTypes[219] + mi := &file_openshell_proto_msgTypes[220] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16408,7 +16481,7 @@ func (x *ReportEndpointStatusRequest) String() string { func (*ReportEndpointStatusRequest) ProtoMessage() {} func (x *ReportEndpointStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[219] + mi := &file_openshell_proto_msgTypes[220] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16421,7 +16494,7 @@ func (x *ReportEndpointStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportEndpointStatusRequest.ProtoReflect.Descriptor instead. func (*ReportEndpointStatusRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{219} + return file_openshell_proto_rawDescGZIP(), []int{220} } func (x *ReportEndpointStatusRequest) GetSandboxId() string { @@ -16482,7 +16555,7 @@ type ReportEndpointStatusResponse struct { func (x *ReportEndpointStatusResponse) Reset() { *x = ReportEndpointStatusResponse{} - mi := &file_openshell_proto_msgTypes[220] + mi := &file_openshell_proto_msgTypes[221] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16494,7 +16567,7 @@ func (x *ReportEndpointStatusResponse) String() string { func (*ReportEndpointStatusResponse) ProtoMessage() {} func (x *ReportEndpointStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[220] + mi := &file_openshell_proto_msgTypes[221] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16507,7 +16580,7 @@ func (x *ReportEndpointStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportEndpointStatusResponse.ProtoReflect.Descriptor instead. func (*ReportEndpointStatusResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{220} + return file_openshell_proto_rawDescGZIP(), []int{221} } // A configured endpoint and its last accepted network result in one record. @@ -16536,7 +16609,7 @@ type EndpointStatus struct { func (x *EndpointStatus) Reset() { *x = EndpointStatus{} - mi := &file_openshell_proto_msgTypes[221] + mi := &file_openshell_proto_msgTypes[222] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16548,7 +16621,7 @@ func (x *EndpointStatus) String() string { func (*EndpointStatus) ProtoMessage() {} func (x *EndpointStatus) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[221] + mi := &file_openshell_proto_msgTypes[222] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16561,7 +16634,7 @@ func (x *EndpointStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use EndpointStatus.ProtoReflect.Descriptor instead. func (*EndpointStatus) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{221} + return file_openshell_proto_rawDescGZIP(), []int{222} } func (x *EndpointStatus) GetEndpointId() string { @@ -17437,16 +17510,23 @@ const file_openshell_proto_rawDesc = "" + "\x04host\x18\x02 \x01(\tR\x04host\x12\x12\n" + "\x04port\x18\x03 \x01(\rR\x04port\"0\n" + "\x11RemoveNetworkRule\x12\x1b\n" + - "\trule_name\x18\x01 \x01(\tR\bruleName\"w\n" + - "\fAddDenyRules\x12\x12\n" + - "\x04host\x18\x01 \x01(\tR\x04host\x12\x12\n" + - "\x04port\x18\x02 \x01(\rR\x04port\x12?\n" + + "\trule_name\x18\x01 \x01(\tR\bruleName\"\xd7\x01\n" + + "\fL7RuleTarget\x12\x1b\n" + + "\trule_name\x18\x01 \x01(\tR\bruleName\x12\x12\n" + + "\x04host\x18\x02 \x01(\tR\x04host\x12\x14\n" + + "\x05ports\x18\x03 \x03(\rR\x05ports\x12\x17\n" + + "\x04path\x18\x04 \x01(\tH\x00R\x04path\x88\x01\x01\x12?\n" + + "\bbinaries\x18\x05 \x03(\v2#.openshell.sandbox.v1.NetworkBinaryR\bbinaries\x12\x1d\n" + "\n" + - "deny_rules\x18\x03 \x03(\v2 .openshell.sandbox.v1.L7DenyRuleR\tdenyRules\"k\n" + - "\rAddAllowRules\x12\x12\n" + - "\x04host\x18\x01 \x01(\tR\x04host\x12\x12\n" + - "\x04port\x18\x02 \x01(\rR\x04port\x122\n" + - "\x05rules\x18\x03 \x03(\v2\x1c.openshell.sandbox.v1.L7RuleR\x05rules\"S\n" + + "any_binary\x18\x06 \x01(\bR\tanyBinaryB\a\n" + + "\x05_path\"\x9b\x01\n" + + "\fAddDenyRules\x12?\n" + + "\n" + + "deny_rules\x18\x03 \x03(\v2 .openshell.sandbox.v1.L7DenyRuleR\tdenyRules\x122\n" + + "\x06target\x18\x04 \x01(\v2\x1a.openshell.v1.L7RuleTargetR\x06targetJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\x04hostR\x04port\"\x8f\x01\n" + + "\rAddAllowRules\x122\n" + + "\x05rules\x18\x03 \x03(\v2\x1c.openshell.sandbox.v1.L7RuleR\x05rules\x122\n" + + "\x06target\x18\x04 \x01(\v2\x1a.openshell.v1.L7RuleTargetR\x06targetJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\x04hostR\x04port\"S\n" + "\x13RemoveNetworkBinary\x12\x1b\n" + "\trule_name\x18\x01 \x01(\tR\bruleName\x12\x1f\n" + "\vbinary_path\x18\x02 \x01(\tR\n" + @@ -18140,7 +18220,7 @@ func file_openshell_proto_rawDescGZIP() []byte { } var file_openshell_proto_enumTypes = make([]protoimpl.EnumInfo, 16) -var file_openshell_proto_msgTypes = make([]protoimpl.MessageInfo, 243) +var file_openshell_proto_msgTypes = make([]protoimpl.MessageInfo, 244) var file_openshell_proto_goTypes = []any{ (SandboxPhase)(0), // 0: openshell.v1.SandboxPhase (ProviderMutationKind)(0), // 1: openshell.v1.ProviderMutationKind @@ -18301,131 +18381,132 @@ var file_openshell_proto_goTypes = []any{ (*AddNetworkRule)(nil), // 156: openshell.v1.AddNetworkRule (*RemoveNetworkEndpoint)(nil), // 157: openshell.v1.RemoveNetworkEndpoint (*RemoveNetworkRule)(nil), // 158: openshell.v1.RemoveNetworkRule - (*AddDenyRules)(nil), // 159: openshell.v1.AddDenyRules - (*AddAllowRules)(nil), // 160: openshell.v1.AddAllowRules - (*RemoveNetworkBinary)(nil), // 161: openshell.v1.RemoveNetworkBinary - (*UpdateConfigResponse)(nil), // 162: openshell.v1.UpdateConfigResponse - (*GetSandboxPolicyStatusRequest)(nil), // 163: openshell.v1.GetSandboxPolicyStatusRequest - (*GetSandboxPolicyStatusResponse)(nil), // 164: openshell.v1.GetSandboxPolicyStatusResponse - (*ListSandboxPoliciesRequest)(nil), // 165: openshell.v1.ListSandboxPoliciesRequest - (*ListSandboxPoliciesResponse)(nil), // 166: openshell.v1.ListSandboxPoliciesResponse - (*ReportPolicyStatusRequest)(nil), // 167: openshell.v1.ReportPolicyStatusRequest - (*ReportPolicyStatusResponse)(nil), // 168: openshell.v1.ReportPolicyStatusResponse - (*SandboxPolicyRevision)(nil), // 169: openshell.v1.SandboxPolicyRevision - (*GetSandboxLogsRequest)(nil), // 170: openshell.v1.GetSandboxLogsRequest - (*PushSandboxLogsRequest)(nil), // 171: openshell.v1.PushSandboxLogsRequest - (*PushSandboxLogsResponse)(nil), // 172: openshell.v1.PushSandboxLogsResponse - (*GetSandboxLogsResponse)(nil), // 173: openshell.v1.GetSandboxLogsResponse - (*SupervisorMessage)(nil), // 174: openshell.v1.SupervisorMessage - (*GatewayMessage)(nil), // 175: openshell.v1.GatewayMessage - (*SupervisorHello)(nil), // 176: openshell.v1.SupervisorHello - (*SessionAccepted)(nil), // 177: openshell.v1.SessionAccepted - (*SessionRejected)(nil), // 178: openshell.v1.SessionRejected - (*SupervisorHeartbeat)(nil), // 179: openshell.v1.SupervisorHeartbeat - (*GatewayHeartbeat)(nil), // 180: openshell.v1.GatewayHeartbeat - (*ReportMainProcessExitRequest)(nil), // 181: openshell.v1.ReportMainProcessExitRequest - (*ReportMainProcessExitResponse)(nil), // 182: openshell.v1.ReportMainProcessExitResponse - (*FinalizeMainProcessExitRequest)(nil), // 183: openshell.v1.FinalizeMainProcessExitRequest - (*FinalizeMainProcessExitResponse)(nil), // 184: openshell.v1.FinalizeMainProcessExitResponse - (*RelayOpen)(nil), // 185: openshell.v1.RelayOpen - (*SshRelayTarget)(nil), // 186: openshell.v1.SshRelayTarget - (*TcpRelayTarget)(nil), // 187: openshell.v1.TcpRelayTarget - (*RelayInit)(nil), // 188: openshell.v1.RelayInit - (*RelayFrame)(nil), // 189: openshell.v1.RelayFrame - (*RelayOpenResult)(nil), // 190: openshell.v1.RelayOpenResult - (*RelayClose)(nil), // 191: openshell.v1.RelayClose - (*L7RequestSample)(nil), // 192: openshell.v1.L7RequestSample - (*DenialSummary)(nil), // 193: openshell.v1.DenialSummary - (*DenialGroupCount)(nil), // 194: openshell.v1.DenialGroupCount - (*NetworkActivitySummary)(nil), // 195: openshell.v1.NetworkActivitySummary - (*PolicyChunk)(nil), // 196: openshell.v1.PolicyChunk - (*DraftPolicyUpdate)(nil), // 197: openshell.v1.DraftPolicyUpdate - (*SubmitPolicyAnalysisRequest)(nil), // 198: openshell.v1.SubmitPolicyAnalysisRequest - (*SubmitPolicyAnalysisResponse)(nil), // 199: openshell.v1.SubmitPolicyAnalysisResponse - (*GetDraftPolicyRequest)(nil), // 200: openshell.v1.GetDraftPolicyRequest - (*GetDraftPolicyResponse)(nil), // 201: openshell.v1.GetDraftPolicyResponse - (*ApproveDraftChunkRequest)(nil), // 202: openshell.v1.ApproveDraftChunkRequest - (*ApproveDraftChunkResponse)(nil), // 203: openshell.v1.ApproveDraftChunkResponse - (*RejectDraftChunkRequest)(nil), // 204: openshell.v1.RejectDraftChunkRequest - (*RejectDraftChunkResponse)(nil), // 205: openshell.v1.RejectDraftChunkResponse - (*DraftChunkApproval)(nil), // 206: openshell.v1.DraftChunkApproval - (*ApproveAllDraftChunksRequest)(nil), // 207: openshell.v1.ApproveAllDraftChunksRequest - (*ApproveAllDraftChunksResponse)(nil), // 208: openshell.v1.ApproveAllDraftChunksResponse - (*EditDraftChunkRequest)(nil), // 209: openshell.v1.EditDraftChunkRequest - (*EditDraftChunkResponse)(nil), // 210: openshell.v1.EditDraftChunkResponse - (*UndoDraftChunkRequest)(nil), // 211: openshell.v1.UndoDraftChunkRequest - (*UndoDraftChunkResponse)(nil), // 212: openshell.v1.UndoDraftChunkResponse - (*ClearDraftChunksRequest)(nil), // 213: openshell.v1.ClearDraftChunksRequest - (*ClearDraftChunksResponse)(nil), // 214: openshell.v1.ClearDraftChunksResponse - (*GetDraftHistoryRequest)(nil), // 215: openshell.v1.GetDraftHistoryRequest - (*DraftHistoryEntry)(nil), // 216: openshell.v1.DraftHistoryEntry - (*GetDraftHistoryResponse)(nil), // 217: openshell.v1.GetDraftHistoryResponse - (*CreateWorkspaceRequest)(nil), // 218: openshell.v1.CreateWorkspaceRequest - (*CreateWorkspaceResponse)(nil), // 219: openshell.v1.CreateWorkspaceResponse - (*GetWorkspaceRequest)(nil), // 220: openshell.v1.GetWorkspaceRequest - (*GetWorkspaceResponse)(nil), // 221: openshell.v1.GetWorkspaceResponse - (*ListWorkspacesRequest)(nil), // 222: openshell.v1.ListWorkspacesRequest - (*ListWorkspacesResponse)(nil), // 223: openshell.v1.ListWorkspacesResponse - (*DeleteWorkspaceRequest)(nil), // 224: openshell.v1.DeleteWorkspaceRequest - (*DeleteWorkspaceResponse)(nil), // 225: openshell.v1.DeleteWorkspaceResponse - (*WorkspaceMember)(nil), // 226: openshell.v1.WorkspaceMember - (*AddWorkspaceMemberRequest)(nil), // 227: openshell.v1.AddWorkspaceMemberRequest - (*AddWorkspaceMemberResponse)(nil), // 228: openshell.v1.AddWorkspaceMemberResponse - (*RemoveWorkspaceMemberRequest)(nil), // 229: openshell.v1.RemoveWorkspaceMemberRequest - (*RemoveWorkspaceMemberResponse)(nil), // 230: openshell.v1.RemoveWorkspaceMemberResponse - (*ListWorkspaceMembersRequest)(nil), // 231: openshell.v1.ListWorkspaceMembersRequest - (*ListWorkspaceMembersResponse)(nil), // 232: openshell.v1.ListWorkspaceMembersResponse - (*ExtensionServiceCredential)(nil), // 233: openshell.v1.ExtensionServiceCredential - (*EndpointObservation)(nil), // 234: openshell.v1.EndpointObservation - (*ReportEndpointStatusRequest)(nil), // 235: openshell.v1.ReportEndpointStatusRequest - (*ReportEndpointStatusResponse)(nil), // 236: openshell.v1.ReportEndpointStatusResponse - (*EndpointStatus)(nil), // 237: openshell.v1.EndpointStatus - nil, // 238: openshell.v1.SandboxSpec.EnvironmentEntry - nil, // 239: openshell.v1.SandboxTemplate.LabelsEntry - nil, // 240: openshell.v1.SandboxTemplate.AnnotationsEntry - nil, // 241: openshell.v1.SandboxTemplate.EnvironmentEntry - nil, // 242: openshell.v1.SandboxWorkloadConfig.EnvironmentEntry - nil, // 243: openshell.v1.PlatformEvent.MetadataEntry - nil, // 244: openshell.v1.CreateSandboxRequest.LabelsEntry - nil, // 245: openshell.v1.CreateSandboxRequest.AnnotationsEntry - nil, // 246: openshell.v1.ExecSandboxRequest.EnvironmentEntry - nil, // 247: openshell.v1.SandboxLogLine.FieldsEntry - nil, // 248: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry - nil, // 249: openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry - nil, // 250: openshell.v1.ProviderProfile.AnnotationsEntry - nil, // 251: openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry - nil, // 252: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry - nil, // 253: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry - nil, // 254: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry - nil, // 255: openshell.v1.UpdateConfigRequest.AnnotationsEntry - nil, // 256: openshell.v1.UpdateConfigResponse.AnnotationsEntry - nil, // 257: openshell.v1.SandboxPolicyRevision.ProvenanceEntry - nil, // 258: openshell.v1.CreateWorkspaceRequest.LabelsEntry - (*timestamppb.Timestamp)(nil), // 259: google.protobuf.Timestamp - (*datamodelv1.ObjectMeta)(nil), // 260: openshell.datamodel.v1.ObjectMeta - (*sandboxv1.SandboxPolicy)(nil), // 261: openshell.sandbox.v1.SandboxPolicy - (*structpb.Struct)(nil), // 262: google.protobuf.Struct - (*durationpb.Duration)(nil), // 263: google.protobuf.Duration - (*datamodelv1.WorkspaceSelector)(nil), // 264: openshell.datamodel.v1.WorkspaceSelector - (*datamodelv1.Provider)(nil), // 265: openshell.datamodel.v1.Provider - (sandboxv1.PolicySource)(0), // 266: openshell.sandbox.v1.PolicySource - (*sandboxv1.NetworkEndpoint)(nil), // 267: openshell.sandbox.v1.NetworkEndpoint - (*sandboxv1.NetworkBinary)(nil), // 268: openshell.sandbox.v1.NetworkBinary - (*sandboxv1.SettingValue)(nil), // 269: openshell.sandbox.v1.SettingValue - (*sandboxv1.NetworkPolicyRule)(nil), // 270: openshell.sandbox.v1.NetworkPolicyRule - (*sandboxv1.L7DenyRule)(nil), // 271: openshell.sandbox.v1.L7DenyRule - (*sandboxv1.L7Rule)(nil), // 272: openshell.sandbox.v1.L7Rule - (*datamodelv1.Workspace)(nil), // 273: openshell.datamodel.v1.Workspace - (*sandboxv1.GetSandboxConfigRequest)(nil), // 274: openshell.sandbox.v1.GetSandboxConfigRequest - (*sandboxv1.GetGatewayConfigRequest)(nil), // 275: openshell.sandbox.v1.GetGatewayConfigRequest - (*sandboxv1.GetSandboxConfigResponse)(nil), // 276: openshell.sandbox.v1.GetSandboxConfigResponse - (*sandboxv1.GetGatewayConfigResponse)(nil), // 277: openshell.sandbox.v1.GetGatewayConfigResponse + (*L7RuleTarget)(nil), // 159: openshell.v1.L7RuleTarget + (*AddDenyRules)(nil), // 160: openshell.v1.AddDenyRules + (*AddAllowRules)(nil), // 161: openshell.v1.AddAllowRules + (*RemoveNetworkBinary)(nil), // 162: openshell.v1.RemoveNetworkBinary + (*UpdateConfigResponse)(nil), // 163: openshell.v1.UpdateConfigResponse + (*GetSandboxPolicyStatusRequest)(nil), // 164: openshell.v1.GetSandboxPolicyStatusRequest + (*GetSandboxPolicyStatusResponse)(nil), // 165: openshell.v1.GetSandboxPolicyStatusResponse + (*ListSandboxPoliciesRequest)(nil), // 166: openshell.v1.ListSandboxPoliciesRequest + (*ListSandboxPoliciesResponse)(nil), // 167: openshell.v1.ListSandboxPoliciesResponse + (*ReportPolicyStatusRequest)(nil), // 168: openshell.v1.ReportPolicyStatusRequest + (*ReportPolicyStatusResponse)(nil), // 169: openshell.v1.ReportPolicyStatusResponse + (*SandboxPolicyRevision)(nil), // 170: openshell.v1.SandboxPolicyRevision + (*GetSandboxLogsRequest)(nil), // 171: openshell.v1.GetSandboxLogsRequest + (*PushSandboxLogsRequest)(nil), // 172: openshell.v1.PushSandboxLogsRequest + (*PushSandboxLogsResponse)(nil), // 173: openshell.v1.PushSandboxLogsResponse + (*GetSandboxLogsResponse)(nil), // 174: openshell.v1.GetSandboxLogsResponse + (*SupervisorMessage)(nil), // 175: openshell.v1.SupervisorMessage + (*GatewayMessage)(nil), // 176: openshell.v1.GatewayMessage + (*SupervisorHello)(nil), // 177: openshell.v1.SupervisorHello + (*SessionAccepted)(nil), // 178: openshell.v1.SessionAccepted + (*SessionRejected)(nil), // 179: openshell.v1.SessionRejected + (*SupervisorHeartbeat)(nil), // 180: openshell.v1.SupervisorHeartbeat + (*GatewayHeartbeat)(nil), // 181: openshell.v1.GatewayHeartbeat + (*ReportMainProcessExitRequest)(nil), // 182: openshell.v1.ReportMainProcessExitRequest + (*ReportMainProcessExitResponse)(nil), // 183: openshell.v1.ReportMainProcessExitResponse + (*FinalizeMainProcessExitRequest)(nil), // 184: openshell.v1.FinalizeMainProcessExitRequest + (*FinalizeMainProcessExitResponse)(nil), // 185: openshell.v1.FinalizeMainProcessExitResponse + (*RelayOpen)(nil), // 186: openshell.v1.RelayOpen + (*SshRelayTarget)(nil), // 187: openshell.v1.SshRelayTarget + (*TcpRelayTarget)(nil), // 188: openshell.v1.TcpRelayTarget + (*RelayInit)(nil), // 189: openshell.v1.RelayInit + (*RelayFrame)(nil), // 190: openshell.v1.RelayFrame + (*RelayOpenResult)(nil), // 191: openshell.v1.RelayOpenResult + (*RelayClose)(nil), // 192: openshell.v1.RelayClose + (*L7RequestSample)(nil), // 193: openshell.v1.L7RequestSample + (*DenialSummary)(nil), // 194: openshell.v1.DenialSummary + (*DenialGroupCount)(nil), // 195: openshell.v1.DenialGroupCount + (*NetworkActivitySummary)(nil), // 196: openshell.v1.NetworkActivitySummary + (*PolicyChunk)(nil), // 197: openshell.v1.PolicyChunk + (*DraftPolicyUpdate)(nil), // 198: openshell.v1.DraftPolicyUpdate + (*SubmitPolicyAnalysisRequest)(nil), // 199: openshell.v1.SubmitPolicyAnalysisRequest + (*SubmitPolicyAnalysisResponse)(nil), // 200: openshell.v1.SubmitPolicyAnalysisResponse + (*GetDraftPolicyRequest)(nil), // 201: openshell.v1.GetDraftPolicyRequest + (*GetDraftPolicyResponse)(nil), // 202: openshell.v1.GetDraftPolicyResponse + (*ApproveDraftChunkRequest)(nil), // 203: openshell.v1.ApproveDraftChunkRequest + (*ApproveDraftChunkResponse)(nil), // 204: openshell.v1.ApproveDraftChunkResponse + (*RejectDraftChunkRequest)(nil), // 205: openshell.v1.RejectDraftChunkRequest + (*RejectDraftChunkResponse)(nil), // 206: openshell.v1.RejectDraftChunkResponse + (*DraftChunkApproval)(nil), // 207: openshell.v1.DraftChunkApproval + (*ApproveAllDraftChunksRequest)(nil), // 208: openshell.v1.ApproveAllDraftChunksRequest + (*ApproveAllDraftChunksResponse)(nil), // 209: openshell.v1.ApproveAllDraftChunksResponse + (*EditDraftChunkRequest)(nil), // 210: openshell.v1.EditDraftChunkRequest + (*EditDraftChunkResponse)(nil), // 211: openshell.v1.EditDraftChunkResponse + (*UndoDraftChunkRequest)(nil), // 212: openshell.v1.UndoDraftChunkRequest + (*UndoDraftChunkResponse)(nil), // 213: openshell.v1.UndoDraftChunkResponse + (*ClearDraftChunksRequest)(nil), // 214: openshell.v1.ClearDraftChunksRequest + (*ClearDraftChunksResponse)(nil), // 215: openshell.v1.ClearDraftChunksResponse + (*GetDraftHistoryRequest)(nil), // 216: openshell.v1.GetDraftHistoryRequest + (*DraftHistoryEntry)(nil), // 217: openshell.v1.DraftHistoryEntry + (*GetDraftHistoryResponse)(nil), // 218: openshell.v1.GetDraftHistoryResponse + (*CreateWorkspaceRequest)(nil), // 219: openshell.v1.CreateWorkspaceRequest + (*CreateWorkspaceResponse)(nil), // 220: openshell.v1.CreateWorkspaceResponse + (*GetWorkspaceRequest)(nil), // 221: openshell.v1.GetWorkspaceRequest + (*GetWorkspaceResponse)(nil), // 222: openshell.v1.GetWorkspaceResponse + (*ListWorkspacesRequest)(nil), // 223: openshell.v1.ListWorkspacesRequest + (*ListWorkspacesResponse)(nil), // 224: openshell.v1.ListWorkspacesResponse + (*DeleteWorkspaceRequest)(nil), // 225: openshell.v1.DeleteWorkspaceRequest + (*DeleteWorkspaceResponse)(nil), // 226: openshell.v1.DeleteWorkspaceResponse + (*WorkspaceMember)(nil), // 227: openshell.v1.WorkspaceMember + (*AddWorkspaceMemberRequest)(nil), // 228: openshell.v1.AddWorkspaceMemberRequest + (*AddWorkspaceMemberResponse)(nil), // 229: openshell.v1.AddWorkspaceMemberResponse + (*RemoveWorkspaceMemberRequest)(nil), // 230: openshell.v1.RemoveWorkspaceMemberRequest + (*RemoveWorkspaceMemberResponse)(nil), // 231: openshell.v1.RemoveWorkspaceMemberResponse + (*ListWorkspaceMembersRequest)(nil), // 232: openshell.v1.ListWorkspaceMembersRequest + (*ListWorkspaceMembersResponse)(nil), // 233: openshell.v1.ListWorkspaceMembersResponse + (*ExtensionServiceCredential)(nil), // 234: openshell.v1.ExtensionServiceCredential + (*EndpointObservation)(nil), // 235: openshell.v1.EndpointObservation + (*ReportEndpointStatusRequest)(nil), // 236: openshell.v1.ReportEndpointStatusRequest + (*ReportEndpointStatusResponse)(nil), // 237: openshell.v1.ReportEndpointStatusResponse + (*EndpointStatus)(nil), // 238: openshell.v1.EndpointStatus + nil, // 239: openshell.v1.SandboxSpec.EnvironmentEntry + nil, // 240: openshell.v1.SandboxTemplate.LabelsEntry + nil, // 241: openshell.v1.SandboxTemplate.AnnotationsEntry + nil, // 242: openshell.v1.SandboxTemplate.EnvironmentEntry + nil, // 243: openshell.v1.SandboxWorkloadConfig.EnvironmentEntry + nil, // 244: openshell.v1.PlatformEvent.MetadataEntry + nil, // 245: openshell.v1.CreateSandboxRequest.LabelsEntry + nil, // 246: openshell.v1.CreateSandboxRequest.AnnotationsEntry + nil, // 247: openshell.v1.ExecSandboxRequest.EnvironmentEntry + nil, // 248: openshell.v1.SandboxLogLine.FieldsEntry + nil, // 249: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry + nil, // 250: openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry + nil, // 251: openshell.v1.ProviderProfile.AnnotationsEntry + nil, // 252: openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry + nil, // 253: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry + nil, // 254: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry + nil, // 255: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry + nil, // 256: openshell.v1.UpdateConfigRequest.AnnotationsEntry + nil, // 257: openshell.v1.UpdateConfigResponse.AnnotationsEntry + nil, // 258: openshell.v1.SandboxPolicyRevision.ProvenanceEntry + nil, // 259: openshell.v1.CreateWorkspaceRequest.LabelsEntry + (*timestamppb.Timestamp)(nil), // 260: google.protobuf.Timestamp + (*datamodelv1.ObjectMeta)(nil), // 261: openshell.datamodel.v1.ObjectMeta + (*sandboxv1.SandboxPolicy)(nil), // 262: openshell.sandbox.v1.SandboxPolicy + (*structpb.Struct)(nil), // 263: google.protobuf.Struct + (*durationpb.Duration)(nil), // 264: google.protobuf.Duration + (*datamodelv1.WorkspaceSelector)(nil), // 265: openshell.datamodel.v1.WorkspaceSelector + (*datamodelv1.Provider)(nil), // 266: openshell.datamodel.v1.Provider + (sandboxv1.PolicySource)(0), // 267: openshell.sandbox.v1.PolicySource + (*sandboxv1.NetworkEndpoint)(nil), // 268: openshell.sandbox.v1.NetworkEndpoint + (*sandboxv1.NetworkBinary)(nil), // 269: openshell.sandbox.v1.NetworkBinary + (*sandboxv1.SettingValue)(nil), // 270: openshell.sandbox.v1.SettingValue + (*sandboxv1.NetworkPolicyRule)(nil), // 271: openshell.sandbox.v1.NetworkPolicyRule + (*sandboxv1.L7DenyRule)(nil), // 272: openshell.sandbox.v1.L7DenyRule + (*sandboxv1.L7Rule)(nil), // 273: openshell.sandbox.v1.L7Rule + (*datamodelv1.Workspace)(nil), // 274: openshell.datamodel.v1.Workspace + (*sandboxv1.GetSandboxConfigRequest)(nil), // 275: openshell.sandbox.v1.GetSandboxConfigRequest + (*sandboxv1.GetGatewayConfigRequest)(nil), // 276: openshell.sandbox.v1.GetGatewayConfigRequest + (*sandboxv1.GetSandboxConfigResponse)(nil), // 277: openshell.sandbox.v1.GetSandboxConfigResponse + (*sandboxv1.GetGatewayConfigResponse)(nil), // 278: openshell.sandbox.v1.GetGatewayConfigResponse } var file_openshell_proto_depIdxs = []int32{ - 259, // 0: openshell.v1.IssueSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp - 259, // 1: openshell.v1.RefreshSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp - 233, // 2: openshell.v1.RefreshSandboxTokenResponse.extension_credentials:type_name -> openshell.v1.ExtensionServiceCredential - 259, // 3: openshell.v1.RefreshSandboxTokenResponse.sandbox_expiration_time:type_name -> google.protobuf.Timestamp + 260, // 0: openshell.v1.IssueSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp + 260, // 1: openshell.v1.RefreshSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp + 234, // 2: openshell.v1.RefreshSandboxTokenResponse.extension_credentials:type_name -> openshell.v1.ExtensionServiceCredential + 260, // 3: openshell.v1.RefreshSandboxTokenResponse.sandbox_expiration_time:type_name -> google.protobuf.Timestamp 11, // 4: openshell.v1.HealthResponse.status:type_name -> openshell.v1.ServiceStatus 11, // 5: openshell.v1.GetGatewayInfoResponse.status:type_name -> openshell.v1.ServiceStatus 26, // 6: openshell.v1.GetGatewayInfoResponse.compute_drivers:type_name -> openshell.v1.ComputeDriverInfo @@ -18434,168 +18515,168 @@ var file_openshell_proto_depIdxs = []int32{ 29, // 9: openshell.v1.ResourceCapabilities.cpu:type_name -> openshell.v1.CpuResourceCapabilities 30, // 10: openshell.v1.ResourceCapabilities.memory:type_name -> openshell.v1.MemoryResourceCapabilities 31, // 11: openshell.v1.ResourceCapabilities.gpu:type_name -> openshell.v1.GpuResourceCapabilities - 260, // 12: openshell.v1.Sandbox.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 261, // 12: openshell.v1.Sandbox.metadata:type_name -> openshell.datamodel.v1.ObjectMeta 33, // 13: openshell.v1.Sandbox.spec:type_name -> openshell.v1.SandboxSpec 44, // 14: openshell.v1.Sandbox.status:type_name -> openshell.v1.SandboxStatus 43, // 15: openshell.v1.Sandbox.created_from_workload_template:type_name -> openshell.v1.SandboxWorkloadTemplateProvenance - 238, // 16: openshell.v1.SandboxSpec.environment:type_name -> openshell.v1.SandboxSpec.EnvironmentEntry + 239, // 16: openshell.v1.SandboxSpec.environment:type_name -> openshell.v1.SandboxSpec.EnvironmentEntry 36, // 17: openshell.v1.SandboxSpec.template:type_name -> openshell.v1.SandboxTemplate - 261, // 18: openshell.v1.SandboxSpec.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 262, // 18: openshell.v1.SandboxSpec.policy:type_name -> openshell.sandbox.v1.SandboxPolicy 34, // 19: openshell.v1.SandboxSpec.resource_requirements:type_name -> openshell.v1.ResourceRequirements 35, // 20: openshell.v1.ResourceRequirements.gpu:type_name -> openshell.v1.GpuResourceRequirements - 239, // 21: openshell.v1.SandboxTemplate.labels:type_name -> openshell.v1.SandboxTemplate.LabelsEntry - 240, // 22: openshell.v1.SandboxTemplate.annotations:type_name -> openshell.v1.SandboxTemplate.AnnotationsEntry - 241, // 23: openshell.v1.SandboxTemplate.environment:type_name -> openshell.v1.SandboxTemplate.EnvironmentEntry - 262, // 24: openshell.v1.SandboxTemplate.resources:type_name -> google.protobuf.Struct - 262, // 25: openshell.v1.SandboxTemplate.driver_config:type_name -> google.protobuf.Struct - 260, // 26: openshell.v1.SandboxWorkloadTemplate.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 240, // 21: openshell.v1.SandboxTemplate.labels:type_name -> openshell.v1.SandboxTemplate.LabelsEntry + 241, // 22: openshell.v1.SandboxTemplate.annotations:type_name -> openshell.v1.SandboxTemplate.AnnotationsEntry + 242, // 23: openshell.v1.SandboxTemplate.environment:type_name -> openshell.v1.SandboxTemplate.EnvironmentEntry + 263, // 24: openshell.v1.SandboxTemplate.resources:type_name -> google.protobuf.Struct + 263, // 25: openshell.v1.SandboxTemplate.driver_config:type_name -> google.protobuf.Struct + 261, // 26: openshell.v1.SandboxWorkloadTemplate.metadata:type_name -> openshell.datamodel.v1.ObjectMeta 38, // 27: openshell.v1.SandboxWorkloadTemplate.spec:type_name -> openshell.v1.SandboxWorkloadTemplateSpec 39, // 28: openshell.v1.SandboxWorkloadTemplateSpec.workload:type_name -> openshell.v1.SandboxWorkloadConfig - 262, // 29: openshell.v1.SandboxWorkloadTemplateSpec.driver_config:type_name -> google.protobuf.Struct + 263, // 29: openshell.v1.SandboxWorkloadTemplateSpec.driver_config:type_name -> google.protobuf.Struct 41, // 30: openshell.v1.SandboxWorkloadTemplateSpec.desired_service_level:type_name -> openshell.v1.SandboxServiceLevel - 242, // 31: openshell.v1.SandboxWorkloadConfig.environment:type_name -> openshell.v1.SandboxWorkloadConfig.EnvironmentEntry + 243, // 31: openshell.v1.SandboxWorkloadConfig.environment:type_name -> openshell.v1.SandboxWorkloadConfig.EnvironmentEntry 40, // 32: openshell.v1.SandboxWorkloadConfig.resources:type_name -> openshell.v1.SandboxResources 35, // 33: openshell.v1.SandboxResources.gpu:type_name -> openshell.v1.GpuResourceRequirements 42, // 34: openshell.v1.SandboxServiceLevel.startup:type_name -> openshell.v1.SandboxStartup - 263, // 35: openshell.v1.SandboxStartup.ready_within:type_name -> google.protobuf.Duration + 264, // 35: openshell.v1.SandboxStartup.ready_within:type_name -> google.protobuf.Duration 45, // 36: openshell.v1.SandboxStatus.conditions:type_name -> openshell.v1.SandboxCondition 0, // 37: openshell.v1.SandboxStatus.phase:type_name -> openshell.v1.SandboxPhase - 237, // 38: openshell.v1.SandboxStatus.endpoint_statuses:type_name -> openshell.v1.EndpointStatus - 259, // 39: openshell.v1.SandboxCondition.transition_time:type_name -> google.protobuf.Timestamp - 259, // 40: openshell.v1.PlatformEvent.event_time:type_name -> google.protobuf.Timestamp - 243, // 41: openshell.v1.PlatformEvent.metadata:type_name -> openshell.v1.PlatformEvent.MetadataEntry + 238, // 38: openshell.v1.SandboxStatus.endpoint_statuses:type_name -> openshell.v1.EndpointStatus + 260, // 39: openshell.v1.SandboxCondition.transition_time:type_name -> google.protobuf.Timestamp + 260, // 40: openshell.v1.PlatformEvent.event_time:type_name -> google.protobuf.Timestamp + 244, // 41: openshell.v1.PlatformEvent.metadata:type_name -> openshell.v1.PlatformEvent.MetadataEntry 33, // 42: openshell.v1.CreateSandboxRequest.spec:type_name -> openshell.v1.SandboxSpec - 244, // 43: openshell.v1.CreateSandboxRequest.labels:type_name -> openshell.v1.CreateSandboxRequest.LabelsEntry - 245, // 44: openshell.v1.CreateSandboxRequest.annotations:type_name -> openshell.v1.CreateSandboxRequest.AnnotationsEntry - 264, // 45: openshell.v1.CreateSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 245, // 43: openshell.v1.CreateSandboxRequest.labels:type_name -> openshell.v1.CreateSandboxRequest.LabelsEntry + 246, // 44: openshell.v1.CreateSandboxRequest.annotations:type_name -> openshell.v1.CreateSandboxRequest.AnnotationsEntry + 265, // 45: openshell.v1.CreateSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 37, // 46: openshell.v1.CreateSandboxTemplateRequest.template:type_name -> openshell.v1.SandboxWorkloadTemplate - 264, // 47: openshell.v1.CreateSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 48: openshell.v1.GetSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 49: openshell.v1.ListSandboxTemplatesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 50: openshell.v1.DeleteSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 47: openshell.v1.CreateSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 48: openshell.v1.GetSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 49: openshell.v1.ListSandboxTemplatesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 50: openshell.v1.DeleteSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 37, // 51: openshell.v1.SandboxTemplateResponse.template:type_name -> openshell.v1.SandboxWorkloadTemplate 37, // 52: openshell.v1.ListSandboxTemplatesResponse.templates:type_name -> openshell.v1.SandboxWorkloadTemplate 14, // 53: openshell.v1.DeleteSandboxTemplateResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 264, // 54: openshell.v1.BeginRootfsTarStagingRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 259, // 55: openshell.v1.BeginRootfsTarStagingResponse.expiration_time:type_name -> google.protobuf.Timestamp - 264, // 56: openshell.v1.GetSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 57: openshell.v1.ListSandboxesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 58: openshell.v1.ListSandboxProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 59: openshell.v1.AttachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 60: openshell.v1.DetachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 61: openshell.v1.DeleteSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 62: openshell.v1.StopSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 63: openshell.v1.StartSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 54: openshell.v1.BeginRootfsTarStagingRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 260, // 55: openshell.v1.BeginRootfsTarStagingResponse.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 56: openshell.v1.GetSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 57: openshell.v1.ListSandboxesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 58: openshell.v1.ListSandboxProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 59: openshell.v1.AttachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 60: openshell.v1.DetachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 61: openshell.v1.DeleteSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 62: openshell.v1.StopSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 63: openshell.v1.StartSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 32, // 64: openshell.v1.SandboxResponse.sandbox:type_name -> openshell.v1.Sandbox 32, // 65: openshell.v1.ListSandboxesResponse.sandboxes:type_name -> openshell.v1.Sandbox - 265, // 66: openshell.v1.ListSandboxProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider + 266, // 66: openshell.v1.ListSandboxProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider 32, // 67: openshell.v1.AttachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox 74, // 68: openshell.v1.AttachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt 32, // 69: openshell.v1.DetachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox 74, // 70: openshell.v1.DetachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt 72, // 71: openshell.v1.ConfigSnapshotRevision.sandbox_config:type_name -> openshell.v1.SandboxConfigRevision 70, // 72: openshell.v1.ConfigSnapshotRevision.provider_target:type_name -> openshell.v1.ProviderDesiredIdentity - 266, // 73: openshell.v1.SandboxConfigRevision.policy_source:type_name -> openshell.sandbox.v1.PolicySource + 267, // 73: openshell.v1.SandboxConfigRevision.policy_source:type_name -> openshell.sandbox.v1.PolicySource 4, // 74: openshell.v1.ConfigUpdateOperation.component:type_name -> openshell.v1.ConfigComponent 71, // 75: openshell.v1.ConfigUpdateOperation.target_revision:type_name -> openshell.v1.ConfigSnapshotRevision 6, // 76: openshell.v1.ConfigUpdateOperation.state:type_name -> openshell.v1.ConfigUpdateOperationState 5, // 77: openshell.v1.ConfigUpdateOperation.outcome:type_name -> openshell.v1.ConfigApplyOutcome - 259, // 78: openshell.v1.ConfigUpdateOperation.created_time:type_name -> google.protobuf.Timestamp - 259, // 79: openshell.v1.ConfigUpdateOperation.updated_time:type_name -> google.protobuf.Timestamp - 259, // 80: openshell.v1.ConfigUpdateOperation.completed_time:type_name -> google.protobuf.Timestamp + 260, // 78: openshell.v1.ConfigUpdateOperation.created_time:type_name -> google.protobuf.Timestamp + 260, // 79: openshell.v1.ConfigUpdateOperation.updated_time:type_name -> google.protobuf.Timestamp + 260, // 80: openshell.v1.ConfigUpdateOperation.completed_time:type_name -> google.protobuf.Timestamp 1, // 81: openshell.v1.ProviderMutationReceipt.kind:type_name -> openshell.v1.ProviderMutationKind 70, // 82: openshell.v1.ProviderMutationReceipt.desired:type_name -> openshell.v1.ProviderDesiredIdentity - 259, // 83: openshell.v1.ProviderMutationReceipt.persisted_time:type_name -> google.protobuf.Timestamp + 260, // 83: openshell.v1.ProviderMutationReceipt.persisted_time:type_name -> google.protobuf.Timestamp 3, // 84: openshell.v1.ProviderReadinessObservation.reason:type_name -> openshell.v1.ProviderReadinessReason 74, // 85: openshell.v1.ProviderReadinessStatus.receipt:type_name -> openshell.v1.ProviderMutationReceipt 2, // 86: openshell.v1.ProviderReadinessStatus.state:type_name -> openshell.v1.ProviderReadinessState 3, // 87: openshell.v1.ProviderReadinessStatus.reason:type_name -> openshell.v1.ProviderReadinessReason 75, // 88: openshell.v1.ProviderReadinessStatus.observed:type_name -> openshell.v1.ProviderReadinessObservation - 259, // 89: openshell.v1.ProviderReadinessStatus.observed_time:type_name -> google.protobuf.Timestamp - 259, // 90: openshell.v1.ProviderReadinessStatus.evaluated_time:type_name -> google.protobuf.Timestamp + 260, // 89: openshell.v1.ProviderReadinessStatus.observed_time:type_name -> google.protobuf.Timestamp + 260, // 90: openshell.v1.ProviderReadinessStatus.evaluated_time:type_name -> google.protobuf.Timestamp 73, // 91: openshell.v1.ProviderReadinessStatus.operation:type_name -> openshell.v1.ConfigUpdateOperation - 264, // 92: openshell.v1.GetSandboxProviderStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 92: openshell.v1.GetSandboxProviderStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 76, // 93: openshell.v1.GetSandboxProviderStatusResponse.status:type_name -> openshell.v1.ProviderReadinessStatus 75, // 94: openshell.v1.ReportProviderReadinessRequest.observation:type_name -> openshell.v1.ProviderReadinessObservation - 263, // 95: openshell.v1.ReportProviderReadinessResponse.report_interval:type_name -> google.protobuf.Duration - 263, // 96: openshell.v1.ReportProviderReadinessResponse.observation_ttl:type_name -> google.protobuf.Duration + 264, // 95: openshell.v1.ReportProviderReadinessResponse.report_interval:type_name -> google.protobuf.Duration + 264, // 96: openshell.v1.ReportProviderReadinessResponse.observation_ttl:type_name -> google.protobuf.Duration 14, // 97: openshell.v1.DeleteSandboxResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 259, // 98: openshell.v1.CreateSshSessionResponse.expiration_time:type_name -> google.protobuf.Timestamp - 264, // 99: openshell.v1.ExposeServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 100: openshell.v1.GetServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 101: openshell.v1.ListServicesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 260, // 98: openshell.v1.CreateSshSessionResponse.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 99: openshell.v1.ExposeServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 100: openshell.v1.GetServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 101: openshell.v1.ListServicesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 91, // 102: openshell.v1.ListServicesResponse.services:type_name -> openshell.v1.ServiceEndpointResponse - 264, // 103: openshell.v1.DeleteServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 103: openshell.v1.DeleteServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 14, // 104: openshell.v1.DeleteServiceResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 260, // 105: openshell.v1.ServiceEndpoint.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 261, // 105: openshell.v1.ServiceEndpoint.metadata:type_name -> openshell.datamodel.v1.ObjectMeta 90, // 106: openshell.v1.ServiceEndpointResponse.endpoint:type_name -> openshell.v1.ServiceEndpoint 14, // 107: openshell.v1.RevokeSshSessionResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 246, // 108: openshell.v1.ExecSandboxRequest.environment:type_name -> openshell.v1.ExecSandboxRequest.EnvironmentEntry - 263, // 109: openshell.v1.ExecSandboxRequest.execution_timeout:type_name -> google.protobuf.Duration + 247, // 108: openshell.v1.ExecSandboxRequest.environment:type_name -> openshell.v1.ExecSandboxRequest.EnvironmentEntry + 264, // 109: openshell.v1.ExecSandboxRequest.execution_timeout:type_name -> google.protobuf.Duration 95, // 110: openshell.v1.ExecSandboxEvent.stdout:type_name -> openshell.v1.ExecSandboxStdout 96, // 111: openshell.v1.ExecSandboxEvent.stderr:type_name -> openshell.v1.ExecSandboxStderr 97, // 112: openshell.v1.ExecSandboxEvent.exit:type_name -> openshell.v1.ExecSandboxExit - 186, // 113: openshell.v1.TcpForwardInit.ssh:type_name -> openshell.v1.SshRelayTarget - 187, // 114: openshell.v1.TcpForwardInit.tcp:type_name -> openshell.v1.TcpRelayTarget + 187, // 113: openshell.v1.TcpForwardInit.ssh:type_name -> openshell.v1.SshRelayTarget + 188, // 114: openshell.v1.TcpForwardInit.tcp:type_name -> openshell.v1.TcpRelayTarget 99, // 115: openshell.v1.TcpForwardFrame.init:type_name -> openshell.v1.TcpForwardInit 94, // 116: openshell.v1.ExecSandboxInput.start:type_name -> openshell.v1.ExecSandboxRequest 102, // 117: openshell.v1.ExecSandboxInput.resize:type_name -> openshell.v1.ExecSandboxWindowResize - 260, // 118: openshell.v1.SshSession.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 259, // 119: openshell.v1.SshSession.expiration_time:type_name -> google.protobuf.Timestamp - 259, // 120: openshell.v1.WatchSandboxRequest.since_time:type_name -> google.protobuf.Timestamp + 261, // 118: openshell.v1.SshSession.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 260, // 119: openshell.v1.SshSession.expiration_time:type_name -> google.protobuf.Timestamp + 260, // 120: openshell.v1.WatchSandboxRequest.since_time:type_name -> google.protobuf.Timestamp 32, // 121: openshell.v1.SandboxStreamEvent.sandbox:type_name -> openshell.v1.Sandbox 106, // 122: openshell.v1.SandboxStreamEvent.log:type_name -> openshell.v1.SandboxLogLine 46, // 123: openshell.v1.SandboxStreamEvent.event:type_name -> openshell.v1.PlatformEvent 107, // 124: openshell.v1.SandboxStreamEvent.warning:type_name -> openshell.v1.SandboxStreamWarning - 197, // 125: openshell.v1.SandboxStreamEvent.draft_policy_update:type_name -> openshell.v1.DraftPolicyUpdate - 259, // 126: openshell.v1.SandboxLogLine.event_time:type_name -> google.protobuf.Timestamp - 247, // 127: openshell.v1.SandboxLogLine.fields:type_name -> openshell.v1.SandboxLogLine.FieldsEntry - 265, // 128: openshell.v1.CreateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider - 264, // 129: openshell.v1.CreateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 130: openshell.v1.GetProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 131: openshell.v1.ListProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 132: openshell.v1.UpdateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider - 248, // 133: openshell.v1.UpdateProviderRequest.credential_expiration_times:type_name -> openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry - 264, // 134: openshell.v1.UpdateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 135: openshell.v1.DeleteProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 136: openshell.v1.ProviderResponse.provider:type_name -> openshell.datamodel.v1.Provider + 198, // 125: openshell.v1.SandboxStreamEvent.draft_policy_update:type_name -> openshell.v1.DraftPolicyUpdate + 260, // 126: openshell.v1.SandboxLogLine.event_time:type_name -> google.protobuf.Timestamp + 248, // 127: openshell.v1.SandboxLogLine.fields:type_name -> openshell.v1.SandboxLogLine.FieldsEntry + 266, // 128: openshell.v1.CreateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider + 265, // 129: openshell.v1.CreateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 130: openshell.v1.GetProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 131: openshell.v1.ListProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 266, // 132: openshell.v1.UpdateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider + 249, // 133: openshell.v1.UpdateProviderRequest.credential_expiration_times:type_name -> openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry + 265, // 134: openshell.v1.UpdateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 135: openshell.v1.DeleteProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 266, // 136: openshell.v1.ProviderResponse.provider:type_name -> openshell.datamodel.v1.Provider 74, // 137: openshell.v1.ProviderResponse.target_receipts:type_name -> openshell.v1.ProviderMutationReceipt - 265, // 138: openshell.v1.ListProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider + 266, // 138: openshell.v1.ListProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider 136, // 139: openshell.v1.ProviderProfileImportItem.profile:type_name -> openshell.v1.ProviderProfile - 263, // 140: openshell.v1.ProviderCredentialTokenGrant.cache_ttl:type_name -> google.protobuf.Duration + 264, // 140: openshell.v1.ProviderCredentialTokenGrant.cache_ttl:type_name -> google.protobuf.Duration 119, // 141: openshell.v1.ProviderCredentialTokenGrant.audience_overrides:type_name -> openshell.v1.ProviderCredentialTokenGrantAudienceOverride 7, // 142: openshell.v1.ProviderCredentialTokenGrant.grant_type:type_name -> openshell.v1.ProviderCredentialTokenGrantType 120, // 143: openshell.v1.ProviderCredentialTokenGrant.subject_token:type_name -> openshell.v1.ProviderCredentialTokenGrantSubjectToken 125, // 144: openshell.v1.ProviderProfileCredential.refresh:type_name -> openshell.v1.ProviderCredentialRefresh 121, // 145: openshell.v1.ProviderProfileCredential.token_grant:type_name -> openshell.v1.ProviderCredentialTokenGrant 8, // 146: openshell.v1.ProviderCredentialRefresh.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 263, // 147: openshell.v1.ProviderCredentialRefresh.refresh_before:type_name -> google.protobuf.Duration - 263, // 148: openshell.v1.ProviderCredentialRefresh.max_lifetime:type_name -> google.protobuf.Duration + 264, // 147: openshell.v1.ProviderCredentialRefresh.refresh_before:type_name -> google.protobuf.Duration + 264, // 148: openshell.v1.ProviderCredentialRefresh.max_lifetime:type_name -> google.protobuf.Duration 123, // 149: openshell.v1.ProviderCredentialRefresh.material:type_name -> openshell.v1.ProviderCredentialRefreshMaterial 124, // 150: openshell.v1.ProviderCredentialRefresh.additional_outputs:type_name -> openshell.v1.ProviderCredentialRefreshOutput 8, // 151: openshell.v1.ProviderCredentialRefreshStatus.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 259, // 152: openshell.v1.ProviderCredentialRefreshStatus.expiration_time:type_name -> google.protobuf.Timestamp - 259, // 153: openshell.v1.ProviderCredentialRefreshStatus.next_refresh_time:type_name -> google.protobuf.Timestamp - 259, // 154: openshell.v1.ProviderCredentialRefreshStatus.last_refresh_time:type_name -> google.protobuf.Timestamp + 260, // 152: openshell.v1.ProviderCredentialRefreshStatus.expiration_time:type_name -> google.protobuf.Timestamp + 260, // 153: openshell.v1.ProviderCredentialRefreshStatus.next_refresh_time:type_name -> google.protobuf.Timestamp + 260, // 154: openshell.v1.ProviderCredentialRefreshStatus.last_refresh_time:type_name -> google.protobuf.Timestamp 13, // 155: openshell.v1.ProviderCredentialRefreshStatus.recovery_action:type_name -> openshell.v1.ProviderCredentialRefreshRecoveryAction - 259, // 156: openshell.v1.ProviderCredentialRefreshStatus.last_error_time:type_name -> google.protobuf.Timestamp - 264, // 157: openshell.v1.GetProviderRefreshStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 260, // 156: openshell.v1.ProviderCredentialRefreshStatus.last_error_time:type_name -> google.protobuf.Timestamp + 265, // 157: openshell.v1.GetProviderRefreshStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 126, // 158: openshell.v1.GetProviderRefreshStatusResponse.credentials:type_name -> openshell.v1.ProviderCredentialRefreshStatus 8, // 159: openshell.v1.ConfigureProviderRefreshRequest.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 249, // 160: openshell.v1.ConfigureProviderRefreshRequest.material:type_name -> openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry - 259, // 161: openshell.v1.ConfigureProviderRefreshRequest.expiration_time:type_name -> google.protobuf.Timestamp - 264, // 162: openshell.v1.ConfigureProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 250, // 160: openshell.v1.ConfigureProviderRefreshRequest.material:type_name -> openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry + 260, // 161: openshell.v1.ConfigureProviderRefreshRequest.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 162: openshell.v1.ConfigureProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 126, // 163: openshell.v1.ConfigureProviderRefreshResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus - 264, // 164: openshell.v1.RotateProviderCredentialRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 164: openshell.v1.RotateProviderCredentialRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 126, // 165: openshell.v1.RotateProviderCredentialResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus - 264, // 166: openshell.v1.DeleteProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 166: openshell.v1.DeleteProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 14, // 167: openshell.v1.DeleteProviderRefreshResponse.outcome:type_name -> openshell.v1.DeletionOutcome 9, // 168: openshell.v1.ProviderProfile.category:type_name -> openshell.v1.ProviderProfileCategory 122, // 169: openshell.v1.ProviderProfile.credentials:type_name -> openshell.v1.ProviderProfileCredential - 267, // 170: openshell.v1.ProviderProfile.endpoints:type_name -> openshell.sandbox.v1.NetworkEndpoint - 268, // 171: openshell.v1.ProviderProfile.binaries:type_name -> openshell.sandbox.v1.NetworkBinary + 268, // 170: openshell.v1.ProviderProfile.endpoints:type_name -> openshell.sandbox.v1.NetworkEndpoint + 269, // 171: openshell.v1.ProviderProfile.binaries:type_name -> openshell.sandbox.v1.NetworkBinary 127, // 172: openshell.v1.ProviderProfile.discovery:type_name -> openshell.v1.ProviderProfileDiscovery - 250, // 173: openshell.v1.ProviderProfile.annotations:type_name -> openshell.v1.ProviderProfile.AnnotationsEntry + 251, // 173: openshell.v1.ProviderProfile.annotations:type_name -> openshell.v1.ProviderProfile.AnnotationsEntry 136, // 174: openshell.v1.ProviderProfileResponse.profile:type_name -> openshell.v1.ProviderProfile 136, // 175: openshell.v1.ListProviderProfilesResponse.profiles:type_name -> openshell.v1.ProviderProfile 117, // 176: openshell.v1.ImportProviderProfilesRequest.profiles:type_name -> openshell.v1.ProviderProfileImportItem @@ -18609,261 +18690,264 @@ var file_openshell_proto_depIdxs = []int32{ 14, // 184: openshell.v1.DeleteProviderResponse.outcome:type_name -> openshell.v1.DeletionOutcome 14, // 185: openshell.v1.DeleteProviderProfileResponse.outcome:type_name -> openshell.v1.DeletionOutcome 149, // 186: openshell.v1.StaticCredentialBinding.endpoints:type_name -> openshell.v1.StaticCredentialEndpointBinding - 251, // 187: openshell.v1.GetSandboxProviderEnvironmentResponse.environment:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry - 252, // 188: openshell.v1.GetSandboxProviderEnvironmentResponse.credential_expiration_times:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry - 253, // 189: openshell.v1.GetSandboxProviderEnvironmentResponse.dynamic_credentials:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry - 254, // 190: openshell.v1.GetSandboxProviderEnvironmentResponse.static_credential_bindings:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry + 252, // 187: openshell.v1.GetSandboxProviderEnvironmentResponse.environment:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry + 253, // 188: openshell.v1.GetSandboxProviderEnvironmentResponse.credential_expiration_times:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry + 254, // 189: openshell.v1.GetSandboxProviderEnvironmentResponse.dynamic_credentials:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry + 255, // 190: openshell.v1.GetSandboxProviderEnvironmentResponse.static_credential_bindings:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry 3, // 191: openshell.v1.GetSandboxProviderEnvironmentResponse.readiness_reason:type_name -> openshell.v1.ProviderReadinessReason - 263, // 192: openshell.v1.ExchangeProviderSubjectTokenResponse.expires_after:type_name -> google.protobuf.Duration - 261, // 193: openshell.v1.UpdateConfigRequest.policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 269, // 194: openshell.v1.UpdateConfigRequest.setting_value:type_name -> openshell.sandbox.v1.SettingValue + 264, // 192: openshell.v1.ExchangeProviderSubjectTokenResponse.expires_after:type_name -> google.protobuf.Duration + 262, // 193: openshell.v1.UpdateConfigRequest.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 270, // 194: openshell.v1.UpdateConfigRequest.setting_value:type_name -> openshell.sandbox.v1.SettingValue 155, // 195: openshell.v1.UpdateConfigRequest.merge_operations:type_name -> openshell.v1.PolicyMergeOperation - 255, // 196: openshell.v1.UpdateConfigRequest.annotations:type_name -> openshell.v1.UpdateConfigRequest.AnnotationsEntry - 264, // 197: openshell.v1.UpdateConfigRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 256, // 196: openshell.v1.UpdateConfigRequest.annotations:type_name -> openshell.v1.UpdateConfigRequest.AnnotationsEntry + 265, // 197: openshell.v1.UpdateConfigRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector 156, // 198: openshell.v1.PolicyMergeOperation.add_rule:type_name -> openshell.v1.AddNetworkRule 157, // 199: openshell.v1.PolicyMergeOperation.remove_endpoint:type_name -> openshell.v1.RemoveNetworkEndpoint 158, // 200: openshell.v1.PolicyMergeOperation.remove_rule:type_name -> openshell.v1.RemoveNetworkRule - 159, // 201: openshell.v1.PolicyMergeOperation.add_deny_rules:type_name -> openshell.v1.AddDenyRules - 160, // 202: openshell.v1.PolicyMergeOperation.add_allow_rules:type_name -> openshell.v1.AddAllowRules - 161, // 203: openshell.v1.PolicyMergeOperation.remove_binary:type_name -> openshell.v1.RemoveNetworkBinary - 270, // 204: openshell.v1.AddNetworkRule.rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 271, // 205: openshell.v1.AddDenyRules.deny_rules:type_name -> openshell.sandbox.v1.L7DenyRule - 272, // 206: openshell.v1.AddAllowRules.rules:type_name -> openshell.sandbox.v1.L7Rule - 256, // 207: openshell.v1.UpdateConfigResponse.annotations:type_name -> openshell.v1.UpdateConfigResponse.AnnotationsEntry - 264, // 208: openshell.v1.GetSandboxPolicyStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 169, // 209: openshell.v1.GetSandboxPolicyStatusResponse.revision:type_name -> openshell.v1.SandboxPolicyRevision - 264, // 210: openshell.v1.ListSandboxPoliciesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 169, // 211: openshell.v1.ListSandboxPoliciesResponse.revisions:type_name -> openshell.v1.SandboxPolicyRevision - 10, // 212: openshell.v1.ReportPolicyStatusRequest.status:type_name -> openshell.v1.PolicyStatus - 10, // 213: openshell.v1.SandboxPolicyRevision.status:type_name -> openshell.v1.PolicyStatus - 259, // 214: openshell.v1.SandboxPolicyRevision.created_time:type_name -> google.protobuf.Timestamp - 259, // 215: openshell.v1.SandboxPolicyRevision.loaded_time:type_name -> google.protobuf.Timestamp - 261, // 216: openshell.v1.SandboxPolicyRevision.policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 257, // 217: openshell.v1.SandboxPolicyRevision.provenance:type_name -> openshell.v1.SandboxPolicyRevision.ProvenanceEntry - 259, // 218: openshell.v1.GetSandboxLogsRequest.since_time:type_name -> google.protobuf.Timestamp - 264, // 219: openshell.v1.GetSandboxLogsRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 106, // 220: openshell.v1.PushSandboxLogsRequest.logs:type_name -> openshell.v1.SandboxLogLine - 106, // 221: openshell.v1.GetSandboxLogsResponse.logs:type_name -> openshell.v1.SandboxLogLine - 176, // 222: openshell.v1.SupervisorMessage.hello:type_name -> openshell.v1.SupervisorHello - 179, // 223: openshell.v1.SupervisorMessage.heartbeat:type_name -> openshell.v1.SupervisorHeartbeat - 190, // 224: openshell.v1.SupervisorMessage.relay_open_result:type_name -> openshell.v1.RelayOpenResult - 191, // 225: openshell.v1.SupervisorMessage.relay_close:type_name -> openshell.v1.RelayClose - 177, // 226: openshell.v1.GatewayMessage.session_accepted:type_name -> openshell.v1.SessionAccepted - 178, // 227: openshell.v1.GatewayMessage.session_rejected:type_name -> openshell.v1.SessionRejected - 180, // 228: openshell.v1.GatewayMessage.heartbeat:type_name -> openshell.v1.GatewayHeartbeat - 185, // 229: openshell.v1.GatewayMessage.relay_open:type_name -> openshell.v1.RelayOpen - 191, // 230: openshell.v1.GatewayMessage.relay_close:type_name -> openshell.v1.RelayClose - 263, // 231: openshell.v1.SessionAccepted.heartbeat_interval:type_name -> google.protobuf.Duration - 186, // 232: openshell.v1.RelayOpen.ssh:type_name -> openshell.v1.SshRelayTarget - 187, // 233: openshell.v1.RelayOpen.tcp:type_name -> openshell.v1.TcpRelayTarget - 188, // 234: openshell.v1.RelayFrame.init:type_name -> openshell.v1.RelayInit - 259, // 235: openshell.v1.DenialSummary.first_seen_time:type_name -> google.protobuf.Timestamp - 259, // 236: openshell.v1.DenialSummary.last_seen_time:type_name -> google.protobuf.Timestamp - 192, // 237: openshell.v1.DenialSummary.l7_request_samples:type_name -> openshell.v1.L7RequestSample - 194, // 238: openshell.v1.NetworkActivitySummary.denials_by_group:type_name -> openshell.v1.DenialGroupCount - 270, // 239: openshell.v1.PolicyChunk.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 259, // 240: openshell.v1.PolicyChunk.created_time:type_name -> google.protobuf.Timestamp - 259, // 241: openshell.v1.PolicyChunk.decided_time:type_name -> google.protobuf.Timestamp - 259, // 242: openshell.v1.PolicyChunk.first_seen_time:type_name -> google.protobuf.Timestamp - 259, // 243: openshell.v1.PolicyChunk.last_seen_time:type_name -> google.protobuf.Timestamp - 261, // 244: openshell.v1.PolicyChunk.current_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 261, // 245: openshell.v1.PolicyChunk.candidate_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 193, // 246: openshell.v1.SubmitPolicyAnalysisRequest.summaries:type_name -> openshell.v1.DenialSummary - 196, // 247: openshell.v1.SubmitPolicyAnalysisRequest.proposed_chunks:type_name -> openshell.v1.PolicyChunk - 195, // 248: openshell.v1.SubmitPolicyAnalysisRequest.network_activity_summaries:type_name -> openshell.v1.NetworkActivitySummary - 264, // 249: openshell.v1.GetDraftPolicyRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 196, // 250: openshell.v1.GetDraftPolicyResponse.chunks:type_name -> openshell.v1.PolicyChunk - 259, // 251: openshell.v1.GetDraftPolicyResponse.last_analyzed_time:type_name -> google.protobuf.Timestamp - 264, // 252: openshell.v1.ApproveDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 253: openshell.v1.RejectDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 206, // 254: openshell.v1.ApproveAllDraftChunksRequest.approvals:type_name -> openshell.v1.DraftChunkApproval - 264, // 255: openshell.v1.ApproveAllDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 270, // 256: openshell.v1.EditDraftChunkRequest.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 264, // 257: openshell.v1.EditDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 258: openshell.v1.UndoDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 259: openshell.v1.ClearDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 264, // 260: openshell.v1.GetDraftHistoryRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 259, // 261: openshell.v1.DraftHistoryEntry.event_time:type_name -> google.protobuf.Timestamp - 216, // 262: openshell.v1.GetDraftHistoryResponse.entries:type_name -> openshell.v1.DraftHistoryEntry - 258, // 263: openshell.v1.CreateWorkspaceRequest.labels:type_name -> openshell.v1.CreateWorkspaceRequest.LabelsEntry - 273, // 264: openshell.v1.CreateWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace - 273, // 265: openshell.v1.GetWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace - 273, // 266: openshell.v1.ListWorkspacesResponse.workspaces:type_name -> openshell.datamodel.v1.Workspace - 14, // 267: openshell.v1.DeleteWorkspaceResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 260, // 268: openshell.v1.WorkspaceMember.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 12, // 269: openshell.v1.WorkspaceMember.role:type_name -> openshell.v1.WorkspaceRole - 12, // 270: openshell.v1.AddWorkspaceMemberRequest.role:type_name -> openshell.v1.WorkspaceRole - 226, // 271: openshell.v1.AddWorkspaceMemberResponse.member:type_name -> openshell.v1.WorkspaceMember - 14, // 272: openshell.v1.RemoveWorkspaceMemberResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 226, // 273: openshell.v1.ListWorkspaceMembersResponse.members:type_name -> openshell.v1.WorkspaceMember - 259, // 274: openshell.v1.ExtensionServiceCredential.expiration_time:type_name -> google.protobuf.Timestamp - 15, // 275: openshell.v1.EndpointObservation.result:type_name -> openshell.v1.EndpointResult - 234, // 276: openshell.v1.ReportEndpointStatusRequest.observations:type_name -> openshell.v1.EndpointObservation - 15, // 277: openshell.v1.EndpointStatus.last_result:type_name -> openshell.v1.EndpointResult - 259, // 278: openshell.v1.EndpointStatus.last_reported_time:type_name -> google.protobuf.Timestamp - 259, // 279: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp - 259, // 280: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp - 122, // 281: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry.value:type_name -> openshell.v1.ProviderProfileCredential - 150, // 282: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry.value:type_name -> openshell.v1.StaticCredentialBinding - 20, // 283: openshell.v1.OpenShell.Health:input_type -> openshell.v1.HealthRequest - 22, // 284: openshell.v1.OpenShell.GetCurrentUser:input_type -> openshell.v1.GetCurrentUserRequest - 24, // 285: openshell.v1.OpenShell.GetGatewayInfo:input_type -> openshell.v1.GetGatewayInfoRequest - 47, // 286: openshell.v1.OpenShell.CreateSandbox:input_type -> openshell.v1.CreateSandboxRequest - 55, // 287: openshell.v1.OpenShell.BeginRootfsTarStaging:input_type -> openshell.v1.BeginRootfsTarStagingRequest - 57, // 288: openshell.v1.OpenShell.GetSandbox:input_type -> openshell.v1.GetSandboxRequest - 58, // 289: openshell.v1.OpenShell.ListSandboxes:input_type -> openshell.v1.ListSandboxesRequest - 48, // 290: openshell.v1.OpenShell.CreateSandboxTemplate:input_type -> openshell.v1.CreateSandboxTemplateRequest - 49, // 291: openshell.v1.OpenShell.GetSandboxTemplate:input_type -> openshell.v1.GetSandboxTemplateRequest - 50, // 292: openshell.v1.OpenShell.ListSandboxTemplates:input_type -> openshell.v1.ListSandboxTemplatesRequest - 51, // 293: openshell.v1.OpenShell.DeleteSandboxTemplate:input_type -> openshell.v1.DeleteSandboxTemplateRequest - 59, // 294: openshell.v1.OpenShell.ListSandboxProviders:input_type -> openshell.v1.ListSandboxProvidersRequest - 60, // 295: openshell.v1.OpenShell.AttachSandboxProvider:input_type -> openshell.v1.AttachSandboxProviderRequest - 61, // 296: openshell.v1.OpenShell.DetachSandboxProvider:input_type -> openshell.v1.DetachSandboxProviderRequest - 77, // 297: openshell.v1.OpenShell.GetSandboxProviderStatus:input_type -> openshell.v1.GetSandboxProviderStatusRequest - 62, // 298: openshell.v1.OpenShell.DeleteSandbox:input_type -> openshell.v1.DeleteSandboxRequest - 63, // 299: openshell.v1.OpenShell.StopSandbox:input_type -> openshell.v1.StopSandboxRequest - 64, // 300: openshell.v1.OpenShell.StartSandbox:input_type -> openshell.v1.StartSandboxRequest - 82, // 301: openshell.v1.OpenShell.CreateSshSession:input_type -> openshell.v1.CreateSshSessionRequest - 84, // 302: openshell.v1.OpenShell.ExposeService:input_type -> openshell.v1.ExposeServiceRequest - 85, // 303: openshell.v1.OpenShell.GetService:input_type -> openshell.v1.GetServiceRequest - 86, // 304: openshell.v1.OpenShell.ListServices:input_type -> openshell.v1.ListServicesRequest - 88, // 305: openshell.v1.OpenShell.DeleteService:input_type -> openshell.v1.DeleteServiceRequest - 92, // 306: openshell.v1.OpenShell.RevokeSshSession:input_type -> openshell.v1.RevokeSshSessionRequest - 94, // 307: openshell.v1.OpenShell.ExecSandbox:input_type -> openshell.v1.ExecSandboxRequest - 100, // 308: openshell.v1.OpenShell.ForwardTcp:input_type -> openshell.v1.TcpForwardFrame - 101, // 309: openshell.v1.OpenShell.ExecSandboxInteractive:input_type -> openshell.v1.ExecSandboxInput - 108, // 310: openshell.v1.OpenShell.CreateProvider:input_type -> openshell.v1.CreateProviderRequest - 109, // 311: openshell.v1.OpenShell.GetProvider:input_type -> openshell.v1.GetProviderRequest - 110, // 312: openshell.v1.OpenShell.ListProviders:input_type -> openshell.v1.ListProvidersRequest - 115, // 313: openshell.v1.OpenShell.ListProviderProfiles:input_type -> openshell.v1.ListProviderProfilesRequest - 116, // 314: openshell.v1.OpenShell.GetProviderProfile:input_type -> openshell.v1.GetProviderProfileRequest - 139, // 315: openshell.v1.OpenShell.ImportProviderProfiles:input_type -> openshell.v1.ImportProviderProfilesRequest - 141, // 316: openshell.v1.OpenShell.UpdateProviderProfiles:input_type -> openshell.v1.UpdateProviderProfilesRequest - 143, // 317: openshell.v1.OpenShell.LintProviderProfiles:input_type -> openshell.v1.LintProviderProfilesRequest - 111, // 318: openshell.v1.OpenShell.UpdateProvider:input_type -> openshell.v1.UpdateProviderRequest - 128, // 319: openshell.v1.OpenShell.GetProviderRefreshStatus:input_type -> openshell.v1.GetProviderRefreshStatusRequest - 130, // 320: openshell.v1.OpenShell.ConfigureProviderRefresh:input_type -> openshell.v1.ConfigureProviderRefreshRequest - 132, // 321: openshell.v1.OpenShell.RotateProviderCredential:input_type -> openshell.v1.RotateProviderCredentialRequest - 134, // 322: openshell.v1.OpenShell.DeleteProviderRefresh:input_type -> openshell.v1.DeleteProviderRefreshRequest - 112, // 323: openshell.v1.OpenShell.DeleteProvider:input_type -> openshell.v1.DeleteProviderRequest - 146, // 324: openshell.v1.OpenShell.DeleteProviderProfile:input_type -> openshell.v1.DeleteProviderProfileRequest - 274, // 325: openshell.v1.OpenShell.GetSandboxConfig:input_type -> openshell.sandbox.v1.GetSandboxConfigRequest - 275, // 326: openshell.v1.OpenShell.GetGatewayConfig:input_type -> openshell.sandbox.v1.GetGatewayConfigRequest - 154, // 327: openshell.v1.OpenShell.UpdateConfig:input_type -> openshell.v1.UpdateConfigRequest - 163, // 328: openshell.v1.OpenShell.GetSandboxPolicyStatus:input_type -> openshell.v1.GetSandboxPolicyStatusRequest - 165, // 329: openshell.v1.OpenShell.ListSandboxPolicies:input_type -> openshell.v1.ListSandboxPoliciesRequest - 167, // 330: openshell.v1.OpenShell.ReportPolicyStatus:input_type -> openshell.v1.ReportPolicyStatusRequest - 235, // 331: openshell.v1.OpenShell.ReportEndpointStatus:input_type -> openshell.v1.ReportEndpointStatusRequest - 79, // 332: openshell.v1.OpenShell.ReportProviderReadiness:input_type -> openshell.v1.ReportProviderReadinessRequest - 148, // 333: openshell.v1.OpenShell.GetSandboxProviderEnvironment:input_type -> openshell.v1.GetSandboxProviderEnvironmentRequest - 152, // 334: openshell.v1.OpenShell.ExchangeProviderSubjectToken:input_type -> openshell.v1.ExchangeProviderSubjectTokenRequest - 170, // 335: openshell.v1.OpenShell.GetSandboxLogs:input_type -> openshell.v1.GetSandboxLogsRequest - 171, // 336: openshell.v1.OpenShell.PushSandboxLogs:input_type -> openshell.v1.PushSandboxLogsRequest - 174, // 337: openshell.v1.OpenShell.ConnectSupervisor:input_type -> openshell.v1.SupervisorMessage - 181, // 338: openshell.v1.OpenShell.ReportMainProcessExit:input_type -> openshell.v1.ReportMainProcessExitRequest - 183, // 339: openshell.v1.OpenShell.FinalizeMainProcessExit:input_type -> openshell.v1.FinalizeMainProcessExitRequest - 189, // 340: openshell.v1.OpenShell.RelayStream:input_type -> openshell.v1.RelayFrame - 104, // 341: openshell.v1.OpenShell.WatchSandbox:input_type -> openshell.v1.WatchSandboxRequest - 198, // 342: openshell.v1.OpenShell.SubmitPolicyAnalysis:input_type -> openshell.v1.SubmitPolicyAnalysisRequest - 200, // 343: openshell.v1.OpenShell.GetDraftPolicy:input_type -> openshell.v1.GetDraftPolicyRequest - 202, // 344: openshell.v1.OpenShell.ApproveDraftChunk:input_type -> openshell.v1.ApproveDraftChunkRequest - 204, // 345: openshell.v1.OpenShell.RejectDraftChunk:input_type -> openshell.v1.RejectDraftChunkRequest - 207, // 346: openshell.v1.OpenShell.ApproveAllDraftChunks:input_type -> openshell.v1.ApproveAllDraftChunksRequest - 209, // 347: openshell.v1.OpenShell.EditDraftChunk:input_type -> openshell.v1.EditDraftChunkRequest - 211, // 348: openshell.v1.OpenShell.UndoDraftChunk:input_type -> openshell.v1.UndoDraftChunkRequest - 213, // 349: openshell.v1.OpenShell.ClearDraftChunks:input_type -> openshell.v1.ClearDraftChunksRequest - 215, // 350: openshell.v1.OpenShell.GetDraftHistory:input_type -> openshell.v1.GetDraftHistoryRequest - 16, // 351: openshell.v1.OpenShell.IssueSandboxToken:input_type -> openshell.v1.IssueSandboxTokenRequest - 18, // 352: openshell.v1.OpenShell.RefreshSandboxToken:input_type -> openshell.v1.RefreshSandboxTokenRequest - 218, // 353: openshell.v1.OpenShell.CreateWorkspace:input_type -> openshell.v1.CreateWorkspaceRequest - 220, // 354: openshell.v1.OpenShell.GetWorkspace:input_type -> openshell.v1.GetWorkspaceRequest - 222, // 355: openshell.v1.OpenShell.ListWorkspaces:input_type -> openshell.v1.ListWorkspacesRequest - 224, // 356: openshell.v1.OpenShell.DeleteWorkspace:input_type -> openshell.v1.DeleteWorkspaceRequest - 227, // 357: openshell.v1.OpenShell.AddWorkspaceMember:input_type -> openshell.v1.AddWorkspaceMemberRequest - 229, // 358: openshell.v1.OpenShell.RemoveWorkspaceMember:input_type -> openshell.v1.RemoveWorkspaceMemberRequest - 231, // 359: openshell.v1.OpenShell.ListWorkspaceMembers:input_type -> openshell.v1.ListWorkspaceMembersRequest - 21, // 360: openshell.v1.OpenShell.Health:output_type -> openshell.v1.HealthResponse - 23, // 361: openshell.v1.OpenShell.GetCurrentUser:output_type -> openshell.v1.GetCurrentUserResponse - 25, // 362: openshell.v1.OpenShell.GetGatewayInfo:output_type -> openshell.v1.GetGatewayInfoResponse - 65, // 363: openshell.v1.OpenShell.CreateSandbox:output_type -> openshell.v1.SandboxResponse - 56, // 364: openshell.v1.OpenShell.BeginRootfsTarStaging:output_type -> openshell.v1.BeginRootfsTarStagingResponse - 65, // 365: openshell.v1.OpenShell.GetSandbox:output_type -> openshell.v1.SandboxResponse - 66, // 366: openshell.v1.OpenShell.ListSandboxes:output_type -> openshell.v1.ListSandboxesResponse - 52, // 367: openshell.v1.OpenShell.CreateSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse - 52, // 368: openshell.v1.OpenShell.GetSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse - 53, // 369: openshell.v1.OpenShell.ListSandboxTemplates:output_type -> openshell.v1.ListSandboxTemplatesResponse - 54, // 370: openshell.v1.OpenShell.DeleteSandboxTemplate:output_type -> openshell.v1.DeleteSandboxTemplateResponse - 67, // 371: openshell.v1.OpenShell.ListSandboxProviders:output_type -> openshell.v1.ListSandboxProvidersResponse - 68, // 372: openshell.v1.OpenShell.AttachSandboxProvider:output_type -> openshell.v1.AttachSandboxProviderResponse - 69, // 373: openshell.v1.OpenShell.DetachSandboxProvider:output_type -> openshell.v1.DetachSandboxProviderResponse - 78, // 374: openshell.v1.OpenShell.GetSandboxProviderStatus:output_type -> openshell.v1.GetSandboxProviderStatusResponse - 81, // 375: openshell.v1.OpenShell.DeleteSandbox:output_type -> openshell.v1.DeleteSandboxResponse - 65, // 376: openshell.v1.OpenShell.StopSandbox:output_type -> openshell.v1.SandboxResponse - 65, // 377: openshell.v1.OpenShell.StartSandbox:output_type -> openshell.v1.SandboxResponse - 83, // 378: openshell.v1.OpenShell.CreateSshSession:output_type -> openshell.v1.CreateSshSessionResponse - 91, // 379: openshell.v1.OpenShell.ExposeService:output_type -> openshell.v1.ServiceEndpointResponse - 91, // 380: openshell.v1.OpenShell.GetService:output_type -> openshell.v1.ServiceEndpointResponse - 87, // 381: openshell.v1.OpenShell.ListServices:output_type -> openshell.v1.ListServicesResponse - 89, // 382: openshell.v1.OpenShell.DeleteService:output_type -> openshell.v1.DeleteServiceResponse - 93, // 383: openshell.v1.OpenShell.RevokeSshSession:output_type -> openshell.v1.RevokeSshSessionResponse - 98, // 384: openshell.v1.OpenShell.ExecSandbox:output_type -> openshell.v1.ExecSandboxEvent - 100, // 385: openshell.v1.OpenShell.ForwardTcp:output_type -> openshell.v1.TcpForwardFrame - 98, // 386: openshell.v1.OpenShell.ExecSandboxInteractive:output_type -> openshell.v1.ExecSandboxEvent - 113, // 387: openshell.v1.OpenShell.CreateProvider:output_type -> openshell.v1.ProviderResponse - 113, // 388: openshell.v1.OpenShell.GetProvider:output_type -> openshell.v1.ProviderResponse - 114, // 389: openshell.v1.OpenShell.ListProviders:output_type -> openshell.v1.ListProvidersResponse - 138, // 390: openshell.v1.OpenShell.ListProviderProfiles:output_type -> openshell.v1.ListProviderProfilesResponse - 137, // 391: openshell.v1.OpenShell.GetProviderProfile:output_type -> openshell.v1.ProviderProfileResponse - 140, // 392: openshell.v1.OpenShell.ImportProviderProfiles:output_type -> openshell.v1.ImportProviderProfilesResponse - 142, // 393: openshell.v1.OpenShell.UpdateProviderProfiles:output_type -> openshell.v1.UpdateProviderProfilesResponse - 144, // 394: openshell.v1.OpenShell.LintProviderProfiles:output_type -> openshell.v1.LintProviderProfilesResponse - 113, // 395: openshell.v1.OpenShell.UpdateProvider:output_type -> openshell.v1.ProviderResponse - 129, // 396: openshell.v1.OpenShell.GetProviderRefreshStatus:output_type -> openshell.v1.GetProviderRefreshStatusResponse - 131, // 397: openshell.v1.OpenShell.ConfigureProviderRefresh:output_type -> openshell.v1.ConfigureProviderRefreshResponse - 133, // 398: openshell.v1.OpenShell.RotateProviderCredential:output_type -> openshell.v1.RotateProviderCredentialResponse - 135, // 399: openshell.v1.OpenShell.DeleteProviderRefresh:output_type -> openshell.v1.DeleteProviderRefreshResponse - 145, // 400: openshell.v1.OpenShell.DeleteProvider:output_type -> openshell.v1.DeleteProviderResponse - 147, // 401: openshell.v1.OpenShell.DeleteProviderProfile:output_type -> openshell.v1.DeleteProviderProfileResponse - 276, // 402: openshell.v1.OpenShell.GetSandboxConfig:output_type -> openshell.sandbox.v1.GetSandboxConfigResponse - 277, // 403: openshell.v1.OpenShell.GetGatewayConfig:output_type -> openshell.sandbox.v1.GetGatewayConfigResponse - 162, // 404: openshell.v1.OpenShell.UpdateConfig:output_type -> openshell.v1.UpdateConfigResponse - 164, // 405: openshell.v1.OpenShell.GetSandboxPolicyStatus:output_type -> openshell.v1.GetSandboxPolicyStatusResponse - 166, // 406: openshell.v1.OpenShell.ListSandboxPolicies:output_type -> openshell.v1.ListSandboxPoliciesResponse - 168, // 407: openshell.v1.OpenShell.ReportPolicyStatus:output_type -> openshell.v1.ReportPolicyStatusResponse - 236, // 408: openshell.v1.OpenShell.ReportEndpointStatus:output_type -> openshell.v1.ReportEndpointStatusResponse - 80, // 409: openshell.v1.OpenShell.ReportProviderReadiness:output_type -> openshell.v1.ReportProviderReadinessResponse - 151, // 410: openshell.v1.OpenShell.GetSandboxProviderEnvironment:output_type -> openshell.v1.GetSandboxProviderEnvironmentResponse - 153, // 411: openshell.v1.OpenShell.ExchangeProviderSubjectToken:output_type -> openshell.v1.ExchangeProviderSubjectTokenResponse - 173, // 412: openshell.v1.OpenShell.GetSandboxLogs:output_type -> openshell.v1.GetSandboxLogsResponse - 172, // 413: openshell.v1.OpenShell.PushSandboxLogs:output_type -> openshell.v1.PushSandboxLogsResponse - 175, // 414: openshell.v1.OpenShell.ConnectSupervisor:output_type -> openshell.v1.GatewayMessage - 182, // 415: openshell.v1.OpenShell.ReportMainProcessExit:output_type -> openshell.v1.ReportMainProcessExitResponse - 184, // 416: openshell.v1.OpenShell.FinalizeMainProcessExit:output_type -> openshell.v1.FinalizeMainProcessExitResponse - 189, // 417: openshell.v1.OpenShell.RelayStream:output_type -> openshell.v1.RelayFrame - 105, // 418: openshell.v1.OpenShell.WatchSandbox:output_type -> openshell.v1.SandboxStreamEvent - 199, // 419: openshell.v1.OpenShell.SubmitPolicyAnalysis:output_type -> openshell.v1.SubmitPolicyAnalysisResponse - 201, // 420: openshell.v1.OpenShell.GetDraftPolicy:output_type -> openshell.v1.GetDraftPolicyResponse - 203, // 421: openshell.v1.OpenShell.ApproveDraftChunk:output_type -> openshell.v1.ApproveDraftChunkResponse - 205, // 422: openshell.v1.OpenShell.RejectDraftChunk:output_type -> openshell.v1.RejectDraftChunkResponse - 208, // 423: openshell.v1.OpenShell.ApproveAllDraftChunks:output_type -> openshell.v1.ApproveAllDraftChunksResponse - 210, // 424: openshell.v1.OpenShell.EditDraftChunk:output_type -> openshell.v1.EditDraftChunkResponse - 212, // 425: openshell.v1.OpenShell.UndoDraftChunk:output_type -> openshell.v1.UndoDraftChunkResponse - 214, // 426: openshell.v1.OpenShell.ClearDraftChunks:output_type -> openshell.v1.ClearDraftChunksResponse - 217, // 427: openshell.v1.OpenShell.GetDraftHistory:output_type -> openshell.v1.GetDraftHistoryResponse - 17, // 428: openshell.v1.OpenShell.IssueSandboxToken:output_type -> openshell.v1.IssueSandboxTokenResponse - 19, // 429: openshell.v1.OpenShell.RefreshSandboxToken:output_type -> openshell.v1.RefreshSandboxTokenResponse - 219, // 430: openshell.v1.OpenShell.CreateWorkspace:output_type -> openshell.v1.CreateWorkspaceResponse - 221, // 431: openshell.v1.OpenShell.GetWorkspace:output_type -> openshell.v1.GetWorkspaceResponse - 223, // 432: openshell.v1.OpenShell.ListWorkspaces:output_type -> openshell.v1.ListWorkspacesResponse - 225, // 433: openshell.v1.OpenShell.DeleteWorkspace:output_type -> openshell.v1.DeleteWorkspaceResponse - 228, // 434: openshell.v1.OpenShell.AddWorkspaceMember:output_type -> openshell.v1.AddWorkspaceMemberResponse - 230, // 435: openshell.v1.OpenShell.RemoveWorkspaceMember:output_type -> openshell.v1.RemoveWorkspaceMemberResponse - 232, // 436: openshell.v1.OpenShell.ListWorkspaceMembers:output_type -> openshell.v1.ListWorkspaceMembersResponse - 360, // [360:437] is the sub-list for method output_type - 283, // [283:360] is the sub-list for method input_type - 283, // [283:283] is the sub-list for extension type_name - 283, // [283:283] is the sub-list for extension extendee - 0, // [0:283] is the sub-list for field type_name + 160, // 201: openshell.v1.PolicyMergeOperation.add_deny_rules:type_name -> openshell.v1.AddDenyRules + 161, // 202: openshell.v1.PolicyMergeOperation.add_allow_rules:type_name -> openshell.v1.AddAllowRules + 162, // 203: openshell.v1.PolicyMergeOperation.remove_binary:type_name -> openshell.v1.RemoveNetworkBinary + 271, // 204: openshell.v1.AddNetworkRule.rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 269, // 205: openshell.v1.L7RuleTarget.binaries:type_name -> openshell.sandbox.v1.NetworkBinary + 272, // 206: openshell.v1.AddDenyRules.deny_rules:type_name -> openshell.sandbox.v1.L7DenyRule + 159, // 207: openshell.v1.AddDenyRules.target:type_name -> openshell.v1.L7RuleTarget + 273, // 208: openshell.v1.AddAllowRules.rules:type_name -> openshell.sandbox.v1.L7Rule + 159, // 209: openshell.v1.AddAllowRules.target:type_name -> openshell.v1.L7RuleTarget + 257, // 210: openshell.v1.UpdateConfigResponse.annotations:type_name -> openshell.v1.UpdateConfigResponse.AnnotationsEntry + 265, // 211: openshell.v1.GetSandboxPolicyStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 170, // 212: openshell.v1.GetSandboxPolicyStatusResponse.revision:type_name -> openshell.v1.SandboxPolicyRevision + 265, // 213: openshell.v1.ListSandboxPoliciesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 170, // 214: openshell.v1.ListSandboxPoliciesResponse.revisions:type_name -> openshell.v1.SandboxPolicyRevision + 10, // 215: openshell.v1.ReportPolicyStatusRequest.status:type_name -> openshell.v1.PolicyStatus + 10, // 216: openshell.v1.SandboxPolicyRevision.status:type_name -> openshell.v1.PolicyStatus + 260, // 217: openshell.v1.SandboxPolicyRevision.created_time:type_name -> google.protobuf.Timestamp + 260, // 218: openshell.v1.SandboxPolicyRevision.loaded_time:type_name -> google.protobuf.Timestamp + 262, // 219: openshell.v1.SandboxPolicyRevision.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 258, // 220: openshell.v1.SandboxPolicyRevision.provenance:type_name -> openshell.v1.SandboxPolicyRevision.ProvenanceEntry + 260, // 221: openshell.v1.GetSandboxLogsRequest.since_time:type_name -> google.protobuf.Timestamp + 265, // 222: openshell.v1.GetSandboxLogsRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 106, // 223: openshell.v1.PushSandboxLogsRequest.logs:type_name -> openshell.v1.SandboxLogLine + 106, // 224: openshell.v1.GetSandboxLogsResponse.logs:type_name -> openshell.v1.SandboxLogLine + 177, // 225: openshell.v1.SupervisorMessage.hello:type_name -> openshell.v1.SupervisorHello + 180, // 226: openshell.v1.SupervisorMessage.heartbeat:type_name -> openshell.v1.SupervisorHeartbeat + 191, // 227: openshell.v1.SupervisorMessage.relay_open_result:type_name -> openshell.v1.RelayOpenResult + 192, // 228: openshell.v1.SupervisorMessage.relay_close:type_name -> openshell.v1.RelayClose + 178, // 229: openshell.v1.GatewayMessage.session_accepted:type_name -> openshell.v1.SessionAccepted + 179, // 230: openshell.v1.GatewayMessage.session_rejected:type_name -> openshell.v1.SessionRejected + 181, // 231: openshell.v1.GatewayMessage.heartbeat:type_name -> openshell.v1.GatewayHeartbeat + 186, // 232: openshell.v1.GatewayMessage.relay_open:type_name -> openshell.v1.RelayOpen + 192, // 233: openshell.v1.GatewayMessage.relay_close:type_name -> openshell.v1.RelayClose + 264, // 234: openshell.v1.SessionAccepted.heartbeat_interval:type_name -> google.protobuf.Duration + 187, // 235: openshell.v1.RelayOpen.ssh:type_name -> openshell.v1.SshRelayTarget + 188, // 236: openshell.v1.RelayOpen.tcp:type_name -> openshell.v1.TcpRelayTarget + 189, // 237: openshell.v1.RelayFrame.init:type_name -> openshell.v1.RelayInit + 260, // 238: openshell.v1.DenialSummary.first_seen_time:type_name -> google.protobuf.Timestamp + 260, // 239: openshell.v1.DenialSummary.last_seen_time:type_name -> google.protobuf.Timestamp + 193, // 240: openshell.v1.DenialSummary.l7_request_samples:type_name -> openshell.v1.L7RequestSample + 195, // 241: openshell.v1.NetworkActivitySummary.denials_by_group:type_name -> openshell.v1.DenialGroupCount + 271, // 242: openshell.v1.PolicyChunk.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 260, // 243: openshell.v1.PolicyChunk.created_time:type_name -> google.protobuf.Timestamp + 260, // 244: openshell.v1.PolicyChunk.decided_time:type_name -> google.protobuf.Timestamp + 260, // 245: openshell.v1.PolicyChunk.first_seen_time:type_name -> google.protobuf.Timestamp + 260, // 246: openshell.v1.PolicyChunk.last_seen_time:type_name -> google.protobuf.Timestamp + 262, // 247: openshell.v1.PolicyChunk.current_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 262, // 248: openshell.v1.PolicyChunk.candidate_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 194, // 249: openshell.v1.SubmitPolicyAnalysisRequest.summaries:type_name -> openshell.v1.DenialSummary + 197, // 250: openshell.v1.SubmitPolicyAnalysisRequest.proposed_chunks:type_name -> openshell.v1.PolicyChunk + 196, // 251: openshell.v1.SubmitPolicyAnalysisRequest.network_activity_summaries:type_name -> openshell.v1.NetworkActivitySummary + 265, // 252: openshell.v1.GetDraftPolicyRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 197, // 253: openshell.v1.GetDraftPolicyResponse.chunks:type_name -> openshell.v1.PolicyChunk + 260, // 254: openshell.v1.GetDraftPolicyResponse.last_analyzed_time:type_name -> google.protobuf.Timestamp + 265, // 255: openshell.v1.ApproveDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 256: openshell.v1.RejectDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 207, // 257: openshell.v1.ApproveAllDraftChunksRequest.approvals:type_name -> openshell.v1.DraftChunkApproval + 265, // 258: openshell.v1.ApproveAllDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 271, // 259: openshell.v1.EditDraftChunkRequest.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 265, // 260: openshell.v1.EditDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 261: openshell.v1.UndoDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 262: openshell.v1.ClearDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 263: openshell.v1.GetDraftHistoryRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 260, // 264: openshell.v1.DraftHistoryEntry.event_time:type_name -> google.protobuf.Timestamp + 217, // 265: openshell.v1.GetDraftHistoryResponse.entries:type_name -> openshell.v1.DraftHistoryEntry + 259, // 266: openshell.v1.CreateWorkspaceRequest.labels:type_name -> openshell.v1.CreateWorkspaceRequest.LabelsEntry + 274, // 267: openshell.v1.CreateWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace + 274, // 268: openshell.v1.GetWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace + 274, // 269: openshell.v1.ListWorkspacesResponse.workspaces:type_name -> openshell.datamodel.v1.Workspace + 14, // 270: openshell.v1.DeleteWorkspaceResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 261, // 271: openshell.v1.WorkspaceMember.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 12, // 272: openshell.v1.WorkspaceMember.role:type_name -> openshell.v1.WorkspaceRole + 12, // 273: openshell.v1.AddWorkspaceMemberRequest.role:type_name -> openshell.v1.WorkspaceRole + 227, // 274: openshell.v1.AddWorkspaceMemberResponse.member:type_name -> openshell.v1.WorkspaceMember + 14, // 275: openshell.v1.RemoveWorkspaceMemberResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 227, // 276: openshell.v1.ListWorkspaceMembersResponse.members:type_name -> openshell.v1.WorkspaceMember + 260, // 277: openshell.v1.ExtensionServiceCredential.expiration_time:type_name -> google.protobuf.Timestamp + 15, // 278: openshell.v1.EndpointObservation.result:type_name -> openshell.v1.EndpointResult + 235, // 279: openshell.v1.ReportEndpointStatusRequest.observations:type_name -> openshell.v1.EndpointObservation + 15, // 280: openshell.v1.EndpointStatus.last_result:type_name -> openshell.v1.EndpointResult + 260, // 281: openshell.v1.EndpointStatus.last_reported_time:type_name -> google.protobuf.Timestamp + 260, // 282: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp + 260, // 283: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp + 122, // 284: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry.value:type_name -> openshell.v1.ProviderProfileCredential + 150, // 285: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry.value:type_name -> openshell.v1.StaticCredentialBinding + 20, // 286: openshell.v1.OpenShell.Health:input_type -> openshell.v1.HealthRequest + 22, // 287: openshell.v1.OpenShell.GetCurrentUser:input_type -> openshell.v1.GetCurrentUserRequest + 24, // 288: openshell.v1.OpenShell.GetGatewayInfo:input_type -> openshell.v1.GetGatewayInfoRequest + 47, // 289: openshell.v1.OpenShell.CreateSandbox:input_type -> openshell.v1.CreateSandboxRequest + 55, // 290: openshell.v1.OpenShell.BeginRootfsTarStaging:input_type -> openshell.v1.BeginRootfsTarStagingRequest + 57, // 291: openshell.v1.OpenShell.GetSandbox:input_type -> openshell.v1.GetSandboxRequest + 58, // 292: openshell.v1.OpenShell.ListSandboxes:input_type -> openshell.v1.ListSandboxesRequest + 48, // 293: openshell.v1.OpenShell.CreateSandboxTemplate:input_type -> openshell.v1.CreateSandboxTemplateRequest + 49, // 294: openshell.v1.OpenShell.GetSandboxTemplate:input_type -> openshell.v1.GetSandboxTemplateRequest + 50, // 295: openshell.v1.OpenShell.ListSandboxTemplates:input_type -> openshell.v1.ListSandboxTemplatesRequest + 51, // 296: openshell.v1.OpenShell.DeleteSandboxTemplate:input_type -> openshell.v1.DeleteSandboxTemplateRequest + 59, // 297: openshell.v1.OpenShell.ListSandboxProviders:input_type -> openshell.v1.ListSandboxProvidersRequest + 60, // 298: openshell.v1.OpenShell.AttachSandboxProvider:input_type -> openshell.v1.AttachSandboxProviderRequest + 61, // 299: openshell.v1.OpenShell.DetachSandboxProvider:input_type -> openshell.v1.DetachSandboxProviderRequest + 77, // 300: openshell.v1.OpenShell.GetSandboxProviderStatus:input_type -> openshell.v1.GetSandboxProviderStatusRequest + 62, // 301: openshell.v1.OpenShell.DeleteSandbox:input_type -> openshell.v1.DeleteSandboxRequest + 63, // 302: openshell.v1.OpenShell.StopSandbox:input_type -> openshell.v1.StopSandboxRequest + 64, // 303: openshell.v1.OpenShell.StartSandbox:input_type -> openshell.v1.StartSandboxRequest + 82, // 304: openshell.v1.OpenShell.CreateSshSession:input_type -> openshell.v1.CreateSshSessionRequest + 84, // 305: openshell.v1.OpenShell.ExposeService:input_type -> openshell.v1.ExposeServiceRequest + 85, // 306: openshell.v1.OpenShell.GetService:input_type -> openshell.v1.GetServiceRequest + 86, // 307: openshell.v1.OpenShell.ListServices:input_type -> openshell.v1.ListServicesRequest + 88, // 308: openshell.v1.OpenShell.DeleteService:input_type -> openshell.v1.DeleteServiceRequest + 92, // 309: openshell.v1.OpenShell.RevokeSshSession:input_type -> openshell.v1.RevokeSshSessionRequest + 94, // 310: openshell.v1.OpenShell.ExecSandbox:input_type -> openshell.v1.ExecSandboxRequest + 100, // 311: openshell.v1.OpenShell.ForwardTcp:input_type -> openshell.v1.TcpForwardFrame + 101, // 312: openshell.v1.OpenShell.ExecSandboxInteractive:input_type -> openshell.v1.ExecSandboxInput + 108, // 313: openshell.v1.OpenShell.CreateProvider:input_type -> openshell.v1.CreateProviderRequest + 109, // 314: openshell.v1.OpenShell.GetProvider:input_type -> openshell.v1.GetProviderRequest + 110, // 315: openshell.v1.OpenShell.ListProviders:input_type -> openshell.v1.ListProvidersRequest + 115, // 316: openshell.v1.OpenShell.ListProviderProfiles:input_type -> openshell.v1.ListProviderProfilesRequest + 116, // 317: openshell.v1.OpenShell.GetProviderProfile:input_type -> openshell.v1.GetProviderProfileRequest + 139, // 318: openshell.v1.OpenShell.ImportProviderProfiles:input_type -> openshell.v1.ImportProviderProfilesRequest + 141, // 319: openshell.v1.OpenShell.UpdateProviderProfiles:input_type -> openshell.v1.UpdateProviderProfilesRequest + 143, // 320: openshell.v1.OpenShell.LintProviderProfiles:input_type -> openshell.v1.LintProviderProfilesRequest + 111, // 321: openshell.v1.OpenShell.UpdateProvider:input_type -> openshell.v1.UpdateProviderRequest + 128, // 322: openshell.v1.OpenShell.GetProviderRefreshStatus:input_type -> openshell.v1.GetProviderRefreshStatusRequest + 130, // 323: openshell.v1.OpenShell.ConfigureProviderRefresh:input_type -> openshell.v1.ConfigureProviderRefreshRequest + 132, // 324: openshell.v1.OpenShell.RotateProviderCredential:input_type -> openshell.v1.RotateProviderCredentialRequest + 134, // 325: openshell.v1.OpenShell.DeleteProviderRefresh:input_type -> openshell.v1.DeleteProviderRefreshRequest + 112, // 326: openshell.v1.OpenShell.DeleteProvider:input_type -> openshell.v1.DeleteProviderRequest + 146, // 327: openshell.v1.OpenShell.DeleteProviderProfile:input_type -> openshell.v1.DeleteProviderProfileRequest + 275, // 328: openshell.v1.OpenShell.GetSandboxConfig:input_type -> openshell.sandbox.v1.GetSandboxConfigRequest + 276, // 329: openshell.v1.OpenShell.GetGatewayConfig:input_type -> openshell.sandbox.v1.GetGatewayConfigRequest + 154, // 330: openshell.v1.OpenShell.UpdateConfig:input_type -> openshell.v1.UpdateConfigRequest + 164, // 331: openshell.v1.OpenShell.GetSandboxPolicyStatus:input_type -> openshell.v1.GetSandboxPolicyStatusRequest + 166, // 332: openshell.v1.OpenShell.ListSandboxPolicies:input_type -> openshell.v1.ListSandboxPoliciesRequest + 168, // 333: openshell.v1.OpenShell.ReportPolicyStatus:input_type -> openshell.v1.ReportPolicyStatusRequest + 236, // 334: openshell.v1.OpenShell.ReportEndpointStatus:input_type -> openshell.v1.ReportEndpointStatusRequest + 79, // 335: openshell.v1.OpenShell.ReportProviderReadiness:input_type -> openshell.v1.ReportProviderReadinessRequest + 148, // 336: openshell.v1.OpenShell.GetSandboxProviderEnvironment:input_type -> openshell.v1.GetSandboxProviderEnvironmentRequest + 152, // 337: openshell.v1.OpenShell.ExchangeProviderSubjectToken:input_type -> openshell.v1.ExchangeProviderSubjectTokenRequest + 171, // 338: openshell.v1.OpenShell.GetSandboxLogs:input_type -> openshell.v1.GetSandboxLogsRequest + 172, // 339: openshell.v1.OpenShell.PushSandboxLogs:input_type -> openshell.v1.PushSandboxLogsRequest + 175, // 340: openshell.v1.OpenShell.ConnectSupervisor:input_type -> openshell.v1.SupervisorMessage + 182, // 341: openshell.v1.OpenShell.ReportMainProcessExit:input_type -> openshell.v1.ReportMainProcessExitRequest + 184, // 342: openshell.v1.OpenShell.FinalizeMainProcessExit:input_type -> openshell.v1.FinalizeMainProcessExitRequest + 190, // 343: openshell.v1.OpenShell.RelayStream:input_type -> openshell.v1.RelayFrame + 104, // 344: openshell.v1.OpenShell.WatchSandbox:input_type -> openshell.v1.WatchSandboxRequest + 199, // 345: openshell.v1.OpenShell.SubmitPolicyAnalysis:input_type -> openshell.v1.SubmitPolicyAnalysisRequest + 201, // 346: openshell.v1.OpenShell.GetDraftPolicy:input_type -> openshell.v1.GetDraftPolicyRequest + 203, // 347: openshell.v1.OpenShell.ApproveDraftChunk:input_type -> openshell.v1.ApproveDraftChunkRequest + 205, // 348: openshell.v1.OpenShell.RejectDraftChunk:input_type -> openshell.v1.RejectDraftChunkRequest + 208, // 349: openshell.v1.OpenShell.ApproveAllDraftChunks:input_type -> openshell.v1.ApproveAllDraftChunksRequest + 210, // 350: openshell.v1.OpenShell.EditDraftChunk:input_type -> openshell.v1.EditDraftChunkRequest + 212, // 351: openshell.v1.OpenShell.UndoDraftChunk:input_type -> openshell.v1.UndoDraftChunkRequest + 214, // 352: openshell.v1.OpenShell.ClearDraftChunks:input_type -> openshell.v1.ClearDraftChunksRequest + 216, // 353: openshell.v1.OpenShell.GetDraftHistory:input_type -> openshell.v1.GetDraftHistoryRequest + 16, // 354: openshell.v1.OpenShell.IssueSandboxToken:input_type -> openshell.v1.IssueSandboxTokenRequest + 18, // 355: openshell.v1.OpenShell.RefreshSandboxToken:input_type -> openshell.v1.RefreshSandboxTokenRequest + 219, // 356: openshell.v1.OpenShell.CreateWorkspace:input_type -> openshell.v1.CreateWorkspaceRequest + 221, // 357: openshell.v1.OpenShell.GetWorkspace:input_type -> openshell.v1.GetWorkspaceRequest + 223, // 358: openshell.v1.OpenShell.ListWorkspaces:input_type -> openshell.v1.ListWorkspacesRequest + 225, // 359: openshell.v1.OpenShell.DeleteWorkspace:input_type -> openshell.v1.DeleteWorkspaceRequest + 228, // 360: openshell.v1.OpenShell.AddWorkspaceMember:input_type -> openshell.v1.AddWorkspaceMemberRequest + 230, // 361: openshell.v1.OpenShell.RemoveWorkspaceMember:input_type -> openshell.v1.RemoveWorkspaceMemberRequest + 232, // 362: openshell.v1.OpenShell.ListWorkspaceMembers:input_type -> openshell.v1.ListWorkspaceMembersRequest + 21, // 363: openshell.v1.OpenShell.Health:output_type -> openshell.v1.HealthResponse + 23, // 364: openshell.v1.OpenShell.GetCurrentUser:output_type -> openshell.v1.GetCurrentUserResponse + 25, // 365: openshell.v1.OpenShell.GetGatewayInfo:output_type -> openshell.v1.GetGatewayInfoResponse + 65, // 366: openshell.v1.OpenShell.CreateSandbox:output_type -> openshell.v1.SandboxResponse + 56, // 367: openshell.v1.OpenShell.BeginRootfsTarStaging:output_type -> openshell.v1.BeginRootfsTarStagingResponse + 65, // 368: openshell.v1.OpenShell.GetSandbox:output_type -> openshell.v1.SandboxResponse + 66, // 369: openshell.v1.OpenShell.ListSandboxes:output_type -> openshell.v1.ListSandboxesResponse + 52, // 370: openshell.v1.OpenShell.CreateSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse + 52, // 371: openshell.v1.OpenShell.GetSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse + 53, // 372: openshell.v1.OpenShell.ListSandboxTemplates:output_type -> openshell.v1.ListSandboxTemplatesResponse + 54, // 373: openshell.v1.OpenShell.DeleteSandboxTemplate:output_type -> openshell.v1.DeleteSandboxTemplateResponse + 67, // 374: openshell.v1.OpenShell.ListSandboxProviders:output_type -> openshell.v1.ListSandboxProvidersResponse + 68, // 375: openshell.v1.OpenShell.AttachSandboxProvider:output_type -> openshell.v1.AttachSandboxProviderResponse + 69, // 376: openshell.v1.OpenShell.DetachSandboxProvider:output_type -> openshell.v1.DetachSandboxProviderResponse + 78, // 377: openshell.v1.OpenShell.GetSandboxProviderStatus:output_type -> openshell.v1.GetSandboxProviderStatusResponse + 81, // 378: openshell.v1.OpenShell.DeleteSandbox:output_type -> openshell.v1.DeleteSandboxResponse + 65, // 379: openshell.v1.OpenShell.StopSandbox:output_type -> openshell.v1.SandboxResponse + 65, // 380: openshell.v1.OpenShell.StartSandbox:output_type -> openshell.v1.SandboxResponse + 83, // 381: openshell.v1.OpenShell.CreateSshSession:output_type -> openshell.v1.CreateSshSessionResponse + 91, // 382: openshell.v1.OpenShell.ExposeService:output_type -> openshell.v1.ServiceEndpointResponse + 91, // 383: openshell.v1.OpenShell.GetService:output_type -> openshell.v1.ServiceEndpointResponse + 87, // 384: openshell.v1.OpenShell.ListServices:output_type -> openshell.v1.ListServicesResponse + 89, // 385: openshell.v1.OpenShell.DeleteService:output_type -> openshell.v1.DeleteServiceResponse + 93, // 386: openshell.v1.OpenShell.RevokeSshSession:output_type -> openshell.v1.RevokeSshSessionResponse + 98, // 387: openshell.v1.OpenShell.ExecSandbox:output_type -> openshell.v1.ExecSandboxEvent + 100, // 388: openshell.v1.OpenShell.ForwardTcp:output_type -> openshell.v1.TcpForwardFrame + 98, // 389: openshell.v1.OpenShell.ExecSandboxInteractive:output_type -> openshell.v1.ExecSandboxEvent + 113, // 390: openshell.v1.OpenShell.CreateProvider:output_type -> openshell.v1.ProviderResponse + 113, // 391: openshell.v1.OpenShell.GetProvider:output_type -> openshell.v1.ProviderResponse + 114, // 392: openshell.v1.OpenShell.ListProviders:output_type -> openshell.v1.ListProvidersResponse + 138, // 393: openshell.v1.OpenShell.ListProviderProfiles:output_type -> openshell.v1.ListProviderProfilesResponse + 137, // 394: openshell.v1.OpenShell.GetProviderProfile:output_type -> openshell.v1.ProviderProfileResponse + 140, // 395: openshell.v1.OpenShell.ImportProviderProfiles:output_type -> openshell.v1.ImportProviderProfilesResponse + 142, // 396: openshell.v1.OpenShell.UpdateProviderProfiles:output_type -> openshell.v1.UpdateProviderProfilesResponse + 144, // 397: openshell.v1.OpenShell.LintProviderProfiles:output_type -> openshell.v1.LintProviderProfilesResponse + 113, // 398: openshell.v1.OpenShell.UpdateProvider:output_type -> openshell.v1.ProviderResponse + 129, // 399: openshell.v1.OpenShell.GetProviderRefreshStatus:output_type -> openshell.v1.GetProviderRefreshStatusResponse + 131, // 400: openshell.v1.OpenShell.ConfigureProviderRefresh:output_type -> openshell.v1.ConfigureProviderRefreshResponse + 133, // 401: openshell.v1.OpenShell.RotateProviderCredential:output_type -> openshell.v1.RotateProviderCredentialResponse + 135, // 402: openshell.v1.OpenShell.DeleteProviderRefresh:output_type -> openshell.v1.DeleteProviderRefreshResponse + 145, // 403: openshell.v1.OpenShell.DeleteProvider:output_type -> openshell.v1.DeleteProviderResponse + 147, // 404: openshell.v1.OpenShell.DeleteProviderProfile:output_type -> openshell.v1.DeleteProviderProfileResponse + 277, // 405: openshell.v1.OpenShell.GetSandboxConfig:output_type -> openshell.sandbox.v1.GetSandboxConfigResponse + 278, // 406: openshell.v1.OpenShell.GetGatewayConfig:output_type -> openshell.sandbox.v1.GetGatewayConfigResponse + 163, // 407: openshell.v1.OpenShell.UpdateConfig:output_type -> openshell.v1.UpdateConfigResponse + 165, // 408: openshell.v1.OpenShell.GetSandboxPolicyStatus:output_type -> openshell.v1.GetSandboxPolicyStatusResponse + 167, // 409: openshell.v1.OpenShell.ListSandboxPolicies:output_type -> openshell.v1.ListSandboxPoliciesResponse + 169, // 410: openshell.v1.OpenShell.ReportPolicyStatus:output_type -> openshell.v1.ReportPolicyStatusResponse + 237, // 411: openshell.v1.OpenShell.ReportEndpointStatus:output_type -> openshell.v1.ReportEndpointStatusResponse + 80, // 412: openshell.v1.OpenShell.ReportProviderReadiness:output_type -> openshell.v1.ReportProviderReadinessResponse + 151, // 413: openshell.v1.OpenShell.GetSandboxProviderEnvironment:output_type -> openshell.v1.GetSandboxProviderEnvironmentResponse + 153, // 414: openshell.v1.OpenShell.ExchangeProviderSubjectToken:output_type -> openshell.v1.ExchangeProviderSubjectTokenResponse + 174, // 415: openshell.v1.OpenShell.GetSandboxLogs:output_type -> openshell.v1.GetSandboxLogsResponse + 173, // 416: openshell.v1.OpenShell.PushSandboxLogs:output_type -> openshell.v1.PushSandboxLogsResponse + 176, // 417: openshell.v1.OpenShell.ConnectSupervisor:output_type -> openshell.v1.GatewayMessage + 183, // 418: openshell.v1.OpenShell.ReportMainProcessExit:output_type -> openshell.v1.ReportMainProcessExitResponse + 185, // 419: openshell.v1.OpenShell.FinalizeMainProcessExit:output_type -> openshell.v1.FinalizeMainProcessExitResponse + 190, // 420: openshell.v1.OpenShell.RelayStream:output_type -> openshell.v1.RelayFrame + 105, // 421: openshell.v1.OpenShell.WatchSandbox:output_type -> openshell.v1.SandboxStreamEvent + 200, // 422: openshell.v1.OpenShell.SubmitPolicyAnalysis:output_type -> openshell.v1.SubmitPolicyAnalysisResponse + 202, // 423: openshell.v1.OpenShell.GetDraftPolicy:output_type -> openshell.v1.GetDraftPolicyResponse + 204, // 424: openshell.v1.OpenShell.ApproveDraftChunk:output_type -> openshell.v1.ApproveDraftChunkResponse + 206, // 425: openshell.v1.OpenShell.RejectDraftChunk:output_type -> openshell.v1.RejectDraftChunkResponse + 209, // 426: openshell.v1.OpenShell.ApproveAllDraftChunks:output_type -> openshell.v1.ApproveAllDraftChunksResponse + 211, // 427: openshell.v1.OpenShell.EditDraftChunk:output_type -> openshell.v1.EditDraftChunkResponse + 213, // 428: openshell.v1.OpenShell.UndoDraftChunk:output_type -> openshell.v1.UndoDraftChunkResponse + 215, // 429: openshell.v1.OpenShell.ClearDraftChunks:output_type -> openshell.v1.ClearDraftChunksResponse + 218, // 430: openshell.v1.OpenShell.GetDraftHistory:output_type -> openshell.v1.GetDraftHistoryResponse + 17, // 431: openshell.v1.OpenShell.IssueSandboxToken:output_type -> openshell.v1.IssueSandboxTokenResponse + 19, // 432: openshell.v1.OpenShell.RefreshSandboxToken:output_type -> openshell.v1.RefreshSandboxTokenResponse + 220, // 433: openshell.v1.OpenShell.CreateWorkspace:output_type -> openshell.v1.CreateWorkspaceResponse + 222, // 434: openshell.v1.OpenShell.GetWorkspace:output_type -> openshell.v1.GetWorkspaceResponse + 224, // 435: openshell.v1.OpenShell.ListWorkspaces:output_type -> openshell.v1.ListWorkspacesResponse + 226, // 436: openshell.v1.OpenShell.DeleteWorkspace:output_type -> openshell.v1.DeleteWorkspaceResponse + 229, // 437: openshell.v1.OpenShell.AddWorkspaceMember:output_type -> openshell.v1.AddWorkspaceMemberResponse + 231, // 438: openshell.v1.OpenShell.RemoveWorkspaceMember:output_type -> openshell.v1.RemoveWorkspaceMemberResponse + 233, // 439: openshell.v1.OpenShell.ListWorkspaceMembers:output_type -> openshell.v1.ListWorkspaceMembersResponse + 363, // [363:440] is the sub-list for method output_type + 286, // [286:363] is the sub-list for method input_type + 286, // [286:286] is the sub-list for extension type_name + 286, // [286:286] is the sub-list for extension extendee + 0, // [0:286] is the sub-list for field type_name } func init() { file_openshell_proto_init() } @@ -18912,24 +18996,25 @@ func file_openshell_proto_init() { (*PolicyMergeOperation_AddAllowRules)(nil), (*PolicyMergeOperation_RemoveBinary)(nil), } - file_openshell_proto_msgTypes[158].OneofWrappers = []any{ + file_openshell_proto_msgTypes[143].OneofWrappers = []any{} + file_openshell_proto_msgTypes[159].OneofWrappers = []any{ (*SupervisorMessage_Hello)(nil), (*SupervisorMessage_Heartbeat)(nil), (*SupervisorMessage_RelayOpenResult)(nil), (*SupervisorMessage_RelayClose)(nil), } - file_openshell_proto_msgTypes[159].OneofWrappers = []any{ + file_openshell_proto_msgTypes[160].OneofWrappers = []any{ (*GatewayMessage_SessionAccepted)(nil), (*GatewayMessage_SessionRejected)(nil), (*GatewayMessage_Heartbeat)(nil), (*GatewayMessage_RelayOpen)(nil), (*GatewayMessage_RelayClose)(nil), } - file_openshell_proto_msgTypes[169].OneofWrappers = []any{ + file_openshell_proto_msgTypes[170].OneofWrappers = []any{ (*RelayOpen_Ssh)(nil), (*RelayOpen_Tcp)(nil), } - file_openshell_proto_msgTypes[173].OneofWrappers = []any{ + file_openshell_proto_msgTypes[174].OneofWrappers = []any{ (*RelayFrame_Init)(nil), (*RelayFrame_Data)(nil), } @@ -18939,7 +19024,7 @@ func file_openshell_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_openshell_proto_rawDesc), len(file_openshell_proto_rawDesc)), NumEnums: 16, - NumMessages: 243, + NumMessages: 244, NumExtensions: 0, NumServices: 1, }, diff --git a/sdk/typescript/src/client.test.ts b/sdk/typescript/src/client.test.ts index efdd6aabcc..45b90ea215 100644 --- a/sdk/typescript/src/client.test.ts +++ b/sdk/typescript/src/client.test.ts @@ -1613,6 +1613,62 @@ describe('enum name maps', () => { }); describe('raw escape hatch', () => { + it('preserves explicit L7 target scope and optional endpoint path on the wire', async () => { + const observed: MessageInitShape[] = []; + const sandbox = client({ + updateConfig: (req) => { + observed.push(req); + return { version: 2, policyHash: 'updated' }; + }, + }); + await sandbox.raw.updateConfig({ + name: 'sb', + mergeOperations: [ + { + operation: { + case: 'addAllowRules', + value: { + target: { + ruleName: 'internal_api', + host: 'api.example.com', + ports: [443, 8443], + path: '', + binaries: [{ path: '/usr/bin/curl' }, { path: '/usr/bin/python3' }], + }, + rules: [{ allow: { method: 'POST', path: '/admin' } }], + }, + }, + }, + { + operation: { + case: 'addDenyRules', + value: { + target: { ruleName: 'public_api', host: 'api.example.com', ports: [443], anyBinary: true }, + denyRules: [{ method: 'POST', path: '/admin/private' }], + }, + }, + }, + ], + }); + const operations = observed[0]?.mergeOperations; + const allow = operations?.[0]?.operation; + const deny = operations?.[1]?.operation; + expect(allow?.case).toBe('addAllowRules'); + expect(deny?.case).toBe('addDenyRules'); + if (allow?.case !== 'addAllowRules' || deny?.case !== 'addDenyRules') throw new Error('wrong operations'); + expect(allow.value.target).toMatchObject({ + ruleName: 'internal_api', + host: 'api.example.com', + ports: [443, 8443], + path: '', + binaries: [{ path: '/usr/bin/curl' }, { path: '/usr/bin/python3' }], + anyBinary: false, + }); + expect(deny.value.target?.anyBinary).toBe(true); + expect(deny.value.target?.binaries).toEqual([]); + expect(deny.value.target?.path).toBeUndefined(); + }); + it('reaches uncurated RPCs and returns generated wire messages', async () => { const sandbox = client({ getSandbox: () => readySandbox('sb', 'sb-id-1'), diff --git a/skills/openshell-cli/SKILL.md b/skills/openshell-cli/SKILL.md index f449903d2b..db5bba2015 100644 --- a/skills/openshell-cli/SKILL.md +++ b/skills/openshell-cli/SKILL.md @@ -691,7 +691,7 @@ When denied actions appear: 1. Prefer incremental updates for additive network changes: `openshell policy update work-session --add-endpoint api.github.com:443:read-only:rest:enforce --binary /usr/bin/gh --wait` - `openshell policy update work-session --add-allow 'api.github.com:443:POST:/repos/*/issues' --wait` + `openshell policy update work-session --rule-name allow_api_github_com_443 --binary /usr/bin/gh --add-allow 'api.github.com:443:POST:/repos/*/issues' --wait` A rule authorizes every binary it lists to reach every endpoint it lists, so an update that adds a binary or an endpoint to an existing rule must declare @@ -702,10 +702,7 @@ When denied actions appear: `--rule-name`; it stays on its own rule instead of folding into the broader one. - `--add-allow` and `--add-deny` select an endpoint by host and port alone. If - that host and port appears in more than one rule, or twice in one rule under - different paths, the update is rejected as ambiguous. Fall back to full YAML - replacement for those endpoints. + `--add-allow` and `--add-deny` require `--rule-name` and the complete binary scope through repeated `--binary` or explicit `--any-binary`. Declare every port on the endpoint in the operation, for example `api.example.com:443,8443:POST:/admin`. Use `--endpoint-path` to disambiguate endpoints within the selected rule; an explicitly empty path selects an endpoint without a path selector. The gateway rejects missing or mismatched scope before persistence. Inspect the current policy and confirm the intended affected scope; do not automatically fill declarations from current policy just to make a rejection pass. 2. Use full YAML replacement for broad changes or non-network fields, including any change that would otherwise require restating a large existing scope: `openshell policy get work-session --full > policy.yaml` From b7a932a4d07aab33042ec31a4119c0177801458e Mon Sep 17 00:00:00 2001 From: "John T. Myers" <9696606+johntmyers@users.noreply.github.com> Date: Thu, 17 Sep 2026 22:54:20 +0000 Subject: [PATCH 07/12] docs(inference): remove stale managed endpoint references (#3428) Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> --- .agents/skills/sync-agent-infra/SKILL.md | 2 +- .../agent-memory/arch-doc-writer/MEMORY.md | 6 ++--- CONTRIBUTING.md | 2 +- architecture/sandbox.md | 16 ++++------- crates/openshell-supervisor/src/lib.rs | 4 +-- docs/sandboxes/inference-routing.mdx | 10 +++---- e2e/python/test_sandbox_providers.py | 27 +------------------ .../README.md | 11 ++------ .../current-shape.md | 7 +---- .../implementation-plan.md | 10 +++---- .../technical-design.md | 3 --- rfc/0013-native-windows-mxc/README.md | 2 +- skills/debug-inference/SKILL.md | 6 ++--- skills/openshell-cli/SKILL.md | 2 +- 14 files changed, 30 insertions(+), 78 deletions(-) diff --git a/.agents/skills/sync-agent-infra/SKILL.md b/.agents/skills/sync-agent-infra/SKILL.md index d3c0190e85..f2800afca7 100644 --- a/.agents/skills/sync-agent-infra/SKILL.md +++ b/.agents/skills/sync-agent-infra/SKILL.md @@ -45,7 +45,7 @@ Use this map when product behavior, commands, or development workflows change. I | Sandbox policy schema, presets, or enforcement behavior | `generate-sandbox-policy`, `openshell-cli` | | Supervisor middleware policy, registrations, runtime, or failure behavior | `generate-sandbox-policy`, `openshell-cli`, `debug-openshell-cluster` | | Gateway deployment, Helm, runtime drivers, or health checks | `debug-openshell-cluster`, `helm-dev-environment` | -| Inference providers, native model endpoints, or migration from `inference.local` | `debug-inference`, `openshell-cli`, `generate-sandbox-policy` | +| Inference providers, native model endpoints, or migration from the retired managed endpoint | `debug-inference`, `openshell-cli`, `generate-sandbox-policy` | | TUI architecture, navigation, data fetching, or UX | `tui-development` | | Release artifacts or post-publish smoke coverage | `test-release-canary` | | GitHub Actions workflows, required checks, or CI diagnostics | `watch-github-actions`; also `test-release-canary` for release smoke coverage | diff --git a/.claude/agent-memory/arch-doc-writer/MEMORY.md b/.claude/agent-memory/arch-doc-writer/MEMORY.md index 1fce460018..67844988a0 100644 --- a/.claude/agent-memory/arch-doc-writer/MEMORY.md +++ b/.claude/agent-memory/arch-doc-writer/MEMORY.md @@ -117,7 +117,7 @@ - Proto message field `filesystem` maps to YAML key `filesystem_policy` (different names!) - IMPORTANT: Sandbox always runs in Proxy mode. NetworkMode::Block exists as enum variant but is NEVER set. - Both file mode and gRPC mode set NetworkMode::Proxy unconditionally (see load_policy() in lib.rs and TryFrom in policy.rs) -- Reason: proxy always needed so inference.local is addressable + all egress evaluated by OPA +- Reason: proxy always needed so all egress is evaluated by OPA - OPA two-action model: Allow, Deny (NetworkAction in opa.rs). InspectForInference was REMOVED. - Rego network_action rule: "allow" or "deny" only (no "inspect_for_inference") - Behavioral trigger: endpoint `protocol` field -> L7 inspection; absent -> L4 raw copy_bidirectional @@ -152,9 +152,9 @@ - Route sources: `--inference-routes` YAML file (standalone) > cluster bundle via gRPC; empty routes gracefully disable - Cluster bundle refreshed every ROUTE_REFRESH_INTERVAL_SECS (30s) - Patterns: POST /v1/chat/completions, /v1/completions, /v1/responses, /v1/messages; GET /v1/models, /v1/models/* -- inference.local CONNECT intercepted BEFORE OPA evaluation in proxy +- Managed inference CONNECT traffic was intercepted before OPA evaluation in the proxy - InferenceProviderProfile in openshell-core/src/inference.rs: centralized provider metadata -- proxy.rs: ONLY CONNECT to inference.local is handled; non-CONNECT requests get 403 for ALL hosts +- proxy.rs: only managed inference CONNECT traffic was handled; non-CONNECT requests received 403 for all hosts - Buffer: INITIAL_INFERENCE_BUF=64KiB, MAX_INFERENCE_BUF=10MiB; grows by doubling - Dev sandbox: `mise run sandbox -e VAR_NAME` forwards host env vars; NVIDIA_API_KEY always passed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d97a6ce10..63921028b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,7 +80,7 @@ Public skills live in `skills/` and work without an OpenShell source checkout. I | --- | --- | | `openshell-cli` | CLI usage, sandbox lifecycle, provider management, and BYOC workflows | | `debug-openshell-cluster` | Diagnose gateway deployment and health issues | -| `debug-inference` | Diagnose attached-provider inference, native endpoints, and migration from `inference.local` | +| `debug-inference` | Diagnose attached-provider inference, native endpoints, and migration from the retired managed endpoint | | `generate-sandbox-policy` | Generate YAML sandbox policies from requirements or API documentation | Public skills use `openshell --help` for installed command syntax and published OpenShell documentation for product concepts and configuration. They must not depend on repository-relative source or documentation files. diff --git a/architecture/sandbox.md b/architecture/sandbox.md index 50b0aa3034..12b3d74315 100644 --- a/architecture/sandbox.md +++ b/architecture/sandbox.md @@ -351,17 +351,11 @@ security logs. See [Supervisor Middleware](../docs/extensibility/supervisor-middleware.mdx) for configuration and protocol details. -`https://inference.local` is special. It bypasses OPA network policy and is -handled by the inference interception path: - -1. The proxy terminates the local TLS connection with the sandbox CA. -2. It detects known OpenAI, Anthropic, and compatible inference request shapes. -3. It strips caller-supplied credentials and disallowed headers. -4. It forwards through `openshell-router` using the route bundle fetched from - the gateway. - -External inference endpoints that do not use `inference.local` are treated like -ordinary network traffic and must be allowed by policy. +Inference providers use the same egress path as other external services. An +attached provider profile contributes endpoint and binary policy. The proxy +then resolves the provider's credential placeholder only when both policy and +the profile's endpoint binding authorize the native request. Model selection, +request shape, headers, streaming, and timeouts remain client concerns. In proxy-required networks, the supervisor chains upstream TLS tunnels through a corporate forward proxy with HTTP CONNECT instead of connecting directly, diff --git a/crates/openshell-supervisor/src/lib.rs b/crates/openshell-supervisor/src/lib.rs index b13849939d..3443b8fae6 100644 --- a/crates/openshell-supervisor/src/lib.rs +++ b/crates/openshell-supervisor/src/lib.rs @@ -4754,8 +4754,8 @@ filesystem_policy: #[test] fn discover_policy_restrictive_default_blocks_network() { - // In cluster mode we keep proxy mode enabled so `inference.local` - // can always be routed through proxy/OPA controls. + // In cluster mode we keep proxy mode enabled so all egress passes + // through proxy/OPA controls. let proto = openshell_policy::restrictive_default_policy(); let local_policy = SandboxPolicy::try_from(proto).expect("conversion should succeed"); assert!(matches!(local_policy.network.mode, NetworkMode::Proxy)); diff --git a/docs/sandboxes/inference-routing.mdx b/docs/sandboxes/inference-routing.mdx index 902c09eea0..7a6553adb3 100644 --- a/docs/sandboxes/inference-routing.mdx +++ b/docs/sandboxes/inference-routing.mdx @@ -232,8 +232,8 @@ openshell inference set \ --timeout 300 ``` -Clients called `https://inference.local`, supplied a placeholder key and model, -and relied on OpenShell to rewrite the request. +Clients called a managed virtual endpoint, supplied a placeholder key and +model, and relied on OpenShell to rewrite the request. ### After @@ -266,9 +266,9 @@ Update each workload to: 5. Use the provider's native request format. Launch a new process after attachment and verify a native request before -upgrading production workloads. Code that still calls `inference.local` fails -DNS resolution because OpenShell no longer resolves or trusts that virtual -host. +upgrading production workloads. Code that still calls the retired managed +virtual endpoint fails DNS resolution because OpenShell no longer resolves or +trusts that host. ### Migration Checklist diff --git a/e2e/python/test_sandbox_providers.py b/e2e/python/test_sandbox_providers.py index 1f2a7e4aa8..d3af3f3ecb 100644 --- a/e2e/python/test_sandbox_providers.py +++ b/e2e/python/test_sandbox_providers.py @@ -284,21 +284,6 @@ def log_message(self, fmt, *args): proc.communicate(timeout=5) -def _tcp_connect_errno(): - """Return a closure that reports the errno from a normal TCP connection.""" - - def fn(host, port): - import socket - - try: - with socket.create_connection((host, port), timeout=10): - return 0 - except OSError as error: - return error.errno or -1 - - return fn - - # =========================================================================== # Tests: placeholder visibility # =========================================================================== @@ -625,11 +610,10 @@ def call_native_openai(host: str, port: int) -> str: assert body["model"] == "fixture-openai-model" -def test_imported_anthropic_profile_uses_native_endpoint_and_inference_local_is_not_privileged( +def test_imported_anthropic_profile_allows_native_endpoint_with_attached_provider( sandbox: Callable[..., Sandbox], sandbox_client: SandboxClient, ) -> None: - """Attached imported profiles should not resurrect `inference.local` routing.""" stub = sandbox_client._stub profile_id = f"e2e-native-anthropic-{int(time.time() * 1000)}" provider_name = f"{profile_id}-provider" @@ -714,15 +698,6 @@ def call_native_anthropic(host: str, port: int) -> str: assert payload["x_api_key"] == secret assert body["model"] == "fixture-anthropic-model" - denied = sb.exec_python( - _tcp_connect_errno(), - args=("inference.local", 443), - timeout_seconds=30, - ) - assert denied.exit_code == 0, denied.stderr - assert int(denied.stdout.strip()) != 0 - - # =========================================================================== # Tests: security & edge cases # =========================================================================== diff --git a/rfc/0005-sandbox-proxy-egress-adapter/README.md b/rfc/0005-sandbox-proxy-egress-adapter/README.md index c0a43849e7..cde26bc4ca 100644 --- a/rfc/0005-sandbox-proxy-egress-adapter/README.md +++ b/rfc/0005-sandbox-proxy-egress-adapter/README.md @@ -25,7 +25,7 @@ See rfc/README.md for the full RFC process and state definitions. Refactor sandbox egress around shared authorization, destination-validation, and relay boundaries. CONNECT, forward HTTP, native TCP capture, policy DNS, -`inference.local`, `policy.local`, and metadata loopback become narrow adapters +`policy.local`, and metadata loopback become narrow adapters that translate userland entry points into common runtime intents. Policy evaluation, destination validation, supervisor middleware, credential injection, request-body rewrite, WebSocket handling, protocol processing, and @@ -101,7 +101,7 @@ authorization or relay logic. ### Migration Big Rocks 1. **Transport and local-service adapters.** CONNECT, forward HTTP, - transparent TCP, policy DNS, `inference.local`, `policy.local`, and metadata + transparent TCP, policy DNS, `policy.local`, and metadata loopback become small adapters. They parse their surface and produce either an egress intent, a local response, or a DNS answer. They do not duplicate policy evaluation. @@ -160,13 +160,10 @@ flowchart TD end subgraph LocalApis["Sandbox-local services"] - InferenceReq["Request to inference.local"] PolicyReq["Request to policy.local"] MetadataReq["Request to metadata loopback"] - InferenceAdapter["Inference local adapter"] PolicyAdapter["Policy local adapter"] MetadataAdapter["Metadata loopback adapter"] - InferenceReq --> InferenceAdapter PolicyReq --> PolicyAdapter MetadataReq --> MetadataAdapter end @@ -189,14 +186,12 @@ flowchart TD User --> ProxyBytes User --> NameLookup User --> NativeConnect - User --> InferenceReq User --> PolicyReq User --> MetadataReq Connect --> Intent Forward --> Intent TcpAdapter --> Intent - InferenceAdapter --> InferenceResp["Local inference response"] PolicyAdapter --> PolicyResp["Local policy response"] MetadataAdapter --> MetadataResp["Local metadata credential response"] ``` @@ -362,8 +357,6 @@ authorization evidence evaluated at connect time, not the mechanism that joins the DNS request to the TCP connection. Local service adapters stay outside the normal external egress relay: -`inference.local` routes chat, completion, model discovery, embeddings, and -provider-specific inference traffic through the router with local limits; `policy.local` exposes current policy, denial summaries, proposal submission, and proposal wait routes; metadata loopback serves provider metadata credentials to SDKs that bypass HTTP proxy variables. diff --git a/rfc/0005-sandbox-proxy-egress-adapter/current-shape.md b/rfc/0005-sandbox-proxy-egress-adapter/current-shape.md index 340c7933c8..3a31e9e1d7 100644 --- a/rfc/0005-sandbox-proxy-egress-adapter/current-shape.md +++ b/rfc/0005-sandbox-proxy-egress-adapter/current-shape.md @@ -52,7 +52,6 @@ The networking surface currently includes: - CONNECT proxy traffic for HTTPS and generic TCP tunnels. - Forward HTTP proxy traffic for absolute-form HTTP requests. -- `inference.local` for local inference routing. - `policy.local` for current policy, denial summaries, proposal submission, and proposal wait routes. - GCE metadata loopback for SDKs that bypass HTTP proxy variables. @@ -123,7 +122,6 @@ copy, but it is still orchestrated separately from the CONNECT relay path. ```mermaid flowchart TD Request["Request to local name"] --> Match{"Known local route?"} - Match -- "inference.local" --> Inference["Inference route adapter"] Match -- "policy.local" --> Policy["Policy local adapter"] Match -- "metadata loopback" --> Metadata["Metadata credential server"] Match -- No --> External["Normal egress path"] @@ -132,9 +130,7 @@ flowchart TD Metadata --> MetadataResp["Metadata response"] ``` -`inference.local` now covers buffered and streaming inference shapes including -chat/completion routes, model discovery, embeddings, and provider-specific -routes. `policy.local` supports the agentic approval loop: agents can submit +`policy.local` supports the agentic approval loop: agents can submit narrow proposals and wait on approval/reload before retrying. Metadata loopback exists for provider credentials consumed by SDKs that do not honor HTTP proxy variables. @@ -274,7 +270,6 @@ The refactor should preserve: - MCP Streamable HTTP method and tool policy. - WebSocket transport and GraphQL-over-WebSocket policy. - h2c rejection on inspected HTTP routes. -- Inference routing through `inference.local`, including embeddings. - Agent-facing policy advisor routes through `policy.local`. - GCE metadata loopback for supported provider credentials. - Timeout and resource tracking for client, upstream, and local service work. diff --git a/rfc/0005-sandbox-proxy-egress-adapter/implementation-plan.md b/rfc/0005-sandbox-proxy-egress-adapter/implementation-plan.md index 5e8a06b74f..42c80b1884 100644 --- a/rfc/0005-sandbox-proxy-egress-adapter/implementation-plan.md +++ b/rfc/0005-sandbox-proxy-egress-adapter/implementation-plan.md @@ -27,8 +27,8 @@ after the shared contracts are authoritative. `exec.path` cannot satisfy binary-scoped policy while identity is required. - Cover static credential injection, token grants, REST body rewrite, WebSocket text-frame rewrite and policy, GraphQL, JSON-RPC, and MCP behavior. -- Cover `inference.local`, `policy.local`, metadata loopback, and unchanged - nftables bypass reject/log behavior. +- Cover `policy.local`, metadata loopback, and unchanged nftables bypass + reject/log behavior. - Capture stable OCSF event class, activity/action/disposition, severity, status, destination, actor, firewall rule, message, and status detail for representative allow and deny paths. @@ -154,8 +154,6 @@ single flag-day cutover. ## Phase 7 - Existing Local Services And Cleanup -- Keep `inference.local` as a local adapter with its existing TLS, route, - provider-auth, streaming/buffered limit, and OCSF behavior. - Keep `policy.local` as a local adapter for current policy, bounded denial summaries, proposals, and proposal wait. - Decide whether metadata loopback remains orchestrated by `openshell-sandbox` @@ -249,8 +247,8 @@ series. then reuse the same suite for transparent TCP when Phase 8 lands. - Integration-test HTTP keep-alive/pipelining, REST, GraphQL, JSON-RPC, MCP, WebSocket, credentials, token grants, middleware, and TLS/raw-TCP selection. -- Integration-test `inference.local`, `policy.local`, and metadata loopback body - limits, timeouts, redaction, and local denial responses. +- Integration-test `policy.local` and metadata loopback body limits, timeouts, + redaction, and local denial responses. - Compare OCSF fixtures before and after each migration subphase. - Exercise policy reload between L4 decision, endpoint materialization, relay startup, and long-lived per-request evaluation. diff --git a/rfc/0005-sandbox-proxy-egress-adapter/technical-design.md b/rfc/0005-sandbox-proxy-egress-adapter/technical-design.md index ea2767b9cd..accb53a51d 100644 --- a/rfc/0005-sandbox-proxy-egress-adapter/technical-design.md +++ b/rfc/0005-sandbox-proxy-egress-adapter/technical-design.md @@ -549,9 +549,6 @@ which protocol milestone is sufficient to call the validated connector. Local services are network surfaces but not normal external egress: -- `inference.local` terminates local client traffic, validates known inference - routes, strips caller auth, injects provider routing/auth, and applies - streaming or buffered limits based on route type. - `policy.local` serves policy snapshots, denial summaries, proposal submission, and proposal wait. It should never expose secrets or provider rules as editable policy. diff --git a/rfc/0013-native-windows-mxc/README.md b/rfc/0013-native-windows-mxc/README.md index 515e7387dd..955bb1e9dc 100644 --- a/rfc/0013-native-windows-mxc/README.md +++ b/rfc/0013-native-windows-mxc/README.md @@ -315,7 +315,7 @@ network policy into MXC network policy. MXC receives a fail-closed redirect layer: `network.defaultPolicy = "block"`, empty direct allowlists, and `network.proxy = { localhost: N }`. The original OpenShell `network_policies` are preserved and handed to the host CONNECT proxy, which remains responsible -for ports, binaries, L7 rules, `inference.local`, privacy routing, and audit. +for ports, binaries, L7 rules, privacy routing, and audit. The coarse MXC-only mapper is a separate fallback and analysis path for cases where no proxy is in the loop. In that mode, MXC can roughly express literal diff --git a/skills/debug-inference/SKILL.md b/skills/debug-inference/SKILL.md index 6c9580a9f6..e8df8cd10c 100644 --- a/skills/debug-inference/SKILL.md +++ b/skills/debug-inference/SKILL.md @@ -1,6 +1,6 @@ --- name: debug-inference -description: Debug inference clients that use an attached provider and its native endpoint, including hosted APIs and host-local Ollama, vLLM, SGLang, TRT-LLM, LM Studio, or NIM. Use for provider attachment, endpoint policy, credential substitution, topology, and migration from the removed inference.local endpoint. Trigger keywords - debug inference, inference.local, local inference, ollama, lm studio, vllm, sglang, trtllm, NIM, inference failing, model server unreachable, credential_endpoint_mismatch, host.openshell.internal. +description: Debug inference clients that use an attached provider and its native endpoint, including hosted APIs and host-local Ollama, vLLM, SGLang, TRT-LLM, LM Studio, or NIM. Use for provider attachment, endpoint policy, credential substitution, topology, and migration from the removed managed inference endpoint. Trigger keywords - debug inference, managed inference endpoint, local inference, ollama, lm studio, vllm, sglang, trtllm, NIM, inference failing, model server unreachable, credential_endpoint_mismatch, host.openshell.internal. --- # Debug Inference @@ -85,7 +85,7 @@ openshell sandbox provider detach --wait --timeout 30 The application must use the real upstream contract: -- Native provider base URL, not `https://inference.local`. +- Native provider base URL, not the retired managed virtual endpoint. - Real model ID, not a placeholder that OpenShell used to rewrite. - Native OpenAI, Anthropic, Vertex, or other provider request shape. - Application-owned timeout and retry settings. @@ -100,7 +100,7 @@ inference request using the provider's documented API shape. | Symptom | Likely cause | Fix | |---|---|---| | `credential_placeholder_in_request_body` | A body reference is invalid/revoked, or classification metadata is unavailable | Check the controlled denial reason; remove the reference from conversation history or restore provider access. Do not enable body credential rewriting or bypass flags to send tool output. Unknown literals and valid issued placeholders pass unchanged, including the model provider’s own placeholder. Header resolution does not enable body rewriting. | -| `Could not resolve host: inference.local` | Client still uses the removed managed endpoint | Configure the provider's native base URL and attach an endpoint-bearing provider profile | +| A retired managed endpoint fails DNS resolution | Client still uses the removed managed endpoint | Configure the provider's native base URL and attach an endpoint-bearing provider profile | | Direct request is denied | Missing attachment, endpoint policy, HTTP rule, or binary authorization | Inspect the attached provider profile and sandbox effective policy | | `credential_endpoint_mismatch` | Credential profile does not authorize the request recipient | Correct the host/port/path or import a narrowly scoped profile for the intended endpoint | | `request_authority_mismatch` | HTTP authority differs from the CONNECT destination | Use the same host and effective port in both authorities | diff --git a/skills/openshell-cli/SKILL.md b/skills/openshell-cli/SKILL.md index db5bba2015..052fe4c7bc 100644 --- a/skills/openshell-cli/SKILL.md +++ b/skills/openshell-cli/SKILL.md @@ -845,4 +845,4 @@ $ openshell sandbox upload --help |-------|------------| | `generate-sandbox-policy` | Creating or modifying policy YAML content (network rules, L7 inspection, access presets, endpoint configuration, and network middleware) | | `debug-openshell-cluster` | Diagnosing gateway deployment, runtime, or health failures | -| `debug-inference` | Diagnosing attached-provider inference, native endpoints, host-backed models, and migration from `inference.local` | +| `debug-inference` | Diagnosing attached-provider inference, native endpoints, host-backed models, and migration from the retired managed endpoint | From 04146692d9f5805a427c65aaf26252b5b22afadf Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Thu, 17 Sep 2026 22:59:27 +0000 Subject: [PATCH 08/12] refactor(providers)!: make provider profiles import-only (#3383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(providers): remove dead provider plugin modules Twelve modules under crates/openshell-providers/src/providers/ were never declared in providers/mod.rs, so they have not been compiled since the plugin registry was narrowed to the two adapters it still registers. Four of them (generic, gitlab, opencode, outlook) key off provider type identifiers that normalize_provider_type already retired. Keep google_cloud and vertex, which are the only plugins ProviderRegistry::new registers. Signed-off-by: Philippe Martin * test(providers): load example profiles from providers/ at test time Add an example_profiles module that reads the YAML under providers/ from the source checkout at run time and parses it with the existing profile loader. It is gated behind a new non-default example-profiles feature so it is available to this crate's own tests and, once wired into dev-dependencies, to gateway and CLI tests, while never reaching a release binary. Nothing consumes it yet; later changes move the test fixtures off the compiled catalog and onto these files. Signed-off-by: Philippe Martin * test: source profile fixtures from providers/ instead of the compiled catalog Unit and integration fixtures reached into builtin_profiles() to get a profile to work with, which ties the tests to the compiled catalog rather than to the files an operator would import. Point them at the example_profiles loader instead. The profiles.rs tests keep their coverage unchanged and become explicit golden tests over providers/*.yaml: they are what keeps those files valid once nothing compiles them. builtin_profiles_are_sorted_by_id widens into a test that the whole example set parses, sorts, and lints clean as one catalog. The CLI fake gateways serve the example profiles the way a real gateway serves what an operator imported, through a shared helper. No behavior change: the gateway still loads the built-in source by default and serves the same profiles. Signed-off-by: Philippe Martin * docs(providers): document the example provider profiles Each file under providers/ now opens with a header naming its expected client binary identities, the image layout those paths assume, the credential scope, the endpoint access it grants, and a smoke test. Add a README covering the import commands and why a profile should be copied and edited rather than imported unchanged. Several of these profiles bind network access to paths that only exist in the OpenShell Community image — /sandbox/.venv, /app/.venv, /sandbox/.cursor-server, /usr/lib/node_modules. Imported unchanged into another image the profile matches nothing: the catalog still advertises it, but the credential is never injected and the traffic is denied. The headers say so where it applies. Comments only; the profile schema has no documentation fields and all fifteen files still lint clean. Signed-off-by: Philippe Martin * test(server): seed unit-test state with the example provider profiles Server unit tests inherited the builtin + user source default from ServerState, so around a hundred and forty assertions about github, openai and the rest resolved against the compiled catalog. Point the test state at the user source alone and import the example profiles from providers/ into its store first, the way an operator would. Every one of those assertions keeps passing unchanged, which is the point: it proves the gateway behaves identically with an imported catalog before the default moves. Four tests asserted builtin-source semantics specifically. Under import-only the only profiles a gateway cannot edit are the ones a non-user source vends, so they now exercise a source-managed profile composed with the user source; the read-only guard they cover is the one that still applies to interceptor catalogs. The list test asserts the imported profile's user/platform identity instead of builtin with an empty scope. test_server_state_with_user_only_github_profile is gone: the default test state now is a user-only gateway with github imported. Signed-off-by: Philippe Martin * refactor(cli): resolve credential suggestions from the gateway catalog The --env credential warning scanned a profile table compiled into the CLI, so its suggestions described the binary rather than the gateway the user is talking to: a profile the gateway does not serve was suggested anyway, and an imported custom profile never was. Fetch the catalog from the connected gateway instead. The warning moves out of argument parsing and into sandbox create and sandbox template create, where a client already exists. A catalog fetch failure is not fatal — the warning degrades to its generic form rather than blocking sandbox creation. Extract the ListProviderProfiles paging loop from provider list-profiles into a shared fetch_provider_profile_catalog, which the profile-driven paths now share. Signed-off-by: Philippe Martin * refactor(cli)!: infer providers from the gateway catalog Command-to-provider inference went through a hardcoded alias table in openshell-providers, a second copy of the built-in catalog's identifiers. A custom profile could never be inferred no matter what binaries it declared, and the table drifted from the profiles it mirrored. Infer from the connected gateway's catalog instead: match the command's basename against each profile's ID and against the basenames of the binaries the profile authorizes. A profile that names /usr/bin/claude is the profile for running claude. The match must be unique — where several profiles claim a command, the user names one with --provider — and an empty catalog infers nothing. No command is special-cased. `binaries` is the operator's authorization statement, so a profile that declares a binary claims the command that runs it, whatever that binary is; narrowing that belongs in the profile rather than in a list compiled into the CLI, which could never cover an unbounded catalog anyway. Breaking: the retired aliases stop resolving, and commands the old table never listed can now infer. git, pip and uv are declared by the github and pypi example profiles, so they infer where they previously did not. Signed-off-by: Philippe Martin * refactor(providers,server)!: resolve provider profiles by exact ID normalize_provider_type was a hardcoded alias map — gh to github, claude to claude-code, vertex to google-vertex-ai — and a second copy of the built-in catalog's identifiers, independent of the YAML it mirrored. It let a provider type resolve to a profile the operator never named, and it made the built-in IDs behave as a reserved namespace. Remove it, along with detect_provider_from_command and the alias-normalizing ProviderRegistry::inject_env. A provider type now names a profile exactly: - the effective catalog resolves an ID or reports it absent, with no alias retry - plugins activate only for the ID of a profile the gateway resolved; a provider with no resolvable profile gets no plugin projection, instead of falling back to an alias guess - the CLI surfaces the gateway's not-found instead of retrying under an alias - telemetry buckets by profile ID, and the gitlab, opencode and outlook buckets go with the aliases that were their only source Breaking: `--type gh`, `--type claude` and the other aliases no longer resolve. Use the profile's own ID. Signed-off-by: Philippe Martin * feat(server): fail closed when a provider's profile is absent A sandbox composed from a provider whose profile the gateway cannot resolve started anyway: the credential and policy builders warned and skipped, so the sandbox came up carrying none of that provider's credentials or network policy. The operator learned about it later, as a denied connection or a missing environment variable, rather than as the configuration error it is. Check at the two composition boundaries — CreateSandbox and AttachSandboxProvider — right beside the catalog snapshot already taken there, and reject with a bounded diagnostic naming the provider, the profile it refers to, and the import command that supplies it. Scope-aware: a platform-scoped provider is told to import with --global. Read paths are untouched. ListProviders, GetProvider and profile export keep working so an operator can see and recover an affected provider, and the shared policy builders keep their warn-and-skip for the diagnostic paths that also reach them. Signed-off-by: Philippe Martin * refactor(server): scope the vendor base-URL pin to declared endpoints provider_profile_endpoints_are_active withheld a credential and the provider's policy layer when an openai or anthropic provider pointed its client somewhere other than the public vendor endpoint. The guard was keyed on profile.source == "builtin" and on those two profile IDs, so it protected only profiles OpenShell shipped. Once profiles are import-only no profile is ever builtin, and the guard would silently stop applying — including to an operator who imported providers/openai.yaml verbatim. Key it on the profile instead of on where the profile came from. A profile's endpoints are the boundary its credential is bound to, so if the provider configures a *_BASE_URL pointing at a host the profile does not declare, the profile no longer describes where that credential goes and is treated as endpointless. Host matching reuses the DNS-label-aware matcher in openshell-core, so wildcard endpoints such as Vertex's *-aiplatform.googleapis.com resolve correctly. A profile with no declared endpoints has no boundary to contradict, and a config value that names no host is not a redirect this can reason about. Both keep the profile active. The control now covers every endpoint-bearing profile, including an operator's own, and the last "builtin" string leaves the gateway. Signed-off-by: Philippe Martin * test(e2e): import example provider profiles during gateway bring-up The e2e suites create providers from github, openai, nvidia, claude-code and google-cloud, and the GitHub lane runs a real git clone through the profile's binary attribution. A gateway serves only the profiles an operator imported, so the lanes have to import them. Add e2e_import_example_provider_profiles to the shared bring-up helpers and call it from the Docker, Podman, Kubernetes and VM wrappers once the gateway is healthy and registered. It runs the same command the upgrade notes give operators, against the repository's own providers/ directory, so the lanes exercise the documented path rather than a test-only shortcut. Lands before the default changes: a same-ID user profile already shadows a built-in, so importing works today. Signed-off-by: Philippe Martin * refactor(providers)!: make provider profiles import-only OpenShell compiled fifteen provider profile YAML files into every release binary and selected them by default, so a fresh gateway published a catalog it was never configured with. Those profiles are not image-neutral: their binary selectors name paths that exist in the OpenShell Community image, so changing the sandbox image could make a profile inert while the catalog still advertised it. Every endpoint, credential name and binary path in providers/ was also effectively part of the 0.1.0 public contract. A gateway's catalog is now exactly what an operator imported: - providers/*.yaml is no longer include_str!'d, and builtin_profiles() is gone from the openshell-providers API - the default provider_profile_sources is [{ type = "user" }], and a gateway with nothing imported reaches ready and serves an empty catalog — an empty catalog is a valid state, not a startup failure - the builtin source type is removed from the configuration schema, and a gateway.toml that still names it is rejected at parse time with the import command rather than an unknown-variant error - nothing reserves the canonical identifiers any more, so github, pypi, anthropic and the rest import at their own IDs and the imported profile is the only definition for that ID; the static_fallback that kept a shipped definition resident behind an imported one is gone with the source that produced it A collision between an interceptor-vended profile and an imported one still fails closed, which is the behavior that shadowing quietly bypassed for built-ins. Operators upgrading should export the profiles their deployment relies on before upgrading, or copy them from the providers/ directory of the matching release tag, then import them at the scope their providers use. Signed-off-by: Philippe Martin * docs(providers): document import-only provider profiles Rewrite the provider profile documentation around a catalog the operator builds rather than one the gateway ships. - gateway-config: the default is [{ type = "user" }], the builtin source type is gone and rejected at startup, and an empty catalog is a valid ready state - profiles: replace the built-in profile table and its shadowing semantics with the import workflow, and say plainly that a profile whose binary paths do not match the image is inert - manage-providers: replace the two fixed provider-type tables with `provider list-profiles`, and describe catalog-driven command inference - inference-routing: drop the "still loads built-in profiles for compatibility" transition text; its migration walkthrough is now the normal path - quickstart and the Docker Compose, GitHub, AWS, Google Cloud and Vertex tutorials: import the profile before creating the provider, since nothing resolves without it - release notes: a 0.1.0 migration section covering export-before-upgrade, importing from the release tag's providers/ directory, what happens to a provider whose profile is missing, and the removal of the legacy type aliases - README, architecture, the openshell-cli and debug-openshell-cluster skills, and the governance interceptor example follow the same change; the example's smoke assertion now imports a profile to prove an authoritative interceptor hides it Signed-off-by: Philippe Martin * fix(cli,e2e): distinguish catalog failures and authenticate OIDC seeding Addresses two findings from review (GATOR-c1bd9867-02 and -03). The provider profile catalog lookup collapsed its error into an empty catalog, so an authorization, availability or transport failure on ListProviderProfiles was indistinguishable from a gateway that genuinely has no profiles. Command inference then resolved nothing and the sandbox was created without the provider it needed, deferring the failure to the workload. Keep the lookup's outcome instead of discarding it. The credential warning is advisory and still degrades to its generic form, but inference now consults the catalog only when there is a command to resolve and surfaces the lookup failure when there is, naming the gateway and pointing at explicit --provider selection. Two regression tests cover it through a fake gateway whose ListProviderProfiles returns UNAVAILABLE while every other RPC succeeds: sandbox creation fails without sending a provider-less create request, and a sandbox with no trailing command still succeeds because it needs no catalog. The e2e profile seeding also ran unauthenticated in the OIDC lanes. Those lanes deliberately skip gateway registration and start the gateway without a TLS client CA, so no mTLS identity exists and no token has been acquired when the import runs; the wrapper exited during setup. Skipping the import is not sufficient because the provider tests now require the claude-code profile. Add e2e_register_oidc_admin_session, which mints an administrator token with Keycloak's password grant — the same grant the OIDC test helpers use — and writes the gateway metadata and token bundle that an interactive login would have stored, so the import runs as an authenticated administrator. The mTLS lanes keep the direct import unchanged. Both affected wrappers are covered: with-podman-gateway.sh had the same defect as with-docker-gateway.sh. Signed-off-by: Philippe Martin * refactor(cli)!: remove command-derived provider attachment Addresses GATOR-c1bd9867-01. A profile's `binaries` list authorizes a binary to reach that profile's endpoints. It is not a statement that running the binary asks for the provider, and reading it as attachment intent let a command silently gain provider authority: the aws-s3 example declares /bin/bash, so `sandbox create -- bash` resolved an existing aws-s3 provider and attached its credential-backed capability and network policy to the shell and its descendants. Attachment of an already-created provider never prompted, so the confirmation flow did not guard it. The distinction that would make inference sound — whether a declared binary is a profile's client or merely a permitted runtime — cannot be expressed: NetworkBinary carries only a path, and the field that encoded it was removed in 0.1.0. Any substitute is a guess. Restricting the guess to a unique claimant does not help, because uniqueness measures how sparse the catalog is rather than what the user intended, and a compiled list of "generic" commands could never cover an unbounded operator catalog. Remove trailing-command inference rather than approximate it. A provider is attached only when named with --provider, which still creates a missing provider from local discovery when the name matches an imported profile ID. Sandboxes with no providers remain a normal, fully supported state. Removing inference also settles GATOR-c1bd9867-02: with no consumer deriving authority from the catalog, its only remaining use is the advisory credential warning, so a failed lookup degrades that warning instead of blocking creation. The regression test now asserts that an unreachable catalog still creates the sandbox and attaches nothing. While repurposing the deduplication test, a pre-existing defect surfaced: repeating a name in --provider auto-created it twice and the second attempt failed with "provider already exists", because the explicit pass never consulted the set of names it had already handled. Guard it. Signed-off-by: Philippe Martin * fix(e2e): load the OIDC token and trust the gateway when seeding profiles Addresses the carried finding GATOR-c1bd9867-03. e2e_register_oidc_admin_session established a session the CLI never used. The CLI decides whether to load a stored bearer token by matching on the auth_mode field of the gateway metadata alone; the helper omitted that field, so the metadata fell through to the default arm and oidc_token.json stayed on disk unread. The profile import went out unauthenticated exactly as it had before the helper existed. The helper also installed no trust anchor, leaving the CLI unable to verify the gateway's self-signed serving certificate. Write auth_mode = "oidc" so the stored token is loaded, and install the CA at /mtls/ca.crt. Only the CA is installed: with no client certificate or key on disk the CLI falls back to CA-only server verification and authenticates with the bearer token, which is what these lanes need because they start the gateway without --tls-client-ca. Certificate verification stays on; no insecure transport override is introduced. Assert the session before anything depends on it. ListProviderProfiles is annotated auth_mode: "bearer", so it cannot succeed unless the token was loaded and accepted. The helper now fails at that point, naming the gateway config directory and echoing the CLI output, rather than letting the defect surface later as an opaque profile import error. Both affected wrappers pass the PKI directory and CLI binary the helper needs; the mTLS lanes are untouched. Signed-off-by: Philippe Martin * fix(e2e): request the OpenShell scopes when minting the admin token The OIDC lanes failed at the session assertion added in b25dd0298 with PERMISSION_DENIED and "scope 'provider:read' required". Authentication was working -- the gateway logged ListProviderProfiles at gRPC status 7, which it can only reach once the bearer token has been loaded and accepted. The token simply carried no OpenShell scope. sandbox:*, provider:*, config:*, workspace:* and openshell:all are optional client scopes on the openshell-cli client in scripts/keycloak-realm.json, so Keycloak mints them only when the request asks for them. The password grant here asked for nothing, leaving the realm defaults (openid, profile, email, roles, web-origins, acr) and an access token that authorizes no RPC. Request "openid openshell:all", as e2e/python/oidc/oidc_auth_test.py already does for its administrator tokens. openshell:all is SCOPE_ALL in crates/openshell-server/src/auth/authz.rs, so one scope covers the setup calls without enumerating them. Verified against the realm: the token goes from "email profile openid" to "email profile openshell:all openid". Record the same scopes in metadata.json. The helper writes the bundle openshell gateway login would have stored, and oidc_scopes is the field that login path reads back, so leaving it out would misdescribe the stored token. Signed-off-by: Philippe Martin * fix(e2e): seed provider profiles once per VM lane gateway The VM lanes failed on the second test target with "custom provider profile 'anthropic' already exists" for all fifteen example profiles, and the import exited non-zero. e2e_import_example_provider_profiles was called from run_e2e_test, so it ran once per target -- four times against one long-lived gateway. That was harmless while import overwrote silently, but profiles are now import-only: ImportProviderProfiles is create-only and reports an existing id as an error-severity diagnostic, with no overwrite flag on the request. The first import therefore succeeds and every later one fails. Hoist the call to just after the conformance run, which is where the docker, podman and kube lanes already seed their catalogs. The profiles persist for the gateway's lifetime, so every target still finds them, and the E2E_TEST_OVERRIDE path is covered by the same single call. Signed-off-by: Philippe Martin * test(e2e): name the provider explicitly in the OIDC workspace-user test user_can_create_sandbox_with_inferred_provider_command reached the gateway once the admin session was fixed, and then failed: it asserted a missing-provider error, but the sandbox was created and died provisioning with "failed to spawn sandbox entrypoint process 'claude-code'". The test drove provider resolution by passing claude-code as the trailing command and relying on the CLI to infer the provider type from it. That inference is what this branch removed, so the trailing word is now nothing but an entrypoint, and the image has no such binary. The regression the test guards is not inference itself: it is that a workspace user resolving a provider is not gated behind Platform Admin. Name the provider with --provider, the only remaining way to attach one. The CLI still has to fetch the claude-code profile before it can auto-create the provider, so the lookup a workspace user must be allowed to make still happens, and auto-creation still stops at the non-interactive branch with "missing required provider". Both assertions therefore keep their meaning. Rename the test and rework its comments to describe what it now exercises; the old name would otherwise outlive the behavior it was named for. Signed-off-by: Philippe Martin * fix(providers): reconcile import-only profiles with main Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> --------- Signed-off-by: Philippe Martin Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> Co-authored-by: John Myers <9696606+johntmyers@users.noreply.github.com> --- README.md | 4 +- architecture/gateway.md | 11 +- architecture/google-vertex-ai-provider.md | 2 +- crates/openshell-cli/Cargo.toml | 3 + crates/openshell-cli/src/commands/common.rs | 49 +- crates/openshell-cli/src/commands/provider.rs | 192 +++----- crates/openshell-cli/src/main.rs | 4 +- crates/openshell-cli/src/run.rs | 31 +- .../tests/ensure_providers_integration.rs | 55 +-- crates/openshell-cli/tests/helpers/mod.rs | 14 + .../tests/provider_commands_integration.rs | 20 +- .../sandbox_create_lifecycle_integration.rs | 60 ++- crates/openshell-core/src/config.rs | 84 +++- crates/openshell-providers/Cargo.toml | 6 + .../src/example_profiles.rs | 90 ++++ crates/openshell-providers/src/lib.rs | 121 +---- crates/openshell-providers/src/profiles.rs | 124 ++--- .../src/providers/anthropic.rs | 15 - .../src/providers/claude.rs | 15 - .../src/providers/codex.rs | 15 - .../src/providers/copilot.rs | 15 - .../src/providers/deepinfra.rs | 15 - .../src/providers/generic.rs | 29 -- .../src/providers/github.rs | 11 - .../src/providers/gitlab.rs | 11 - .../src/providers/nvidia.rs | 15 - .../src/providers/openai.rs | 15 - .../src/providers/opencode.rs | 174 ------- .../src/providers/outlook.rs | 29 -- crates/openshell-server/Cargo.toml | 3 + crates/openshell-server/src/config_file.rs | 21 +- crates/openshell-server/src/grpc/mod.rs | 62 ++- crates/openshell-server/src/grpc/policy.rs | 19 +- .../src/grpc/policy/endpoint_status_tests.rs | 6 +- crates/openshell-server/src/grpc/provider.rs | 452 +++++++++++++++--- crates/openshell-server/src/grpc/sandbox.rs | 149 ++++-- .../src/provider_profile_sources.rs | 216 ++++----- docs/about/release-notes.mdx | 24 + docs/extensibility/gateway-interceptors.mdx | 2 +- docs/get-started/quickstart.mdx | 46 +- docs/get-started/tutorials/docker-compose.mdx | 11 +- docs/get-started/tutorials/github-sandbox.mdx | 7 + docs/providers/aws-sigv4.mdx | 8 + docs/providers/google-cloud.mdx | 8 + docs/providers/google-vertex-ai.mdx | 8 + docs/providers/profiles.mdx | 98 ++-- docs/reference/gateway-config.mdx | 7 +- docs/sandboxes/inference-routing.mdx | 29 +- docs/sandboxes/manage-providers.mdx | 82 ++-- e2e/python/oidc/oidc_auth_test.py | 4 +- e2e/python/oidc/workspace_authz_test.py | 10 +- e2e/python/test_sandbox_providers.py | 4 +- e2e/rust/e2e-vm.sh | 6 + e2e/rust/tests/oidc_pkce.rs | 33 +- e2e/support/gateway-common.sh | 105 ++++ e2e/with-docker-gateway.sh | 18 + e2e/with-kube-gateway.sh | 6 + e2e/with-podman-gateway.sh | 18 + examples/governance-interceptor/README.md | 4 +- examples/governance-interceptor/smoke.sh | 15 +- proto/datamodel.proto | 3 +- providers/README.md | 54 +++ providers/anthropic.yaml | 19 + providers/aws-bedrock.yaml | 21 + providers/aws-s3.yaml | 27 ++ providers/aws.yaml | 24 + providers/claude-code.yaml | 21 + providers/codex.yaml | 22 + providers/copilot.yaml | 22 + providers/cursor.yaml | 19 + providers/deepinfra.yaml | 17 + providers/github.yaml | 18 + providers/google-cloud.yaml | 25 + providers/google-vertex-ai.yaml | 25 + providers/nvidia.yaml | 17 + providers/openai.yaml | 19 + providers/pypi.yaml | 23 + sdk/go/proto/datamodelv1/datamodel.pb.go | 3 +- skills/debug-openshell-cluster/SKILL.md | 10 +- skills/openshell-cli/SKILL.md | 11 +- tasks/scripts/sandbox.sh | 2 +- 81 files changed, 1948 insertions(+), 1164 deletions(-) create mode 100644 crates/openshell-providers/src/example_profiles.rs delete mode 100644 crates/openshell-providers/src/providers/anthropic.rs delete mode 100644 crates/openshell-providers/src/providers/claude.rs delete mode 100644 crates/openshell-providers/src/providers/codex.rs delete mode 100644 crates/openshell-providers/src/providers/copilot.rs delete mode 100644 crates/openshell-providers/src/providers/deepinfra.rs delete mode 100644 crates/openshell-providers/src/providers/generic.rs delete mode 100644 crates/openshell-providers/src/providers/github.rs delete mode 100644 crates/openshell-providers/src/providers/gitlab.rs delete mode 100644 crates/openshell-providers/src/providers/nvidia.rs delete mode 100644 crates/openshell-providers/src/providers/openai.rs delete mode 100644 crates/openshell-providers/src/providers/opencode.rs delete mode 100644 crates/openshell-providers/src/providers/outlook.rs create mode 100644 providers/README.md diff --git a/README.md b/README.md index 3237c169f9..51ae674956 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,9 @@ Policies are declarative YAML files. Static sections (filesystem, process) are l ## Providers -Agents need credentials — API keys, tokens, service accounts. OpenShell manages these as **providers**: named credential bundles that are injected into sandboxes at creation. The CLI auto-discovers credentials for recognized agents (Claude, Codex, OpenCode, Copilot) from your shell environment, or you can create providers explicitly with `openshell provider create`. Credentials never leak into the sandbox filesystem; they are injected as environment variables at runtime. +Agents need credentials — API keys, tokens, service accounts. OpenShell manages these as **providers**: named credential bundles that are injected into sandboxes at creation. Credentials never leak into the sandbox filesystem; they are injected as environment variables at runtime. + +A provider is created from a **provider profile**, which declares the credentials, endpoints, and client binaries the provider needs. Profiles are import-only: a gateway serves exactly the profiles you imported with `openshell provider profile import`, and ships none of its own. The [`providers/`](providers/) directory holds reviewable examples to copy and adapt. Once a profile is imported, the CLI can auto-discover credentials for its provider from your shell environment, or you can create providers explicitly with `openshell provider create`. Inference access uses the same provider workflow. Attach an inference-capable provider to a sandbox, call the provider's native endpoint, and select the model in the client. Provider profiles contribute the endpoint policy and bind credential placeholders to the authorized destination. diff --git a/architecture/gateway.md b/architecture/gateway.md index fc354f3e93..6d944cd0d0 100644 --- a/architecture/gateway.md +++ b/architecture/gateway.md @@ -232,11 +232,12 @@ observation or evaluation failures outside binding policy emit warnings and the The gateway reconstructs the original response frames, including trailers and body errors, before evaluating the observer. -Interceptor manifests can also vend provider profile catalogs. Gateway -configuration selects the exact ordered source set from the in-tree built-in -source, the stored user source, and named profile-capable interceptors. Omitting -the setting selects `builtin + user`; selecting only an interceptor makes it -authoritative by omission. Every selected source uses the same snapshot, +Interceptor manifests can also vend provider profile catalogs. No profile is +compiled into the gateway: configuration selects the exact ordered source set +from the stored user source and named profile-capable interceptors. Omitting the +setting selects the user source alone, so a gateway with nothing imported serves +an empty catalog; selecting only an interceptor makes it authoritative by +omission. Every selected source uses the same snapshot, semantic-validation, and duplicate-detection path. Duplicate normalized profile IDs fail instead of creating source precedence. The gateway treats configured interceptors as trusted sources and does not verify signature annotations in diff --git a/architecture/google-vertex-ai-provider.md b/architecture/google-vertex-ai-provider.md index 8779bd2879..2bc1c51694 100644 --- a/architecture/google-vertex-ai-provider.md +++ b/architecture/google-vertex-ai-provider.md @@ -57,7 +57,7 @@ part of sandbox runtime material. ## Endpoint Boundary -The built-in profile permits official Vertex hosts: +The example profile in `providers/google-vertex-ai.yaml` permits official Vertex hosts: - `-aiplatform.googleapis.com` - `aiplatform.googleapis.com` diff --git a/crates/openshell-cli/Cargo.toml b/crates/openshell-cli/Cargo.toml index 929143fbe3..94d69063c2 100644 --- a/crates/openshell-cli/Cargo.toml +++ b/crates/openshell-cli/Cargo.toml @@ -90,6 +90,9 @@ workspace = true nix = { workspace = true } [dev-dependencies] +# Tests import the example profiles from providers/ the way an operator +# would; the feature is test-only and never reaches a release binary. +openshell-providers = { path = "../openshell-providers", features = ["example-profiles"] } futures = { workspace = true } openshell-server = { path = "../openshell-server", features = ["test-support"] } rcgen = { workspace = true } diff --git a/crates/openshell-cli/src/commands/common.rs b/crates/openshell-cli/src/commands/common.rs index 0f12c3df4e..8eb7de2756 100644 --- a/crates/openshell-cli/src/commands/common.rs +++ b/crates/openshell-cli/src/commands/common.rs @@ -17,7 +17,6 @@ use openshell_core::proto::{ PlatformEvent, SandboxPhase, SandboxPolicy, SettingValue, setting_value, }; use openshell_core::settings::{self, SettingValueKind}; -use openshell_providers::builtin_profiles; use std::collections::HashMap; use std::io::IsTerminal; use std::process::Command; @@ -758,7 +757,10 @@ pub struct ProfileSuggestion { pub credential: String, } -fn credential_env_matches(env: &HashMap) -> Vec<(String, Vec)> { +fn credential_env_matches( + env: &HashMap, + profiles: &[openshell_providers::ProviderTypeProfile], +) -> Vec<(String, Vec)> { const KEYWORDS: [&str; 7_usize] = [ "TOKEN", "SECRET", @@ -777,10 +779,11 @@ fn credential_env_matches(env: &HashMap) -> Vec<(String, Vec Vec { let mut suggestions = Vec::new(); - for profile in builtin_profiles() { + for profile in profiles { for cred in &profile.credentials { if cred.env_vars.iter().any(|v| v.eq_ignore_ascii_case(key)) { suggestions.push(ProfileSuggestion { @@ -806,13 +809,22 @@ fn credential_env_matches(env: &HashMap) -> Vec<(String, Vec, suppress: bool) { +pub fn warn_credential_env_vars( + env: &HashMap, + profiles: &[openshell_providers::ProviderTypeProfile], + suppress: bool, +) { if suppress { return; } - let matches = credential_env_matches(env); + let matches = credential_env_matches(env, profiles); if matches.is_empty() { return; } @@ -1141,10 +1153,19 @@ mod tests { .collect() } + /// Stands in for the catalog a connected gateway would publish. + fn catalog() -> &'static [openshell_providers::ProviderTypeProfile] { + static CATALOG: std::sync::OnceLock> = + std::sync::OnceLock::new(); + CATALOG + .get_or_init(openshell_providers::example_profiles::load_all) + .as_slice() + } + #[test] fn suffix_match_no_profile() { let env = env(&[("FOO_TOKEN", "x")]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert_eq!(prof.len(), 1_usize); assert_eq!(&prof[0].0, "FOO_TOKEN"); assert!(prof[0].1.is_empty()); @@ -1154,7 +1175,7 @@ mod tests { fn exact_profile_match() { let env = env(&[("GITHUB_TOKEN", "x")]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert_eq!(prof.len(), 1_usize); assert_eq!(prof[0].0, "GITHUB_TOKEN"); @@ -1172,7 +1193,7 @@ mod tests { fn case_insensitive() { let env = env(&[("gh_token", "x")]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert_eq!(prof.len(), 1_usize); assert_eq!(prof[0].0, "gh_token"); @@ -1190,7 +1211,7 @@ mod tests { fn non_credential_skipped() { let env = env(&[("PATH", "x"), ("HOME", "y")]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert!(prof.is_empty()); } @@ -1198,7 +1219,7 @@ mod tests { fn no_value_leak() { let env = env(&[("APP_SECRET", "secretVALUE42")]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert_eq!(prof.len(), 1_usize); let dumped = format!("{prof:?}"); @@ -1213,7 +1234,7 @@ mod tests { ("MID_PASSWORD", "c"), ]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); let keys: Vec<&str> = prof.iter().map(|(k, _)| k.as_str()).collect(); assert_eq!(keys, ["ABC_SECRET", "MID_PASSWORD", "ZED_TOKEN"]); } @@ -1226,7 +1247,7 @@ mod tests { ("SECRETARY_EMAIL", "z"), ]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert!(prof.is_empty()); } @@ -1238,7 +1259,7 @@ mod tests { ("PRIMARY_KEY", "c"), ]); - let prof = credential_env_matches(&env); + let prof = credential_env_matches(&env, catalog()); assert_eq!(prof.len(), 2_usize); let keys = prof.iter().map(|(k, _)| k.as_str()).collect::>(); diff --git a/crates/openshell-cli/src/commands/provider.rs b/crates/openshell-cli/src/commands/provider.rs index 1c51b25bfc..536204fa34 100644 --- a/crates/openshell-cli/src/commands/provider.rs +++ b/crates/openshell-cli/src/commands/provider.rs @@ -29,9 +29,8 @@ use openshell_core::proto::{ use openshell_core::rpc_error::{ERROR_DOMAIN, decode_details}; use openshell_core::{ObjectId, ObjectName, ObjectWorkspace}; use openshell_providers::{ - ProviderTypeProfile, RealDiscoveryContext, detect_provider_from_command, discover_from_profile, - normalize_profile_id, normalize_provider_type, parse_profile_json, parse_profile_yaml, - profile_to_json, profile_to_yaml, profiles_to_json, profiles_to_yaml, + ProviderTypeProfile, RealDiscoveryContext, discover_from_profile, parse_profile_json, + parse_profile_yaml, profile_to_json, profile_to_yaml, profiles_to_json, profiles_to_yaml, }; use std::collections::{HashMap, HashSet}; use std::io::IsTerminal; @@ -322,30 +321,25 @@ fn format_provider_attachment_table(providers: &[Provider], color: bool) -> Stri output } -/// Return the provider type inferred from the trailing command, if any. -pub fn inferred_provider_type(command: &[String]) -> Option { - detect_provider_from_command(command).map(str::to_string) -} - /// Ensure all required providers exist. /// /// `explicit_names` are provider **names** supplied via `--provider`. They are /// passed through directly; the server validates they exist at sandbox creation. /// -/// `inferred_types` are provider **types** inferred from the trailing command -/// (e.g. `claude` -> type `"claude-code"`). These are resolved to provider names via -/// a type→name lookup, and missing types may be auto-created interactively. +/// A provider is attached only when the user names it. Nothing is derived from +/// the trailing command: a profile's `binaries` list authorizes a binary to +/// reach its endpoints, which is not a statement that running that binary asks +/// for the provider. /// /// Returns a deduplicated list of provider **names** suitable for /// `SandboxSpec.providers`. pub async fn ensure_required_providers( client: &mut crate::tls::GrpcClient, explicit_names: &[String], - inferred_types: &[String], auto_providers_override: Option, workspace: &str, ) -> Result> { - if explicit_names.is_empty() && inferred_types.is_empty() { + if explicit_names.is_empty() { return Ok(Vec::new()); } @@ -391,6 +385,12 @@ pub async fn ensure_required_providers( // name matches a known provider type, auto-create a provider of that // type with the requested name. for name in explicit_names { + // --provider may repeat a name. Without this guard a repeated name that + // does not exist yet is auto-created twice, and the second attempt + // fails with "provider already exists". + if seen_names.contains(name) { + continue; + } if known_names.contains(name) { if seen_names.insert(name.clone()) { configured_names.push(name.clone()); @@ -416,45 +416,12 @@ pub async fn ensure_required_providers( workspace, ) .await?; - // Record the type mapping so the inferred-types pass below - // doesn't attempt to create a duplicate provider. type_to_name .entry(provider_type.to_ascii_lowercase()) .or_insert_with(|| name.clone()); } } - // ── Resolve inferred provider types ────────────────────────────────── - if !inferred_types.is_empty() { - // Collect resolved names for types that already have a provider. - for t in inferred_types { - if let Some(name) = type_to_name.get(&t.to_ascii_lowercase()) - && seen_names.insert(name.clone()) - { - configured_names.push(name.clone()); - } - } - - let missing = inferred_types - .iter() - .filter(|t| !type_to_name.contains_key(&t.to_ascii_lowercase())) - .cloned() - .collect::>(); - - for provider_type in missing { - auto_create_provider( - client, - &provider_type, - None, - auto_providers_override, - &mut seen_names, - &mut configured_names, - workspace, - ) - .await?; - } - } - Ok(configured_names) } @@ -775,38 +742,60 @@ fn provider_profile_lookup_error(status: &Status) -> miette::Report { } } +/// Fetch the gateway's active provider profile catalog. +/// +/// Nothing about provider profiles is compiled into the CLI: the catalog is +/// whatever the connected gateway publishes, so anything that reasons about +/// available profiles has to ask for it. +pub async fn fetch_provider_profile_catalog( + client: &mut crate::tls::GrpcClient, + workspace: &str, +) -> Result> { + let mut page_token = String::new(); + let mut profiles = Vec::new(); + loop { + let response = client + .list_provider_profiles(ListProviderProfilesRequest { + page_size: 100, + page_token, + workspace: workspace.to_string(), + }) + .await + .into_diagnostic()? + .into_inner(); + profiles.extend(response.profiles); + if response.next_page_token.is_empty() { + break; + } + page_token = response.next_page_token; + } + Ok(profiles + .iter() + .map(ProviderTypeProfile::from_proto) + .collect()) +} + +/// Fetch one provider profile from the gateway by its exact ID. +/// +/// Profiles are import-only, so an ID the gateway does not serve is absent +/// rather than an alias for something else. async fn fetch_provider_profile( client: &mut crate::tls::GrpcClient, provider_type: &str, workspace: &str, ) -> Result { let requested = provider_type.trim(); - let response = match fetch_provider_profile_exact(client, requested, workspace).await { - Ok(response) => response, - Err(status) if status.code() == Code::NotFound => { - let Some(alias) = normalize_provider_type(requested) - .filter(|alias| normalize_profile_id(requested).as_deref() != Some(*alias)) - else { - return Err(miette::miette!( + fetch_provider_profile_exact(client, requested, workspace) + .await + .map_err(|status| { + if status.code() == Code::NotFound { + miette::miette!( "provider profile '{requested}' not found; import a matching profile before using this provider type" - )); - }; - fetch_provider_profile_exact(client, alias, workspace) - .await - .map_err(|fallback_status| { - if fallback_status.code() == Code::NotFound { - miette::miette!( - "provider profile '{requested}' not found; import a matching profile before using this provider type" - ) - } else { - provider_profile_lookup_error(&fallback_status) - } - })? - } - Err(status) => return Err(provider_profile_lookup_error(&status)), - }; - - Ok(response) + ) + } else { + provider_profile_lookup_error(&status) + } + }) } async fn fetch_provider_profile_exact( @@ -1546,32 +1535,15 @@ pub async fn provider_list_profiles( tls: &TlsOptions, ) -> Result<()> { let mut client = grpc_client(server, tls).await?; - let mut page_token = String::new(); - let mut profiles = Vec::new(); - loop { - let response = client - .list_provider_profiles(ListProviderProfilesRequest { - page_size: 100, - page_token, - workspace: workspace.to_string(), - }) - .await - .into_diagnostic()? - .into_inner(); - profiles.extend(response.profiles); - if response.next_page_token.is_empty() { - break; - } - page_token = response.next_page_token; - } - profiles.sort_by(|left, right| { + let mut dto_profiles = fetch_provider_profile_catalog(&mut client, workspace).await?; + dto_profiles.sort_by(|left, right| { left.category .cmp(&right.category) .then_with(|| left.id.cmp(&right.id)) }); - let dto_profiles = profiles + let profiles = dto_profiles .iter() - .map(ProviderTypeProfile::from_proto) + .map(ProviderTypeProfile::to_proto) .collect::>(); if crate::output::print_output_direct( @@ -2745,42 +2717,6 @@ mod tests { )); } - #[test] - fn inferred_provider_type_returns_type_for_known_command() { - let result = inferred_provider_type(&["claude".to_string(), "--help".to_string()]); - assert_eq!(result, Some("claude-code".to_string())); - } - - #[test] - fn inferred_provider_type_returns_none_for_unknown_command() { - let result = inferred_provider_type(&["bash".to_string()]); - assert_eq!(result, None); - } - - #[test] - fn inferred_provider_type_returns_none_for_empty_command() { - let result = inferred_provider_type(&[]); - assert_eq!(result, None); - } - - #[test] - fn inferred_provider_type_normalizes_aliases() { - // Retired legacy types are not inferred, even when a custom profile - // with the same ID could be imported and attached explicitly. - let result = inferred_provider_type(&["glab".to_string()]); - assert_eq!(result, None); - - // `gh` should resolve to `github` - let result = inferred_provider_type(&["gh".to_string()]); - assert_eq!(result, Some("github".to_string())); - } - - #[test] - fn inferred_provider_type_handles_full_path() { - let result = inferred_provider_type(&["/usr/local/bin/claude".to_string()]); - assert_eq!(result, Some("claude-code".to_string())); - } - #[test] fn read_gcloud_adc_missing_file_errors() { let _lock = TEST_ENV_LOCK diff --git a/crates/openshell-cli/src/main.rs b/crates/openshell-cli/src/main.rs index 674349061b..9f55658efc 100644 --- a/crates/openshell-cli/src/main.rs +++ b/crates/openshell-cli/src/main.rs @@ -3176,7 +3176,6 @@ async fn run_async() -> Result<()> { // Parse --env flags into a HashMap. let env_map = run::parse_env_pairs(&envs)?; - run::warn_credential_env_vars(&env_map, no_credential_warnings); // Parse --upload specs into [(local_path, sandbox_path, git_ignore)]. let upload_specs: Vec<(String, Option, bool)> = upload @@ -3231,6 +3230,7 @@ async fn run_async() -> Result<()> { approval_mode: &approval_mode, output: output.as_str(), detach, + suppress_credential_warnings: no_credential_warnings, }, &cli.workspace, &tls, @@ -3495,7 +3495,6 @@ async fn run_async() -> Result<()> { let annotations = run::parse_key_value_pairs(&annotations, "--annotation")?; let environment = run::parse_env_pairs(&envs)?; - run::warn_credential_env_vars(&environment, no_credential_warnings); let gpu_requirements: Option = gpu.map(Into::into); run::sandbox_template_create( @@ -3514,6 +3513,7 @@ async fn run_async() -> Result<()> { output.as_str(), &cli.workspace, &tls, + no_credential_warnings, ) .await?; } diff --git a/crates/openshell-cli/src/run.rs b/crates/openshell-cli/src/run.rs index 7483f63aba..87af586f8e 100644 --- a/crates/openshell-cli/src/run.rs +++ b/crates/openshell-cli/src/run.rs @@ -21,7 +21,7 @@ pub use crate::commands::gateway::{ gateway_logout, gateway_remove, gateway_select, gateway_status, gateway_use, }; -use crate::commands::provider::inferred_provider_type; +use crate::commands::provider::fetch_provider_profile_catalog; pub use crate::commands::provider::{ ProviderCreateCredentialSource, ProviderCreateOptions, ProviderRefreshConfigInput, ProviderUpdateOptions, ensure_required_providers, provider_create, @@ -448,6 +448,7 @@ pub struct SandboxCreateConfig<'a> { pub approval_mode: &'a str, pub output: &'a str, pub detach: bool, + pub suppress_credential_warnings: bool, } impl Default for SandboxCreateConfig<'_> { @@ -474,6 +475,7 @@ impl Default for SandboxCreateConfig<'_> { approval_mode: "manual", output: "table", detach: false, + suppress_credential_warnings: false, } } } @@ -508,6 +510,7 @@ pub async fn sandbox_create( approval_mode, output, detach, + suppress_credential_warnings, } = config; if editor.is_some() && !command.is_empty() { @@ -542,6 +545,15 @@ pub async fn sandbox_create( let effective_server = server.to_string(); let effective_tls = tls.clone(); + // Provider profiles are import-only, so the catalog lives on the gateway. + // Its only consumer is the credential warning, which is advisory: an + // unreachable catalog degrades the warning to its generic form rather than + // blocking sandbox creation. Nothing else derives authority from it. + let profile_catalog = fetch_provider_profile_catalog(&mut client, workspace) + .await + .unwrap_or_default(); + warn_credential_env_vars(&environment, &profile_catalog, suppress_credential_warnings); + if template.is_some() && (from.is_some() || gpu_requirements.is_some() @@ -576,15 +588,9 @@ pub async fn sandbox_create( None => (None, None), } }; - let inferred_types: Vec = inferred_provider_type(command).into_iter().collect(); - let configured_providers = ensure_required_providers( - &mut client, - providers, - &inferred_types, - auto_providers_override, - workspace, - ) - .await?; + let configured_providers = + ensure_required_providers(&mut client, providers, auto_providers_override, workspace) + .await?; let policy = load_sandbox_policy(policy)?; let resource_limits = if template.is_none() { @@ -2663,6 +2669,7 @@ pub async fn sandbox_template_create( output: &str, workspace: &str, tls: &TlsOptions, + suppress_credential_warnings: bool, ) -> Result<()> { let resources = if cpu.is_some() || memory.is_some() || gpu_requirements.is_some() { Some(SandboxResources { @@ -2685,6 +2692,10 @@ pub async fn sandbox_template_create( let desired_service_level = build_template_service_level(ready_within, max_burst)?; let mut client = grpc_client(server, tls).await?; + let profile_catalog = fetch_provider_profile_catalog(&mut client, workspace) + .await + .unwrap_or_default(); + warn_credential_env_vars(&environment, &profile_catalog, suppress_credential_warnings); let response = client .create_sandbox_template(CreateSandboxTemplateRequest { request_id: String::new(), diff --git a/crates/openshell-cli/tests/ensure_providers_integration.rs b/crates/openshell-cli/tests/ensure_providers_integration.rs index f1a41fe227..730c7271d0 100644 --- a/crates/openshell-cli/tests/ensure_providers_integration.rs +++ b/crates/openshell-cli/tests/ensure_providers_integration.rs @@ -356,7 +356,7 @@ impl OpenShell for TestOpenShell { &self, _request: tonic::Request, ) -> Result, Status> { - let profiles = openshell_providers::builtin_profiles() + let profiles = helpers::example_profiles() .iter() .map(openshell_providers::ProviderTypeProfile::to_proto) .collect(); @@ -373,7 +373,7 @@ impl OpenShell for TestOpenShell { request: tonic::Request, ) -> Result, Status> { let id = request.into_inner().id; - let profile = openshell_providers::builtin_profiles() + let profile = helpers::example_profiles() .iter() .find(|profile| profile.id == id) .ok_or_else(|| Status::not_found("provider profile not found"))? @@ -836,7 +836,6 @@ async fn explicit_provider_name_passes_through_when_it_exists() { let result = run::ensure_required_providers( &mut client, &["nvidia".to_string()], - &[], Some(true), // --auto-providers (should not matter here) "default", ) @@ -865,7 +864,6 @@ async fn explicit_provider_name_auto_creates_when_valid_type() { let result = run::ensure_required_providers( &mut client, &["nvidia".to_string()], - &[], Some(true), // --auto-providers to skip interactive prompt "default", ) @@ -899,7 +897,6 @@ async fn explicit_provider_name_errors_for_unrecognised_name() { let err = run::ensure_required_providers( &mut client, &["my-custom-thing".to_string()], - &[], Some(true), "default", ) @@ -917,36 +914,6 @@ async fn explicit_provider_name_errors_for_unrecognised_name() { ); } -/// Inferred types (from the trailing command) that don't exist should be -/// auto-created, preserving the existing behaviour. -#[tokio::test] -async fn inferred_type_auto_creates_provider() { - let ts = run_server().await; - let _guard = EnvVarGuard::set(&[("ANTHROPIC_API_KEY", "sk-ant-test")]); - - let mut client = openshell_cli::tls::grpc_client(&ts.endpoint, &ts.tls) - .await - .expect("grpc client"); - - let result = run::ensure_required_providers( - &mut client, - &[], - &["claude-code".to_string()], - Some(true), // --auto-providers - "default", - ) - .await - .expect("should auto-create the inferred provider"); - - assert_eq!(result, vec!["claude-code".to_string()]); - - let providers = ts.openshell.state.providers.lock().await; - let provider = providers - .get("claude-code") - .expect("claude-code provider should exist"); - assert_eq!(provider.r#type, "claude-code"); -} - /// When `--no-auto-providers` is set, missing explicit providers that would /// otherwise be auto-created should be silently skipped. #[tokio::test] @@ -961,7 +928,6 @@ async fn no_auto_providers_skips_missing_explicit_provider() { let result = run::ensure_required_providers( &mut client, &["nvidia".to_string()], - &[], Some(false), // --no-auto-providers "default", ) @@ -980,10 +946,9 @@ async fn no_auto_providers_skips_missing_explicit_provider() { ); } -/// Both explicit names and inferred types should be resolved together, -/// deduplicating providers that appear in both lists. +/// Several explicit providers are all resolved and created. #[tokio::test] -async fn explicit_and_inferred_providers_combined() { +async fn multiple_explicit_providers_combined() { let ts = run_server().await; let _guard = EnvVarGuard::set(&[ ("NVIDIA_API_KEY", "nvapi-combo"), @@ -996,8 +961,7 @@ async fn explicit_and_inferred_providers_combined() { let result = run::ensure_required_providers( &mut client, - &["nvidia".to_string()], - &["claude-code".to_string()], + &["nvidia".to_string(), "claude-code".to_string()], Some(true), "default", ) @@ -1014,10 +978,9 @@ async fn explicit_and_inferred_providers_combined() { assert!(providers.contains_key("claude-code")); } -/// When an explicit provider name matches an inferred type, the provider -/// should only appear once in the result. +/// A provider named twice appears only once in the result. #[tokio::test] -async fn explicit_and_inferred_deduplicates() { +async fn repeated_explicit_provider_deduplicates() { let ts = run_server().await; let _guard = EnvVarGuard::set(&[("NVIDIA_API_KEY", "nvapi-dedup")]); @@ -1025,11 +988,9 @@ async fn explicit_and_inferred_deduplicates() { .await .expect("grpc client"); - // Both explicit and inferred want "nvidia". let result = run::ensure_required_providers( &mut client, - &["nvidia".to_string()], - &["nvidia".to_string()], + &["nvidia".to_string(), "nvidia".to_string()], Some(true), "default", ) diff --git a/crates/openshell-cli/tests/helpers/mod.rs b/crates/openshell-cli/tests/helpers/mod.rs index e37b84a7b9..9c446a1b56 100644 --- a/crates/openshell-cli/tests/helpers/mod.rs +++ b/crates/openshell-cli/tests/helpers/mod.rs @@ -8,6 +8,20 @@ //! mod helpers; //! ``` +/// The example provider profiles in `providers/`, parsed once per test binary. +/// +/// Fake gateways serve these the way a real gateway serves what an operator +/// imported. Nothing is compiled into the CLI, so the fixtures come from the +/// same files the documentation tells operators to import. +#[allow(dead_code)] +pub fn example_profiles() -> &'static [openshell_providers::ProviderTypeProfile] { + static CATALOG: std::sync::OnceLock> = + std::sync::OnceLock::new(); + CATALOG + .get_or_init(openshell_providers::example_profiles::load_all) + .as_slice() +} + #[macro_export] macro_rules! unimplemented_sandbox_template_rpcs { () => { diff --git a/crates/openshell-cli/tests/provider_commands_integration.rs b/crates/openshell-cli/tests/provider_commands_integration.rs index 182c46d3e6..a8b4579287 100644 --- a/crates/openshell-cli/tests/provider_commands_integration.rs +++ b/crates/openshell-cli/tests/provider_commands_integration.rs @@ -676,7 +676,7 @@ impl OpenShell for TestOpenShell { .provider .ok_or_else(|| Status::invalid_argument("provider is required"))?; if provider.credentials.is_empty() && provider.credential_handles.is_empty() { - let bootstrap_allowed = if let Some(profile) = openshell_providers::builtin_profiles() + let bootstrap_allowed = if let Some(profile) = helpers::example_profiles() .iter() .find(|p| p.id.eq_ignore_ascii_case(&provider.r#type)) { @@ -760,7 +760,7 @@ impl OpenShell for TestOpenShell { &self, _request: tonic::Request, ) -> Result, Status> { - let mut profiles = openshell_providers::builtin_profiles() + let mut profiles = helpers::example_profiles() .iter() .map(openshell_providers::ProviderTypeProfile::to_proto) .collect::>(); @@ -803,7 +803,7 @@ impl OpenShell for TestOpenShell { .cloned(); let profile = if let Some(profile) = scoped_profile { profile - } else if let Some(profile) = openshell_providers::builtin_profiles() + } else if let Some(profile) = helpers::example_profiles() .iter() .find(|profile| profile.id == id) { @@ -2173,7 +2173,7 @@ async fn provider_profile_permission_denial_preserves_safe_workspace_guidance() seed_readiness_provider(&server).await; for (profile, failed_lookup, expected_lookups) in [ ("openai", "openai", vec!["openai"]), - ("gh", "github", vec!["gh", "github"]), + ("github", "github", vec!["github"]), ] { server .state @@ -2260,12 +2260,12 @@ async fn provider_profile_permission_denial_preserves_safe_workspace_guidance() } #[tokio::test] -async fn provider_readiness_update_redacts_exact_and_alias_profile_lookup_errors() { +async fn provider_readiness_update_redacts_exact_profile_lookup_errors() { let server = run_server().await; seed_readiness_provider(&server).await; for (profile, failed_lookup, expected_lookups) in [ ("openai", "openai", vec!["openai"]), - ("gh", "github", vec!["gh", "github"]), + ("github", "github", vec!["github"]), ] { server .state @@ -3191,7 +3191,7 @@ async fn provider_update_preserves_stored_type_and_profile_workspace_when_readab run::provider_create( &ts.endpoint, "my-claude", - "claude", + "claude-code", false, &["API_KEY=abc".to_string()], false, @@ -3293,7 +3293,7 @@ async fn provider_cli_run_functions_support_full_crud_flow() { run::provider_create( &ts.endpoint, "my-claude", - "claude", + "claude-code", false, &["API_KEY=abc".to_string()], false, @@ -4642,7 +4642,7 @@ async fn provider_create_rejects_key_only_credentials_without_local_env_value() let err = run::provider_create( &ts.endpoint, "bad-provider", - "claude", + "claude-code", false, &["INVALID_PAIR".to_string()], false, @@ -4756,7 +4756,7 @@ async fn provider_create_rejects_combined_from_existing_and_credentials() { let err = run::provider_create( &ts.endpoint, "bad-provider", - "claude", + "claude-code", true, &["API_KEY=abc".to_string()], false, diff --git a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs index 1739c3a4c2..5a5e00accb 100644 --- a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs +++ b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs @@ -59,6 +59,9 @@ fn selected_workspace( #[derive(Clone, Default)] struct SandboxState { + /// Make `ListProviderProfiles` fail while every other RPC keeps working, + /// so a catalog lookup failure can be told apart from an empty catalog. + fail_list_provider_profiles: Arc, deleted_names: Arc>>>, create_requests: Arc>>, fail_delete_sandbox_message: Arc>>, @@ -494,7 +497,14 @@ impl OpenShell for TestOpenShell { &self, _request: tonic::Request, ) -> Result, Status> { - let profiles = openshell_providers::builtin_profiles() + if self + .state + .fail_list_provider_profiles + .load(Ordering::SeqCst) + { + return Err(Status::unavailable("profile catalog is unavailable")); + } + let profiles = helpers::example_profiles() .iter() .map(openshell_providers::ProviderTypeProfile::to_proto) .collect(); @@ -511,7 +521,7 @@ impl OpenShell for TestOpenShell { request: tonic::Request, ) -> Result, Status> { let id = request.into_inner().id; - let profile = openshell_providers::builtin_profiles() + let profile = helpers::example_profiles() .iter() .find(|profile| profile.id == id) .ok_or_else(|| Status::not_found("provider profile not found"))? @@ -1526,6 +1536,50 @@ async fn sandbox_delete_continues_after_entry_failure() { ); } +#[tokio::test] +async fn sandbox_create_tolerates_an_unreachable_profile_catalog() { + // The catalog's only consumer is the advisory credential warning, so a + // failed lookup degrades that warning instead of blocking creation. + // Nothing derives provider authority from it: a provider is attached only + // when the user names one. + let server = run_server().await; + let fake_ssh_dir = tempfile::tempdir().unwrap(); + let xdg_dir = tempfile::tempdir().unwrap(); + let _env = test_env(&fake_ssh_dir, &xdg_dir); + let tls = test_tls(&server); + install_fake_ssh(&fake_ssh_dir); + + server + .openshell + .state + .fail_list_provider_profiles + .store(true, Ordering::SeqCst); + + run::sandbox_create( + &server.endpoint, + "openshell", + run::SandboxCreateConfig { + name: Some("catalog-unavailable"), + command: &["claude".into()], + ..test_config() + }, + "default", + &tls, + ) + .await + .expect("an unreachable catalog must not block sandbox creation"); + + let requests = server.openshell.state.create_requests.lock().await; + assert_eq!(requests.len(), 1, "the sandbox should still be created"); + assert!( + requests[0] + .spec + .as_ref() + .is_none_or(|spec| spec.providers.is_empty()), + "no provider should be attached without an explicit --provider" + ); +} + #[tokio::test] async fn sandbox_create_keeps_command_sessions_by_default() { let server = run_server().await; @@ -1892,6 +1946,7 @@ async fn sandbox_template_create_sends_non_default_workspace_in_scope_and_metada "table", "team-a", &tls, + true, ) .await .expect("template create should succeed"); @@ -2013,6 +2068,7 @@ async fn sandbox_template_create_allows_omitted_image() { "table", "default", &tls, + true, ) .await .expect("template create without image should succeed"); diff --git a/crates/openshell-core/src/config.rs b/crates/openshell-core/src/config.rs index cb65490e85..3d8b6eda8b 100644 --- a/crates/openshell-core/src/config.rs +++ b/crates/openshell-core/src/config.rs @@ -3,7 +3,7 @@ //! Configuration management for `OpenShell` components. -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Deserializer, Serialize, de}; use std::borrow::Cow; use std::collections::BTreeMap; use std::fmt; @@ -473,17 +473,46 @@ pub enum GatewayInterceptorBindingPolicy { } /// One configured source in the gateway's effective provider-profile catalog. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +/// +/// Deserialization is hand-written so that the removed `builtin` source is +/// recognized and rejected with the migration step, rather than reported as an +/// unknown variant. +#[derive(Debug, Clone, Serialize, PartialEq, Eq)] #[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)] pub enum GatewayProviderProfileSourceConfig { - /// Profiles bundled with the `OpenShell` build. - Builtin, /// Profiles managed through the provider profile mutation APIs. User, /// Profiles vended by a configured gateway interceptor instance. Interceptor { name: String }, } +pub(crate) const BUILTIN_PROFILE_SOURCE_REMOVED: &str = "provider profile source type \"builtin\" was removed: provider profiles are import-only. \ + Remove the entry and import the profiles this gateway needs with \ + 'openshell provider profile import --from providers --global'"; + +impl<'de> Deserialize<'de> for GatewayProviderProfileSourceConfig { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + /// Mirrors the public shape, plus the retired `builtin` tag so it can be + /// named in the error instead of surfacing as an unknown variant. + #[derive(Deserialize)] + #[serde(tag = "type", rename_all = "snake_case", deny_unknown_fields)] + enum Shadow { + Builtin, + User, + Interceptor { name: String }, + } + + match Shadow::deserialize(deserializer)? { + Shadow::Builtin => Err(de::Error::custom(BUILTIN_PROFILE_SOURCE_REMOVED)), + Shadow::User => Ok(Self::User), + Shadow::Interceptor { name } => Ok(Self::Interceptor { name }), + } + } +} + /// Failure behavior when an interceptor evaluation cannot produce a valid /// result. #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] @@ -678,10 +707,10 @@ impl Serialize for AppArmorProfile { impl<'de> Deserialize<'de> for AppArmorProfile { fn deserialize(deserializer: D) -> Result where - D: serde::Deserializer<'de>, + D: Deserializer<'de>, { let value = String::deserialize(deserializer)?; - Self::from_str(&value).map_err(serde::de::Error::custom) + Self::from_str(&value).map_err(de::Error::custom) } } @@ -814,10 +843,7 @@ impl Config { oidc: None, auth: GatewayAuthConfig::default(), gateway_interceptors: Vec::new(), - provider_profile_sources: vec![ - GatewayProviderProfileSourceConfig::Builtin, - GatewayProviderProfileSourceConfig::User, - ], + provider_profile_sources: vec![GatewayProviderProfileSourceConfig::User], mtls_auth: MtlsAuthConfig::default(), gateway_jwt: None, database_url: String::new(), @@ -1124,14 +1150,42 @@ mod tests { } #[test] - fn config_defaults_to_builtin_and_user_provider_profile_sources() { + fn config_defaults_to_the_user_provider_profile_source() { let cfg = Config::new(None); assert_eq!( cfg.provider_profile_sources, - vec![ - GatewayProviderProfileSourceConfig::Builtin, - GatewayProviderProfileSourceConfig::User, - ] + vec![GatewayProviderProfileSourceConfig::User] + ); + } + + #[test] + fn builtin_provider_profile_source_is_rejected_with_the_import_step() { + let error = + serde_json::from_str::(r#"{"type":"builtin"}"#) + .expect_err("the builtin source was removed"); + let message = error.to_string(); + assert!(message.contains("import-only"), "{message}"); + assert!( + message.contains("openshell provider profile import"), + "{message}" + ); + } + + #[test] + fn user_and_interceptor_provider_profile_sources_still_parse() { + assert_eq!( + serde_json::from_str::(r#"{"type":"user"}"#) + .unwrap(), + GatewayProviderProfileSourceConfig::User + ); + assert_eq!( + serde_json::from_str::( + r#"{"type":"interceptor","name":"governance"}"# + ) + .unwrap(), + GatewayProviderProfileSourceConfig::Interceptor { + name: "governance".to_string() + } ); } diff --git a/crates/openshell-providers/Cargo.toml b/crates/openshell-providers/Cargo.toml index 89a00bd47c..f66b0164d1 100644 --- a/crates/openshell-providers/Cargo.toml +++ b/crates/openshell-providers/Cargo.toml @@ -10,6 +10,12 @@ rust-version.workspace = true license.workspace = true repository.workspace = true +[features] +default = [] +# Test-only access to the example profiles in `providers/`. Enable it from +# `[dev-dependencies]` only; it reads the source checkout at run time. +example-profiles = [] + [dependencies] prost-types = { workspace = true } glob = { workspace = true } diff --git a/crates/openshell-providers/src/example_profiles.rs b/crates/openshell-providers/src/example_profiles.rs new file mode 100644 index 0000000000..596f643260 --- /dev/null +++ b/crates/openshell-providers/src/example_profiles.rs @@ -0,0 +1,90 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +//! Test-only access to the example provider profiles in `providers/`. +//! +//! `OpenShell` does not compile any provider profile into a release binary. The +//! YAML under `providers/` is reviewable example data that an operator imports +//! explicitly with `openshell provider profile import`. +//! +//! Tests still need those files: they are the fixtures that keep the examples +//! honest, and they stand in for "what an operator imported" in gateway and CLI +//! tests. This module reads them from the source checkout at run time, so it +//! works only where the repository is present. It is gated behind the +//! `example-profiles` feature, which is enabled from `[dev-dependencies]` only. + +use std::path::{Path, PathBuf}; + +use crate::profiles::{ + ProfileError, ProviderTypeProfile, parse_profile_catalog_yamls, parse_profile_yaml, +}; + +/// Absolute path of the repository's `providers/` directory. +#[must_use] +pub fn directory() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../../providers") +} + +/// Absolute path of one example profile file. +#[must_use] +pub fn path(id: &str) -> PathBuf { + directory().join(format!("{id}.yaml")) +} + +/// Parse a single example profile by its file stem. +/// +/// # Panics +/// +/// Panics if the file is missing or does not parse. Both are bugs in the +/// checkout, not conditions a caller can handle. +#[must_use] +pub fn load(id: &str) -> ProviderTypeProfile { + let file = path(id); + let yaml = std::fs::read_to_string(&file) + .unwrap_or_else(|err| panic!("read example provider profile {}: {err}", file.display())); + parse_profile_yaml(&yaml) + .unwrap_or_else(|err| panic!("parse example provider profile {}: {err}", file.display())) +} + +/// Parse every example profile as one validated, id-sorted catalog. +/// +/// # Panics +/// +/// Panics if `providers/` cannot be read or the set fails validation. +#[must_use] +pub fn load_all() -> Vec { + try_load_all().unwrap_or_else(|err| panic!("load example provider profiles: {err}")) +} + +/// Fallible form of [`load_all`], for tests that assert on validation failure. +/// +/// # Errors +/// +/// Returns the first parse or validation error in the example set. +/// +/// # Panics +/// +/// Panics if `providers/` cannot be listed. +pub fn try_load_all() -> Result, ProfileError> { + let dir = directory(); + let mut files = std::fs::read_dir(&dir) + .unwrap_or_else(|err| panic!("read directory {}: {err}", dir.display())) + .map(|entry| { + entry + .unwrap_or_else(|err| panic!("read directory entry in {}: {err}", dir.display())) + .path() + }) + .filter(|path| path.extension().is_some_and(|ext| ext == "yaml")) + .collect::>(); + files.sort(); + + let yamls = files + .iter() + .map(|file| { + std::fs::read_to_string(file) + .unwrap_or_else(|err| panic!("read {}: {err}", file.display())) + }) + .collect::>(); + let inputs = yamls.iter().map(String::as_str).collect::>(); + parse_profile_catalog_yamls(&inputs) +} diff --git a/crates/openshell-providers/src/lib.rs b/crates/openshell-providers/src/lib.rs index 8b9f0d3132..87ac5d8007 100644 --- a/crates/openshell-providers/src/lib.rs +++ b/crates/openshell-providers/src/lib.rs @@ -5,13 +5,14 @@ mod context; mod discovery; +#[cfg(any(test, feature = "example-profiles"))] +pub mod example_profiles; mod profiles; mod providers; #[cfg(test)] mod test_helpers; use std::collections::HashMap; -use std::path::Path; pub use openshell_core::proto::Provider; @@ -19,9 +20,9 @@ pub use context::{DiscoveryContext, RealDiscoveryContext}; pub use discovery::{discover_from_profile, discover_with_spec}; pub use profiles::{ CredentialRefreshProfile, ProfileError, ProfileValidationDiagnostic, ProviderTypeProfile, - builtin_profiles, is_gateway_mintable_strategy, normalize_profile_id, parse_profile_json, - parse_profile_yaml, profile_to_json, profile_to_yaml, profiles_to_json, profiles_to_yaml, - strategy_output_env_key, strategy_output_spec, strategy_primary_env_key, validate_profile_set, + is_gateway_mintable_strategy, normalize_profile_id, parse_profile_json, parse_profile_yaml, + profile_to_json, profile_to_yaml, profiles_to_json, profiles_to_yaml, strategy_output_env_key, + strategy_output_spec, strategy_primary_env_key, validate_profile_set, }; pub const VERTEX_AI_PROJECT_ID_KEY: &str = "VERTEX_AI_PROJECT_ID"; @@ -107,23 +108,11 @@ impl ProviderRegistry { self.plugins.get(id).map(Box::as_ref) } - /// Inject provider-specific env vars via the registered plugin. + /// Inject provider-specific config for a resolved profile ID. /// - /// Normalizes the provider type and delegates to the plugin's `inject_env`. - /// No-op if the provider type has no registered plugin or the plugin's - /// default implementation is a no-op. - pub fn inject_env(&self, provider: &Provider, env: &mut HashMap) { - let normalized = normalize_provider_type(&provider.r#type); - if let Some(id) = normalized - && let Some(plugin) = self.get(id) - { - plugin.inject_env(provider, env); - } - } - - /// Inject config for an already-resolved profile ID without alias - /// normalization. This prevents an exact custom profile whose ID resembles - /// a legacy alias from selecting an unrelated built-in compatibility plugin. + /// Plugins are selected by the exact ID of the profile the gateway + /// resolved. There is no alias table: a profile activates the plugin whose + /// ID it matches, and nothing else does. pub fn inject_env_for_profile_id( &self, provider: &Provider, @@ -135,95 +124,3 @@ impl ProviderRegistry { } } } - -#[must_use] -pub fn normalize_provider_type(input: &str) -> Option<&'static str> { - let normalized = input.trim().to_ascii_lowercase(); - match normalized.as_str() { - "openai" => Some("openai"), - "anthropic" => Some("anthropic"), - "nvidia" => Some("nvidia"), - "deepinfra" => Some("deepinfra"), - "aws-bedrock" => Some("aws-bedrock"), - "google-vertex-ai" | "vertex" | "vertex-ai" | "google-vertex" | "gcp-vertex" => { - Some("google-vertex-ai") - } - "claude" | "claude-code" | "claude_code" => Some("claude-code"), - "codex" => Some("codex"), - "copilot" => Some("copilot"), - "gcp" | "google-cloud" => Some("google-cloud"), - "github" | "gh" => Some("github"), - _ => None, - } -} - -#[must_use] -pub fn detect_provider_from_command(command: &[String]) -> Option<&'static str> { - let first = command.first()?; - let basename = Path::new(first) - .file_name() - .and_then(|name| name.to_str()) - .unwrap_or(first); - normalize_provider_type(basename) -} - -#[cfg(test)] -mod tests { - use super::{detect_provider_from_command, normalize_provider_type}; - - #[test] - fn normalizes_known_provider_aliases() { - assert_eq!(normalize_provider_type("gh"), Some("github")); - assert_eq!(normalize_provider_type("CLAUDE"), Some("claude-code")); - assert_eq!(normalize_provider_type("claude-code"), Some("claude-code")); - for retired in ["generic", "gitlab", "glab", "opencode", "outlook"] { - assert_eq!(normalize_provider_type(retired), None); - } - assert_eq!(normalize_provider_type("openai"), Some("openai")); - assert_eq!(normalize_provider_type("anthropic"), Some("anthropic")); - assert_eq!(normalize_provider_type("nvidia"), Some("nvidia")); - assert_eq!(normalize_provider_type("deepinfra"), Some("deepinfra")); - assert_eq!(normalize_provider_type("aws-bedrock"), Some("aws-bedrock")); - assert_eq!(normalize_provider_type("copilot"), Some("copilot")); - for alias in [ - "google-vertex-ai", - "vertex", - "vertex-ai", - "google-vertex", - "gcp-vertex", - ] { - assert_eq!(normalize_provider_type(alias), Some("google-vertex-ai")); - } - assert_eq!(normalize_provider_type("unknown"), None); - } - - #[test] - fn detects_provider_from_command_token() { - assert_eq!( - detect_provider_from_command(&["claude".to_string()]), - Some("claude-code") - ); - assert_eq!( - detect_provider_from_command(&["/usr/bin/glab".to_string()]), - None - ); - assert_eq!( - detect_provider_from_command(&["/usr/bin/bash".to_string()]), - None - ); - // Copilot standalone binary - assert_eq!( - detect_provider_from_command(&["copilot".to_string()]), - Some("copilot") - ); - assert_eq!( - detect_provider_from_command(&["/usr/local/bin/copilot".to_string()]), - Some("copilot") - ); - // gh alone still maps to github - assert_eq!( - detect_provider_from_command(&["gh".to_string()]), - Some("github") - ); - } -} diff --git a/crates/openshell-providers/src/profiles.rs b/crates/openshell-providers/src/profiles.rs index 1ef224bd09..a9d37808e9 100644 --- a/crates/openshell-providers/src/profiles.rs +++ b/crates/openshell-providers/src/profiles.rs @@ -20,29 +20,10 @@ use openshell_policy::{ use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use std::collections::{BTreeSet, HashMap, HashSet}; use std::net::IpAddr; -use std::sync::OnceLock; const PATH_TEMPLATE_CREDENTIAL_PLACEHOLDER: &str = "{credential}"; const MCP_VERSION_REMEDIATION: &str = "omit mcp.versions to use the pinned default revision; use an exact supported revision; or omit protocol and mcp for deliberate uninspected L4 passthrough only when that weaker boundary is acceptable"; -const BUILT_IN_PROFILE_YAMLS: &[&str] = &[ - include_str!("../../../providers/aws.yaml"), - include_str!("../../../providers/aws-bedrock.yaml"), - include_str!("../../../providers/aws-s3.yaml"), - include_str!("../../../providers/anthropic.yaml"), - include_str!("../../../providers/claude-code.yaml"), - include_str!("../../../providers/codex.yaml"), - include_str!("../../../providers/copilot.yaml"), - include_str!("../../../providers/cursor.yaml"), - include_str!("../../../providers/deepinfra.yaml"), - include_str!("../../../providers/github.yaml"), - include_str!("../../../providers/google-cloud.yaml"), - include_str!("../../../providers/google-vertex-ai.yaml"), - include_str!("../../../providers/nvidia.yaml"), - include_str!("../../../providers/openai.yaml"), - include_str!("../../../providers/pypi.yaml"), -]; - #[derive(Debug, thiserror::Error)] pub enum ProfileError { #[error("failed to parse provider profile YAML: {0}")] @@ -1933,6 +1914,14 @@ pub fn profiles_to_json(profiles: &[ProviderTypeProfile]) -> Result Result, ProfileError> { @@ -1945,10 +1934,12 @@ pub fn parse_profile_catalog_yamls( Ok(profiles) } +#[cfg(any(test, feature = "example-profiles"))] fn is_mcp_diagnostic_field(field: &str) -> bool { field.split('.').any(|segment| segment == "mcp") } +#[cfg(any(test, feature = "example-profiles"))] fn validate_profiles(profiles: &[ProviderTypeProfile]) -> Result<(), ProfileError> { let diagnostics = validate_profile_set( &profiles @@ -3454,18 +3445,6 @@ fn is_kubernetes_service_host(host: &str) -> bool { (is_service_name || is_cluster_local_service) && labels.iter().all(|label| !label.is_empty()) } -static BUILTIN_PROFILES: OnceLock> = OnceLock::new(); - -#[must_use] -pub fn builtin_profiles() -> &'static [ProviderTypeProfile] { - BUILTIN_PROFILES - .get_or_init(|| { - parse_profile_catalog_yamls(BUILT_IN_PROFILE_YAMLS) - .expect("built-in provider profiles must be valid YAML") - }) - .as_slice() -} - #[cfg(test)] mod tests { use std::collections::HashMap; @@ -3475,18 +3454,30 @@ mod tests { use super::{ DiscoveryProfile, EndpointProfile, L7AllowProfile, L7QueryMatcherProfile, - ProfileDurationWkt, ProfileError, ProviderTypeProfile, builtin_profiles, - is_mcp_diagnostic_field, normalize_profile_id, parse_profile_catalog_yamls, - parse_profile_json, parse_profile_yaml, profile_duration_to_proto, profile_to_json, - profile_to_yaml, profiles_to_json, profiles_to_yaml, token_grant_from_proto, - token_grant_to_proto, validate_profile_duration, validate_profile_set, + ProfileDurationWkt, ProfileError, ProviderTypeProfile, is_mcp_diagnostic_field, + normalize_profile_id, parse_profile_catalog_yamls, parse_profile_json, parse_profile_yaml, + profile_duration_to_proto, profile_to_json, profile_to_yaml, profiles_to_json, + profiles_to_yaml, token_grant_from_proto, token_grant_to_proto, validate_profile_duration, + validate_profile_set, }; - fn builtin_profile(id: &str) -> &'static ProviderTypeProfile { - builtin_profiles() + /// The example profiles in `providers/`, parsed once per test binary. + /// + /// These files are reviewable examples an operator imports, not platform + /// data, so the tests below are golden tests over their content rather than + /// assertions about anything the gateway ships. + fn example_catalog() -> &'static [ProviderTypeProfile] { + static CATALOG: std::sync::OnceLock> = std::sync::OnceLock::new(); + CATALOG + .get_or_init(crate::example_profiles::load_all) + .as_slice() + } + + fn example_profile(id: &str) -> &'static ProviderTypeProfile { + example_catalog() .iter() .find(|profile| profile.id == id) - .unwrap_or_else(|| panic!("built-in profile {id} should exist")) + .unwrap_or_else(|| panic!("example profile {id} should exist")) } #[test] @@ -3645,7 +3636,7 @@ credentials: .collect(), }; for id in ["codex", "claude-code", "copilot"] { - let profile = builtin_profile(id); + let profile = example_profile(id); let model_key = profile.credential_env_vars()[0].to_owned(); let state = ProviderCredentialState::from_bound_environment( 42, @@ -3656,7 +3647,7 @@ credentials: HashMap::new(), HashMap::new(), HashMap::from([ - ("GITHUB_TOKEN".into(), binding(builtin_profile("github"))), + ("GITHUB_TOKEN".into(), binding(example_profile("github"))), (model_key.clone(), binding(profile)), ]), vec![], @@ -3695,19 +3686,40 @@ credentials: } #[test] - fn builtin_profiles_are_sorted_by_id() { - let ids = builtin_profiles() + fn example_profiles_parse_and_validate_as_one_catalog() { + let profiles = example_catalog(); + assert!( + !profiles.is_empty(), + "providers/ should contain example profiles" + ); + + let ids = profiles .iter() .map(|profile| profile.id.as_str()) .collect::>(); let mut sorted = ids.clone(); sorted.sort_unstable(); assert_eq!(ids, sorted); + + let diagnostics = validate_profile_set( + &profiles + .iter() + .map(|profile| (String::new(), profile.clone())) + .collect::>(), + ); + let errors = diagnostics + .iter() + .filter(|diagnostic| diagnostic.severity == "error") + .collect::>(); + assert!( + errors.is_empty(), + "example profiles must lint clean: {errors:?}" + ); } #[test] fn github_profile_materializes_policy_metadata() { - let profile = builtin_profile("github"); + let profile = example_profile("github"); let proto = profile.to_proto(); assert_eq!(proto.id, "github"); @@ -3743,7 +3755,7 @@ credentials: #[test] fn github_git_transport_allows_clone_but_not_push() { - let profile = builtin_profile("github"); + let profile = example_profile("github"); let proto = profile.to_proto(); let git_transport = proto @@ -3803,7 +3815,7 @@ credentials: #[test] fn credential_env_vars_are_deduplicated_in_profile_order() { - let profile = builtin_profile("claude-code"); + let profile = example_profile("claude-code"); assert_eq!( profile.credential_env_vars(), vec!["ANTHROPIC_API_KEY", "CLAUDE_API_KEY"] @@ -3837,7 +3849,7 @@ credentials: #[test] fn vertex_profile_declares_discovery_and_fallback_token_env_vars() { - let profile = builtin_profile("google-vertex-ai"); + let profile = example_profile("google-vertex-ai"); let service_account_token = profile .credentials .iter() @@ -3951,13 +3963,13 @@ endpoints: #[test] fn adc_credential_returns_oauth2_refresh_token_credential_with_adc_material() { - let profile = builtin_profile("google-cloud"); + let profile = example_profile("google-cloud"); let adc = profile .adc_credential() .expect("google-cloud should have an ADC credential"); assert_eq!(adc.env_vars[0], "GCP_ADC_ACCESS_TOKEN"); - let profile = builtin_profile("google-vertex-ai"); + let profile = example_profile("google-vertex-ai"); let adc = profile .adc_credential() .expect("vertex should have an ADC credential"); @@ -3966,10 +3978,10 @@ endpoints: #[test] fn adc_credential_returns_none_for_profiles_without_adc() { - let profile = builtin_profile("github"); + let profile = example_profile("github"); assert!(profile.adc_credential().is_none()); - let profile = builtin_profile("claude-code"); + let profile = example_profile("claude-code"); assert!(profile.adc_credential().is_none()); } @@ -5417,7 +5429,7 @@ endpoints: #[test] fn profile_json_round_trip_preserves_compact_dto_shape() { - let profile = builtin_profile("github"); + let profile = example_profile("github"); let json = profile_to_json(profile).expect("profile should serialize"); let parsed = parse_profile_json(&json).expect("profile should parse"); @@ -5874,7 +5886,7 @@ binaries: #[test] fn aws_profile_parses_correctly() { - let aws = builtin_profile("aws"); + let aws = example_profile("aws"); assert_eq!(aws.display_name, "AWS"); assert_eq!(aws.credentials.len(), 3); let access_key = aws @@ -5898,7 +5910,7 @@ binaries: #[test] fn aws_s3_profile_parses_with_endpoints() { - let aws_s3 = builtin_profile("aws-s3"); + let aws_s3 = example_profile("aws-s3"); assert_eq!(aws_s3.display_name, "AWS S3"); assert!(!aws_s3.endpoints.is_empty()); assert!( @@ -5948,7 +5960,7 @@ binaries: #[test] fn aws_profile_declares_additional_outputs() { for id in ["aws", "aws-s3"] { - let profile = builtin_profile(id); + let profile = example_profile(id); let refresh = profile .credentials .iter() @@ -5977,7 +5989,7 @@ binaries: // required credentials are runtime-resolvable, so `--runtime-credentials` // (empty provider creation) is allowed. for id in ["aws", "aws-s3"] { - let profile = builtin_profile(id); + let profile = example_profile(id); assert!( profile.allows_empty_provider_credentials(), "{id} should allow empty provider credentials" diff --git a/crates/openshell-providers/src/providers/anthropic.rs b/crates/openshell-providers/src/providers/anthropic.rs deleted file mode 100644 index 8e392d457d..0000000000 --- a/crates/openshell-providers/src/providers/anthropic.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "anthropic", - credential_env_vars: &["ANTHROPIC_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_anthropic_env_credentials, - "ANTHROPIC_API_KEY", - "sk-ant-test" -); diff --git a/crates/openshell-providers/src/providers/claude.rs b/crates/openshell-providers/src/providers/claude.rs deleted file mode 100644 index ec8457a811..0000000000 --- a/crates/openshell-providers/src/providers/claude.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "claude-code", - credential_env_vars: &["ANTHROPIC_API_KEY", "CLAUDE_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_claude_env_credentials, - "ANTHROPIC_API_KEY", - "test-key" -); diff --git a/crates/openshell-providers/src/providers/codex.rs b/crates/openshell-providers/src/providers/codex.rs deleted file mode 100644 index a75f35a896..0000000000 --- a/crates/openshell-providers/src/providers/codex.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "codex", - credential_env_vars: &["OPENAI_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_codex_env_credentials, - "OPENAI_API_KEY", - "openai-key" -); diff --git a/crates/openshell-providers/src/providers/copilot.rs b/crates/openshell-providers/src/providers/copilot.rs deleted file mode 100644 index 0facde6179..0000000000 --- a/crates/openshell-providers/src/providers/copilot.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "copilot", - credential_env_vars: &["COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"], -}; - -test_discovers_env_credential!( - discovers_copilot_env_credentials, - "COPILOT_GITHUB_TOKEN", - "ghp-copilot-token" -); diff --git a/crates/openshell-providers/src/providers/deepinfra.rs b/crates/openshell-providers/src/providers/deepinfra.rs deleted file mode 100644 index 6d1f3f5ba3..0000000000 --- a/crates/openshell-providers/src/providers/deepinfra.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "deepinfra", - credential_env_vars: &["DEEPINFRA_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_deepinfra_env_credentials, - "DEEPINFRA_API_KEY", - "di-test-123" -); diff --git a/crates/openshell-providers/src/providers/generic.rs b/crates/openshell-providers/src/providers/generic.rs deleted file mode 100644 index 137140d71b..0000000000 --- a/crates/openshell-providers/src/providers/generic.rs +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::{DiscoveredProvider, ProviderError, ProviderPlugin}; - -pub struct GenericProvider; - -impl ProviderPlugin for GenericProvider { - fn id(&self) -> &'static str { - "generic" - } - - fn discover_existing(&self) -> Result, ProviderError> { - Ok(None) - } -} - -#[cfg(test)] -mod tests { - use super::GenericProvider; - use crate::ProviderPlugin; - - #[test] - fn generic_provider_discovery_is_empty_by_default() { - let provider = GenericProvider; - let discovered = provider.discover_existing().expect("discovery"); - assert!(discovered.is_none()); - } -} diff --git a/crates/openshell-providers/src/providers/github.rs b/crates/openshell-providers/src/providers/github.rs deleted file mode 100644 index 8e14aa3637..0000000000 --- a/crates/openshell-providers/src/providers/github.rs +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "github", - credential_env_vars: &["GITHUB_TOKEN", "GH_TOKEN"], -}; - -test_discovers_env_credential!(discovers_github_env_credentials, "GH_TOKEN", "gh-token"); diff --git a/crates/openshell-providers/src/providers/gitlab.rs b/crates/openshell-providers/src/providers/gitlab.rs deleted file mode 100644 index 8fc4973a4f..0000000000 --- a/crates/openshell-providers/src/providers/gitlab.rs +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "gitlab", - credential_env_vars: &["GITLAB_TOKEN", "GLAB_TOKEN", "CI_JOB_TOKEN"], -}; - -test_discovers_env_credential!(discovers_gitlab_env_credentials, "GLAB_TOKEN", "glab-token"); diff --git a/crates/openshell-providers/src/providers/nvidia.rs b/crates/openshell-providers/src/providers/nvidia.rs deleted file mode 100644 index 463d5b2cfb..0000000000 --- a/crates/openshell-providers/src/providers/nvidia.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "nvidia", - credential_env_vars: &["NVIDIA_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_nvidia_env_credentials, - "NVIDIA_API_KEY", - "nvapi-123" -); diff --git a/crates/openshell-providers/src/providers/openai.rs b/crates/openshell-providers/src/providers/openai.rs deleted file mode 100644 index 92d8817ebe..0000000000 --- a/crates/openshell-providers/src/providers/openai.rs +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::ProviderDiscoverySpec; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "openai", - credential_env_vars: &["OPENAI_API_KEY"], -}; - -test_discovers_env_credential!( - discovers_openai_env_credentials, - "OPENAI_API_KEY", - "sk-openai-test" -); diff --git a/crates/openshell-providers/src/providers/opencode.rs b/crates/openshell-providers/src/providers/opencode.rs deleted file mode 100644 index feb707fd08..0000000000 --- a/crates/openshell-providers/src/providers/opencode.rs +++ /dev/null @@ -1,174 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use std::collections::HashMap; -use std::path::{Path, PathBuf}; - -use crate::{ - DiscoveredProvider, ProviderDiscoverySpec, ProviderError, ProviderPlugin, RealDiscoveryContext, - discover_with_spec, -}; - -pub struct OpencodeProvider; - -pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { - id: "opencode", - credential_env_vars: &["OPENCODE_API_KEY", "OPENROUTER_API_KEY", "OPENAI_API_KEY"], -}; - -/// Return the path to the opencode config file, respecting `XDG_CONFIG_HOME`. -fn opencode_config_path() -> Option { - let config_home = std::env::var("XDG_CONFIG_HOME") - .ok() - .map(PathBuf::from) - .or_else(|| { - std::env::var("HOME") - .ok() - .map(|h| PathBuf::from(h).join(".config")) - })?; - Some(config_home.join("opencode").join("opencode.json")) -} - -/// Extract API key credentials from the contents of an opencode config file. -/// -/// opencode stores per-provider API keys at `provider..options.apiKey`. -/// Each key is surfaced as `_API_KEY` so that it can be injected -/// as an environment variable into the sandbox and picked up by opencode at runtime. -fn extract_credentials_from_opencode_config(content: &str) -> HashMap { - let Ok(json) = serde_json::from_str::(content) else { - return HashMap::new(); - }; - let Some(providers) = json.get("provider").and_then(|p| p.as_object()) else { - return HashMap::new(); - }; - - let mut creds = HashMap::new(); - for (provider_name, provider_cfg) in providers { - if let Some(api_key) = provider_cfg - .get("options") - .and_then(|o| o.get("apiKey")) - .and_then(|k| k.as_str()) - .filter(|k| !k.trim().is_empty()) - { - let env_var = format!("{}_API_KEY", provider_name.to_ascii_uppercase()); - creds.insert(env_var, api_key.to_string()); - } - } - creds -} - -/// Read opencode credentials from `path`, returning `None` if the file is absent or unreadable. -fn read_opencode_config_file(path: &Path) -> Option> { - let content = std::fs::read_to_string(path).ok()?; - let creds = extract_credentials_from_opencode_config(&content); - if creds.is_empty() { None } else { Some(creds) } -} - -impl ProviderPlugin for OpencodeProvider { - fn id(&self) -> &'static str { - SPEC.id - } - - fn discover_existing(&self) -> Result, ProviderError> { - let mut discovered = discover_with_spec(&SPEC, &RealDiscoveryContext)?.unwrap_or_default(); - - // Supplement env-var discovery with credentials stored in the opencode config file. - // opencode's native config lives at $XDG_CONFIG_HOME/opencode/opencode.json and stores - // API keys under `provider..options.apiKey`. If the user configured opencode - // normally (i.e. no env vars set), this is the only place the keys exist. - if let Some(path) = opencode_config_path() - && let Some(file_creds) = read_opencode_config_file(&path) - { - for (key, value) in file_creds { - // Env vars already set take priority; config file fills the gaps. - discovered.credentials.entry(key).or_insert(value); - } - } - - if discovered.is_empty() { - Ok(None) - } else { - Ok(Some(discovered)) - } - } - - fn credential_env_vars(&self) -> &'static [&'static str] { - SPEC.credential_env_vars - } -} - -#[cfg(test)] -mod tests { - use super::{SPEC, extract_credentials_from_opencode_config}; - use crate::discover_with_spec; - use crate::test_helpers::MockDiscoveryContext; - - #[test] - fn discovers_opencode_env_credentials() { - let ctx = MockDiscoveryContext::new().with_env("OPENCODE_API_KEY", "op-key"); - let discovered = discover_with_spec(&SPEC, &ctx) - .expect("discovery") - .expect("provider"); - assert_eq!( - discovered.credentials.get("OPENCODE_API_KEY"), - Some(&"op-key".to_string()) - ); - } - - #[test] - fn extracts_credentials_from_config_file() { - let config = r#"{ - "provider": { - "anthropic": { "options": { "apiKey": "sk-ant-key" } }, - "openai": { "options": { "apiKey": "sk-openai-key" } } - } - }"#; - let creds = extract_credentials_from_opencode_config(config); - assert_eq!( - creds.get("ANTHROPIC_API_KEY"), - Some(&"sk-ant-key".to_string()) - ); - assert_eq!( - creds.get("OPENAI_API_KEY"), - Some(&"sk-openai-key".to_string()) - ); - } - - #[test] - fn skips_providers_without_api_key() { - let config = r#"{ - "provider": { - "ollama": { "options": { "baseUrl": "http://localhost:11434" } } - } - }"#; - let creds = extract_credentials_from_opencode_config(config); - assert!( - creds.is_empty(), - "no credentials expected for keyless provider" - ); - } - - #[test] - fn skips_empty_api_keys() { - let config = r#"{ - "provider": { - "anthropic": { "options": { "apiKey": "" } } - } - }"#; - let creds = extract_credentials_from_opencode_config(config); - assert!(creds.is_empty()); - } - - #[test] - fn tolerates_malformed_json() { - let creds = extract_credentials_from_opencode_config("not json at all"); - assert!(creds.is_empty()); - } - - #[test] - fn tolerates_missing_provider_section() { - let config = r#"{ "theme": "dark" }"#; - let creds = extract_credentials_from_opencode_config(config); - assert!(creds.is_empty()); - } -} diff --git a/crates/openshell-providers/src/providers/outlook.rs b/crates/openshell-providers/src/providers/outlook.rs deleted file mode 100644 index cd5384e534..0000000000 --- a/crates/openshell-providers/src/providers/outlook.rs +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -use crate::{DiscoveredProvider, ProviderError, ProviderPlugin}; - -pub struct OutlookProvider; - -impl ProviderPlugin for OutlookProvider { - fn id(&self) -> &'static str { - "outlook" - } - - fn discover_existing(&self) -> Result, ProviderError> { - Ok(None) - } -} - -#[cfg(test)] -mod tests { - use super::OutlookProvider; - use crate::ProviderPlugin; - - #[test] - fn outlook_provider_discovery_is_empty_by_default() { - let provider = OutlookProvider; - let discovered = provider.discover_existing().expect("discovery"); - assert!(discovered.is_none()); - } -} diff --git a/crates/openshell-server/Cargo.toml b/crates/openshell-server/Cargo.toml index 1efd692307..9a057519b7 100644 --- a/crates/openshell-server/Cargo.toml +++ b/crates/openshell-server/Cargo.toml @@ -129,6 +129,9 @@ tonic-prost-build = { workspace = true } protoc-bin-vendored = { workspace = true } [dev-dependencies] +# Tests import the example profiles from providers/ the way an operator +# would; the feature is test-only and never reaches a release binary. +openshell-providers = { path = "../openshell-providers", features = ["example-profiles"] } base64 = { workspace = true } hyper-rustls = { version = "0.27", default-features = false, features = ["native-tokio", "http1", "tls12", "logging", "aws-lc-rs"] } rcgen = { workspace = true } diff --git a/crates/openshell-server/src/config_file.rs b/crates/openshell-server/src/config_file.rs index 7408f20c9b..6bddddc4c2 100644 --- a/crates/openshell-server/src/config_file.rs +++ b/crates/openshell-server/src/config_file.rs @@ -1090,7 +1090,6 @@ max_body_bytes = 262144 let toml = r#" [openshell.gateway] provider_profile_sources = [ - { type = "builtin" }, { type = "user" }, { type = "interceptor", name = "provider-governance" }, ] @@ -1100,7 +1099,6 @@ provider_profile_sources = [ assert_eq!( file.openshell.gateway.provider_profile_sources, Some(vec![ - GatewayProviderProfileSourceConfig::Builtin, GatewayProviderProfileSourceConfig::User, GatewayProviderProfileSourceConfig::Interceptor { name: "provider-governance".to_string(), @@ -1109,6 +1107,25 @@ provider_profile_sources = [ ); } + #[test] + fn rejects_the_removed_builtin_provider_profile_source() { + let toml = r#" +[openshell.gateway] +provider_profile_sources = [ + { type = "builtin" }, + { type = "user" }, +] +"#; + let tmp = write_tmp(toml); + let error = load(tmp.path()).expect_err("the builtin source was removed"); + let message = error.to_string(); + assert!(message.contains("import-only"), "{message}"); + assert!( + message.contains("openshell provider profile import"), + "{message}" + ); + } + #[test] fn rejects_database_url_in_file() { let toml = r#" diff --git a/crates/openshell-server/src/grpc/mod.rs b/crates/openshell-server/src/grpc/mod.rs index 7c089c04bf..ac87ebcddf 100644 --- a/crates/openshell-server/src/grpc/mod.rs +++ b/crates/openshell-server/src/grpc/mod.rs @@ -881,25 +881,78 @@ pub mod test_support { req } + /// Store the example profiles from `providers/` as platform-scoped + /// user-managed profiles. + /// + /// `OpenShell` compiles no provider profile into a binary, so a gateway's + /// catalog holds exactly what an operator imported. Tests that expect + /// `github`, `openai` and the rest to resolve therefore have to import them + /// first, which is what this does. + pub async fn seed_example_provider_profiles(store: &Store) { + for profile in openshell_providers::example_profiles::load_all() { + store + .put_message(&crate::provider_profile_sources::stored_provider_profile( + profile.to_proto(), + )) + .await + .expect("store example provider profile"); + } + } + + /// The provider-profile source set every test state uses: user-managed + /// profiles only, matching the gateway default. + fn test_provider_profile_sources() -> crate::provider_profile_sources::ProviderProfileSources { + crate::provider_profile_sources::ProviderProfileSources::from_config( + &[openshell_core::GatewayProviderProfileSourceConfig::User], + None, + ) + .expect("user-only provider profile source configuration should be valid") + } + + fn with_test_provider_profile_sources(mut state: Arc) -> Arc { + Arc::get_mut(&mut state) + .expect("test server state should be uniquely owned") + .provider_profile_sources = test_provider_profile_sources(); + state + } + /// Build an in-memory `ServerState` for unit tests. pub async fn test_server_state() -> Arc { test_server_state_with_driver("test").await } + /// Build a test state for a gateway with nothing imported. + /// + /// Its profile catalog is empty, which is the state a freshly installed + /// gateway starts in. + pub async fn test_server_state_without_provider_profiles() -> Arc { + test_server_state_for_driver("test", false).await + } + /// Build an in-memory `ServerState` with a selected built-in driver name. pub async fn test_server_state_with_driver(driver_name: &str) -> Arc { + test_server_state_for_driver(driver_name, true).await + } + + async fn test_server_state_for_driver( + driver_name: &str, + seed_profiles: bool, + ) -> Arc { let store = Arc::new( Store::connect("sqlite::memory:?cache=shared") .await .unwrap(), ); crate::ensure_default_workspace(&store).await.unwrap(); + if seed_profiles { + seed_example_provider_profiles(&store).await; + } let compute = if driver_name == "test" { new_test_runtime(store.clone()).await } else { new_test_runtime_for_driver(store.clone(), driver_name).await }; - Arc::new(ServerState::new( + with_test_provider_profile_sources(Arc::new(ServerState::new( Config::new(None) .with_database_url("sqlite::memory:?cache=shared") .with_credential_drivers(["test-static"]), @@ -910,7 +963,7 @@ pub mod test_support { TracingLogBus::new(), Arc::new(SupervisorSessionRegistry::new()), None, - )) + ))) } /// Build a test state whose compute driver fails the requested number of @@ -924,9 +977,10 @@ pub mod test_support { .unwrap(), ); crate::ensure_default_workspace(&store).await.unwrap(); + seed_example_provider_profiles(&store).await; let driver = Arc::new(NoopTestDriver::failing_workspace_deletes(failures)); let compute = new_test_runtime_with_driver(store.clone(), "test", driver); - Arc::new(ServerState::new( + with_test_provider_profile_sources(Arc::new(ServerState::new( Config::new(None) .with_database_url("sqlite::memory:?cache=shared") .with_credential_drivers(["test-static"]), @@ -937,7 +991,7 @@ pub mod test_support { TracingLogBus::new(), Arc::new(SupervisorSessionRegistry::new()), None, - )) + ))) } } diff --git a/crates/openshell-server/src/grpc/policy.rs b/crates/openshell-server/src/grpc/policy.rs index d874143cf7..8434377c1d 100644 --- a/crates/openshell-server/src/grpc/policy.rs +++ b/crates/openshell-server/src/grpc/policy.rs @@ -7316,7 +7316,24 @@ mod tests { Principal, SandboxIdentitySource, SandboxPrincipal, UserPrincipal, }; use crate::grpc::test_support::{authed_request, test_server_state}; - use crate::persistence::test_store; + + /// An in-memory store with the example profiles imported at platform scope. + /// + /// Provider profiles are import-only, so a gateway resolves only what an + /// operator imported. Tests that expect `github`, `openai` or + /// `google-cloud` to resolve have to import them first. + async fn test_store() -> Store { + let store = crate::persistence::test_store().await; + for profile in openshell_providers::example_profiles::load_all() { + store + .put_message(&crate::provider_profile_sources::stored_provider_profile( + profile.to_proto(), + )) + .await + .expect("store example provider profile"); + } + store + } use std::collections::HashMap; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/crates/openshell-server/src/grpc/policy/endpoint_status_tests.rs b/crates/openshell-server/src/grpc/policy/endpoint_status_tests.rs index 09f76a60c4..e9a698e586 100644 --- a/crates/openshell-server/src/grpc/policy/endpoint_status_tests.rs +++ b/crates/openshell-server/src/grpc/policy/endpoint_status_tests.rs @@ -288,11 +288,7 @@ async fn loaded_policy_comparison_uses_one_provider_profile_snapshot() { .expect("store equivalent policy revision"); let fetch_count = Arc::new(AtomicUsize::new(0)); let mut state = Arc::into_inner(state).expect("uniquely owned test state"); - let mut profile_a = openshell_providers::builtin_profiles() - .iter() - .find(|profile| profile.id == "github") - .expect("valid built-in provider profile") - .to_proto(); + let mut profile_a = openshell_providers::example_profiles::load("github").to_proto(); profile_a.id = "snapshot-provider".to_string(); profile_a.display_name = "catalog-a".to_string(); let mut profile_b = profile_a.clone(); diff --git a/crates/openshell-server/src/grpc/provider.rs b/crates/openshell-server/src/grpc/provider.rs index 5936bc31a6..f7a568b5a9 100644 --- a/crates/openshell-server/src/grpc/provider.rs +++ b/crates/openshell-server/src/grpc/provider.rs @@ -1793,6 +1793,52 @@ pub async fn validate_provider_environment_keys_unique( .await } +/// Reject a sandbox composition whose providers name profiles this gateway does +/// not serve. +/// +/// Provider profiles are import-only, so a provider whose profile was never +/// imported — or was deleted, or lives at a scope this workspace cannot see — +/// resolves to nothing. Composing it silently would produce a sandbox that +/// looks ready but carries none of the provider's credentials or policy, and +/// the failure would surface later as a denied connection. Name the missing +/// profile and the command that supplies it instead. +pub async fn validate_provider_profiles_present( + store: &Store, + catalog: &EffectiveProviderProfileCatalog, + workspace: &str, + provider_names: &[String], +) -> Result<(), Status> { + for name in provider_names { + let Some(provider) = store + .get_message_by_name::(workspace, name) + .await + .map_err(|e| Status::internal(format!("fetch provider failed: {e}")))? + else { + continue; + }; + if get_provider_type_profile_for_scope( + catalog, + &provider.r#type, + &provider.profile_workspace, + ) + .is_some() + { + continue; + } + let requested = provider.r#type.trim(); + let scope_flag = if provider.profile_workspace.trim().is_empty() { + " --global" + } else { + "" + }; + return Err(Status::failed_precondition(format!( + "provider '{name}' references provider profile '{requested}', which is not in this gateway's profile catalog; \ + import it with 'openshell provider profile import -f {scope_flag}'" + ))); + } + Ok(()) +} + pub async fn validate_provider_environment_keys_unique_with_catalog( store: &Store, catalog: &EffectiveProviderProfileCatalog, @@ -1961,14 +2007,12 @@ fn inject_provider_plugin_environment( registry: &openshell_providers::ProviderRegistry, environment: &mut HashMap, ) { + // A plugin activates only for a profile the gateway actually resolved. With + // no profile there is nothing to project. if let Some(profile) = get_provider_type_profile_for_scope(catalog, &provider.r#type, &provider.profile_workspace) { registry.inject_env_for_profile_id(provider, &profile.id, environment); - } else { - // Preserve config projection for legacy records when their profile - // source is temporarily unavailable. - registry.inject_env(provider, environment); } } @@ -2291,7 +2335,7 @@ fn provider_credential_not_expired(provider: &Provider, key: &str, now_ms: i64) } fn is_non_injectable_provider_credential(provider: &Provider, key: &str) -> bool { - normalize_provider_type(&provider.r#type) == Some("google-vertex-ai") + normalize_profile_id(&provider.r#type).as_deref() == Some("google-vertex-ai") && key == "GOOGLE_SERVICE_ACCOUNT_KEY" } @@ -2340,8 +2384,8 @@ use openshell_core::spiffe::{ }; use openshell_providers::{ CredentialRefreshProfile, ProfileValidationDiagnostic, ProviderTypeProfile, - normalize_profile_id, normalize_provider_type, strategy_output_env_key, strategy_output_spec, - strategy_primary_env_key, validate_profile_set, + normalize_profile_id, strategy_output_env_key, strategy_output_spec, strategy_primary_env_key, + validate_profile_set, }; use std::sync::{Arc, LazyLock, RwLock}; use tonic::{Request, Response}; @@ -3024,36 +3068,61 @@ pub(super) fn get_provider_type_profile_for_scope( catalog.get_type_profile_for_scope(id, profile_workspace) } -/// Prevent a legacy alternate-upstream provider from binding its credential to -/// the built-in public vendor endpoint. Alternate endpoints must be expressed -/// by an explicitly imported endpoint-bearing profile. +/// Whether a profile's endpoints apply to this provider. +/// +/// A profile's endpoints are the boundary its credential is bound to. When a +/// provider redirects its client to a different upstream — `OPENAI_BASE_URL` +/// pointing somewhere other than the hosts the `openai` profile declares — the +/// profile no longer describes where that credential goes. Treating it as if it +/// did would bind the credential to hosts the workload never contacts while +/// leaving the real upstream uncovered, so the profile is treated as +/// endpointless instead: no policy layer, and the credential binds only through +/// explicit sandbox policy. +/// +/// A profile that declares no endpoints has no boundary to contradict. pub(super) fn provider_profile_endpoints_are_active( profile: &ProviderTypeProfile, provider: &Provider, ) -> bool { - if profile.source != "builtin" { + if profile.endpoints.is_empty() { return true; } - let (base_url_key, default_base_url) = match profile.id.as_str() { - "openai" => ("OPENAI_BASE_URL", "https://api.openai.com/v1"), - "anthropic" => ("ANTHROPIC_BASE_URL", "https://api.anthropic.com/v1"), - _ => return true, - }; - provider .config - .get(base_url_key) - .map(String::as_str) - .map(str::trim) - .filter(|value| !value.is_empty()) - .is_none_or(|configured| { - configured - .trim_end_matches('/') - .eq_ignore_ascii_case(default_base_url.trim_end_matches('/')) + .iter() + .filter(|(key, _)| is_upstream_base_url_key(key)) + .filter_map(|(_, value)| configured_upstream_host(value)) + .all(|host| { + profile.endpoints.iter().any(|endpoint| { + openshell_core::host_pattern::host_matches(&endpoint.host, &host).unwrap_or(false) + }) }) } +/// Config keys that redirect a client to a different upstream. +/// +/// `OpenShell` provider config spells these `_BASE_URL` throughout — +/// `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL`, `VERTEX_AI_BASE_URL`. +fn is_upstream_base_url_key(key: &str) -> bool { + key.to_ascii_uppercase().ends_with("_BASE_URL") +} + +/// The host a configured base URL points at, if it names one. +/// +/// A value that does not parse as an absolute URL with a host is not a +/// redirect we can reason about, so it does not deactivate the profile. +fn configured_upstream_host(value: &str) -> Option { + let value = value.trim(); + if value.is_empty() { + return None; + } + url::Url::parse(value) + .ok()? + .host_str() + .map(str::to_ascii_lowercase) +} + #[cfg(test)] pub(super) async fn get_provider_type_profile( store: &Store, @@ -3558,15 +3627,8 @@ async fn profile_attached_sandbox_diagnostics( else { continue; }; - let requested_profile_id = normalize_profile_id(&provider.r#type) + let profile_id = normalize_profile_id(&provider.r#type) .unwrap_or_else(|| provider.r#type.trim().to_string()); - let profile_id = if candidate_profiles.contains_key(&requested_profile_id) { - requested_profile_id - } else { - normalize_provider_type(&provider.r#type) - .filter(|alias| candidate_profiles.contains_key(*alias)) - .map_or(requested_profile_id, str::to_string) - }; let scope_mismatch = (is_platform_scope && !provider.profile_workspace.is_empty()) || (!is_platform_scope && provider.profile_workspace.is_empty()); if scope_mismatch { @@ -5023,19 +5085,20 @@ async fn provider_profile_for_name( .map(|provider| telemetry_provider_profile(&provider.r#type)) } +/// Bucket a provider type for telemetry. +/// +/// Matches the profile ID exactly. Any ID without a bucket, including every +/// operator-authored profile, reports as `Custom`. fn telemetry_provider_profile(provider_type: &str) -> TelemetryProviderProfile { - match normalize_provider_type(provider_type) { + match normalize_profile_id(provider_type).as_deref() { Some("anthropic") => TelemetryProviderProfile::Anthropic, - Some("claude" | "claude-code") => TelemetryProviderProfile::Claude, + Some("claude-code") => TelemetryProviderProfile::Claude, Some("codex") => TelemetryProviderProfile::Codex, Some("copilot") => TelemetryProviderProfile::Copilot, Some("deepinfra") => TelemetryProviderProfile::Deepinfra, Some("github") => TelemetryProviderProfile::Github, - Some("gitlab") => TelemetryProviderProfile::Gitlab, Some("nvidia") => TelemetryProviderProfile::Nvidia, Some("openai") => TelemetryProviderProfile::Openai, - Some("opencode") => TelemetryProviderProfile::Opencode, - Some("outlook") => TelemetryProviderProfile::Outlook, _ => TelemetryProviderProfile::Custom, } } @@ -5049,9 +5112,28 @@ mod tests { use super::*; use crate::auth::identity::{Identity, IdentityProvider}; use crate::auth::principal::{Principal, UserPrincipal}; - use crate::grpc::test_support::{authed_request, test_server_state}; + use crate::grpc::test_support::{ + authed_request, test_server_state, test_server_state_without_provider_profiles, + }; use crate::grpc::{MAX_MAP_KEY_LEN, MAX_PROVIDER_TYPE_LEN}; - use crate::persistence::test_store; + + /// An in-memory store with the example profiles imported at platform scope. + /// + /// Provider profiles are import-only, so a gateway resolves only what an + /// operator imported. Tests that expect `github`, `openai` or + /// `google-cloud` to resolve have to import them first. + async fn test_store() -> Store { + let store = crate::persistence::test_store().await; + for profile in openshell_providers::example_profiles::load_all() { + store + .put_message(&crate::provider_profile_sources::stored_provider_profile( + profile.to_proto(), + )) + .await + .expect("store example provider profile"); + } + store + } use openshell_core::proto::{ AttachSandboxProviderRequest, ConfigureProviderRefreshRequest, CreateProviderRequest, CreateWorkspaceRequest, DeleteProviderProfileRequest, DeleteProviderRefreshRequest, @@ -5140,21 +5222,35 @@ mod tests { #[test] fn telemetry_provider_profile_maps_unknown_to_custom() { assert_eq!( - telemetry_provider_profile("CLAUDE"), + telemetry_provider_profile("CLAUDE-CODE"), TelemetryProviderProfile::Claude ); + // A legacy alias is not a profile ID, so it buckets as custom. + assert_eq!( + telemetry_provider_profile("claude"), + TelemetryProviderProfile::Custom + ); assert_eq!( telemetry_provider_profile("github"), TelemetryProviderProfile::Github ); + // Legacy aliases are not profile IDs. assert_eq!( telemetry_provider_profile("gh"), - TelemetryProviderProfile::Github + TelemetryProviderProfile::Custom ); assert_eq!( telemetry_provider_profile("glab"), TelemetryProviderProfile::Custom ); + assert_eq!( + telemetry_provider_profile("gitlab"), + TelemetryProviderProfile::Custom + ); + assert_eq!( + telemetry_provider_profile("opencode"), + TelemetryProviderProfile::Custom + ); assert_eq!( telemetry_provider_profile("outlook"), TelemetryProviderProfile::Custom @@ -5541,30 +5637,30 @@ mod tests { } #[tokio::test] - async fn update_provider_profile_rejects_built_in_and_missing_profiles() { - let state = test_server_state().await; + async fn update_provider_profile_rejects_source_managed_and_missing_profiles() { + let state = test_server_state_with_source_managed_profile("vended-api").await; - let built_in = handle_update_provider_profiles( + let source_managed = handle_update_provider_profiles( &state, authed_request(UpdateProviderProfilesRequest { request_id: String::new(), profile: Some(ProviderProfileImportItem { - profile: Some(custom_profile("github")), - source: "github.yaml".to_string(), + profile: Some(custom_profile("vended-api")), + source: "vended-api.yaml".to_string(), }), expected_resource_version: 0, - id: "github".to_string(), + id: "vended-api".to_string(), workspace: "default".to_string(), }), ) .await .unwrap() .into_inner(); - assert!(!built_in.updated); - assert!(built_in.diagnostics.iter().any(|diagnostic| { + assert!(!source_managed.updated); + assert!(source_managed.diagnostics.iter().any(|diagnostic| { diagnostic .message - .contains("managed by source 'builtin' and cannot be updated") + .contains("managed by source 'test' and cannot be updated") })); let missing = handle_update_provider_profiles( @@ -5784,6 +5880,103 @@ mod tests { })); } + fn provider_with_config(provider_type: &str, config: &[(&str, &str)]) -> Provider { + Provider { + r#type: provider_type.to_string(), + config: config + .iter() + .map(|(key, value)| ((*key).to_string(), (*value).to_string())) + .collect(), + ..Default::default() + } + } + + #[test] + fn profile_endpoints_stay_active_for_declared_upstreams() { + let openai = openshell_providers::example_profiles::load("openai"); + + assert!(provider_profile_endpoints_are_active( + &openai, + &provider_with_config("openai", &[]) + )); + assert!(provider_profile_endpoints_are_active( + &openai, + &provider_with_config( + "openai", + &[("OPENAI_BASE_URL", "https://api.openai.com/v1")] + ) + )); + // An empty value is not a redirect. + assert!(provider_profile_endpoints_are_active( + &openai, + &provider_with_config("openai", &[("OPENAI_BASE_URL", " ")]) + )); + // Neither is a value that names no host. + assert!(provider_profile_endpoints_are_active( + &openai, + &provider_with_config("openai", &[("OPENAI_BASE_URL", "not-a-url")]) + )); + } + + #[test] + fn profile_endpoints_deactivate_for_an_undeclared_upstream() { + let openai = openshell_providers::example_profiles::load("openai"); + assert!(!provider_profile_endpoints_are_active( + &openai, + &provider_with_config( + "openai", + &[("OPENAI_BASE_URL", "https://api.example.com/v1")] + ) + )); + + // The rule is not keyed on the profile ID: it applies to any + // endpoint-bearing profile, including an operator's own. + let mut mine = openai; + mine.id = "my-inference".to_string(); + assert!(!provider_profile_endpoints_are_active( + &mine, + &provider_with_config( + "my-inference", + &[("MY_INFERENCE_BASE_URL", "https://elsewhere.example.com")] + ) + )); + } + + #[test] + fn profile_endpoints_honor_wildcard_hosts() { + let vertex = openshell_providers::example_profiles::load("google-vertex-ai"); + assert!(provider_profile_endpoints_are_active( + &vertex, + &provider_with_config( + "google-vertex-ai", + &[( + "VERTEX_AI_BASE_URL", + "https://us-central1-aiplatform.googleapis.com/v1" + )] + ) + )); + assert!(!provider_profile_endpoints_are_active( + &vertex, + &provider_with_config( + "google-vertex-ai", + &[("VERTEX_AI_BASE_URL", "https://aiplatform.example.com/v1")] + ) + )); + } + + #[test] + fn a_profile_without_endpoints_has_no_boundary_to_contradict() { + let google_cloud = openshell_providers::example_profiles::load("google-cloud"); + assert!(google_cloud.endpoints.is_empty()); + assert!(provider_profile_endpoints_are_active( + &google_cloud, + &provider_with_config( + "google-cloud", + &[("GCP_BASE_URL", "https://anything.example.com")] + ) + )); + } + fn provider_with_values(name: &str, provider_type: &str) -> Provider { Provider { metadata: Some(openshell_core::proto::datamodel::v1::ObjectMeta { @@ -5870,6 +6063,20 @@ mod tests { } } + /// A test state whose catalog carries one source-managed profile beside the + /// user-managed source. + /// + /// Provider profiles are import-only, so the only profiles a gateway cannot + /// edit are the ones a non-user source vends. This models that shape. + async fn test_server_state_with_source_managed_profile(id: &str) -> Arc { + let mut state = test_server_state().await; + Arc::get_mut(&mut state) + .expect("test server state should be uniquely owned") + .provider_profile_sources = + ProviderProfileSources::from_test_profiles_with_user_source(vec![custom_profile(id)]); + state + } + fn custom_profile(id: &str) -> ProviderProfile { ProviderProfile { id: id.to_string(), @@ -6436,15 +6643,15 @@ mod tests { } #[tokio::test] - async fn import_provider_profile_rejects_builtin_overwrite() { - let state = test_server_state().await; + async fn import_provider_profile_rejects_source_managed_overwrite() { + let state = test_server_state_with_source_managed_profile("vended-api").await; let response = handle_import_provider_profiles( &state, authed_request(ImportProviderProfilesRequest { request_id: String::new(), profiles: vec![ProviderProfileImportItem { - profile: Some(custom_profile("github")), - source: "github.yaml".to_string(), + profile: Some(custom_profile("vended-api")), + source: "vended-api.yaml".to_string(), }], workspace: "default".to_string(), }), @@ -6458,7 +6665,7 @@ mod tests { response .diagnostics .iter() - .any(|diagnostic| diagnostic.message.contains("managed by source 'builtin'")) + .any(|diagnostic| diagnostic.message.contains("managed by source 'test'")) ); } @@ -6842,8 +7049,8 @@ mod tests { } #[tokio::test] - async fn delete_provider_profile_rejects_builtin_and_provider_referenced_profiles() { - let state = test_server_state().await; + async fn delete_provider_profile_rejects_source_managed_and_provider_referenced_profiles() { + let state = test_server_state_with_source_managed_profile("vended-api").await; handle_import_provider_profiles( &state, authed_request(ImportProviderProfilesRequest { @@ -6858,18 +7065,18 @@ mod tests { .await .unwrap(); - let builtin_err = handle_delete_provider_profile( + let source_managed_err = handle_delete_provider_profile( &state, authed_request(DeleteProviderProfileRequest { request_id: String::new(), allow_missing: false, - id: "github".to_string(), + id: "vended-api".to_string(), workspace: "default".to_string(), }), ) .await .unwrap_err(); - assert_eq!(builtin_err.code(), Code::FailedPrecondition); + assert_eq!(source_managed_err.code(), Code::FailedPrecondition); create_provider_record( state.store.as_ref(), @@ -10531,7 +10738,7 @@ mod tests { workspace: "default".to_string(), deletion_time: None, }), - r#type: "claude".to_string(), + r#type: "claude-code".to_string(), credentials: [ ("ANTHROPIC_API_KEY".to_string(), "sk-abc".to_string()), ("CLAUDE_API_KEY".to_string(), "sk-abc".to_string()), @@ -13870,7 +14077,11 @@ mod tests { use openshell_core::google_cloud; let provider = google_cloud_provider(HashMap::new()); let mut env = HashMap::new(); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); assert_eq!( env.get("GCE_METADATA_HOST").map(String::as_str), Some(google_cloud::METADATA_HOST), @@ -13889,7 +14100,11 @@ mod tests { "my-project".to_string(), )])); let mut env = HashMap::new(); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); for var in google_cloud::PROJECT_ID_ENV_VARS { assert_eq!( env.get(*var).map(String::as_str), @@ -13907,7 +14122,11 @@ mod tests { "us-central1".to_string(), )])); let mut env = HashMap::new(); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); for var in google_cloud::REGION_ENV_VARS { assert_eq!( env.get(*var).map(String::as_str), @@ -13925,7 +14144,11 @@ mod tests { "sa@proj.iam.gserviceaccount.com".to_string(), )])); let mut env = HashMap::new(); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); for var in google_cloud::SERVICE_ACCOUNT_EMAIL_ENV_VARS { assert_eq!( env.get(*var).map(String::as_str), @@ -13942,7 +14165,11 @@ mod tests { "from-config".to_string(), )])); let mut env = HashMap::from([("GCP_PROJECT_ID".to_string(), "user-override".to_string())]); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); assert_eq!( env.get("GCP_PROJECT_ID").map(String::as_str), Some("user-override"), @@ -13971,7 +14198,11 @@ mod tests { credential_handles: HashMap::new(), }; let mut env = HashMap::new(); - openshell_providers::ProviderRegistry::new().inject_env(&provider, &mut env); + openshell_providers::ProviderRegistry::new().inject_env_for_profile_id( + &provider, + &provider.r#type, + &mut env, + ); assert!( env.is_empty(), "non-GCP provider should not inject any env vars" @@ -14708,6 +14939,82 @@ mod tests { ); } + #[tokio::test] + async fn a_gateway_with_nothing_imported_serves_an_empty_catalog() { + let state = test_server_state_without_provider_profiles().await; + + let response = handle_list_provider_profiles( + &state, + authed_request(ListProviderProfilesRequest { + page_size: 200, + page_token: String::new(), + workspace: "default".to_string(), + }), + ) + .await + .expect("an empty catalog is a valid state, not an error") + .into_inner(); + + assert!(response.profiles.is_empty()); + assert!(response.next_page_token.is_empty()); + } + + #[tokio::test] + async fn importing_an_example_profile_registers_it_at_its_canonical_id() { + let state = test_server_state_without_provider_profiles().await; + let github = openshell_providers::example_profiles::load("github").to_proto(); + + let response = handle_import_provider_profiles( + &state, + authed_request(ImportProviderProfilesRequest { + request_id: String::new(), + profiles: vec![ProviderProfileImportItem { + profile: Some(github), + source: "providers/github.yaml".to_string(), + }], + workspace: String::new(), + }), + ) + .await + .expect("import at platform scope") + .into_inner(); + assert!(response.imported, "{:?}", response.diagnostics); + + let stored = handle_get_provider_profile( + &state, + authed_request(GetProviderProfileRequest { + id: "github".to_string(), + workspace: "default".to_string(), + }), + ) + .await + .expect("imported profile resolves at its canonical id") + .into_inner() + .profile + .expect("profile payload"); + + assert_eq!(stored.id, "github"); + assert_eq!(stored.source, "user"); + assert_eq!(stored.scope, "platform"); + + // The imported profile is the only definition for that id: nothing is + // shadowed behind it, so it is editable and deletable. + let catalog = state + .provider_profile_sources + .snapshot_catalog(state.store.as_ref(), "default") + .await + .expect("catalog snapshot"); + assert_eq!(catalog.static_source_for_profile("github"), None); + assert_eq!( + catalog + .list_all_scoped_profiles() + .iter() + .filter(|(_, profile)| profile.id == "github") + .count(), + 1 + ); + } + #[tokio::test] async fn list_profiles_shows_source_and_scope() { let state = test_server_state().await; @@ -14746,12 +15053,13 @@ mod tests { assert_eq!(user_profile.source, "user"); assert_eq!(user_profile.scope, "workspace"); - let builtin = resp + let platform_profile = resp .profiles .iter() - .find(|p| p.source == "builtin") - .expect("builtin profiles should appear"); - assert!(builtin.scope.is_empty()); + .find(|p| p.id == "github") + .expect("imported platform profile should appear in list"); + assert_eq!(platform_profile.source, "user"); + assert_eq!(platform_profile.scope, "platform"); } #[tokio::test] diff --git a/crates/openshell-server/src/grpc/sandbox.rs b/crates/openshell-server/src/grpc/sandbox.rs index 25376a296a..e72f5631e4 100644 --- a/crates/openshell-server/src/grpc/sandbox.rs +++ b/crates/openshell-server/src/grpc/sandbox.rs @@ -420,6 +420,13 @@ async fn handle_create_sandbox_inner( .provider_profile_sources .snapshot_catalog(state.store.as_ref(), &workspace) .await?; + super::provider::validate_provider_profiles_present( + state.store.as_ref(), + &provider_profile_catalog, + &workspace, + &spec.providers, + ) + .await?; validate_provider_environment_keys_unique_with_catalog( state.store.as_ref(), &provider_profile_catalog, @@ -1165,6 +1172,13 @@ pub(super) async fn handle_attach_sandbox_provider( .provider_profile_sources .snapshot_catalog(state.store.as_ref(), &workspace) .await?; + super::provider::validate_provider_profiles_present( + state.store.as_ref(), + &provider_profile_catalog, + &workspace, + &candidate_spec.providers, + ) + .await?; validate_provider_environment_keys_unique_with_catalog( state.store.as_ref(), &provider_profile_catalog, @@ -3273,34 +3287,9 @@ mod tests { use crate::grpc::test_support::{ authed_request, test_server_state, test_server_state_with_driver, }; - use crate::provider_profile_sources::ProviderProfileSources; - use openshell_core::GatewayProviderProfileSourceConfig; use openshell_core::proto::GpuResourceRequirements; use openshell_core::proto::datamodel::v1::ObjectMeta; - async fn test_server_state_with_user_only_github_profile() -> Arc { - let mut state = test_server_state().await; - Arc::get_mut(&mut state) - .expect("test server state should be uniquely owned") - .provider_profile_sources = - ProviderProfileSources::from_config(&[GatewayProviderProfileSourceConfig::User], None) - .expect("user-only provider profile source configuration should be valid"); - - let github_profile = openshell_providers::builtin_profiles() - .iter() - .find(|profile| profile.id == "github") - .expect("github builtin profile") - .to_proto(); - state - .store - .put_message(&crate::provider_profile_sources::stored_provider_profile( - github_profile, - )) - .await - .expect("store user-managed github profile"); - state - } - // ---- shell_escape ---- #[test] @@ -3665,6 +3654,26 @@ mod tests { } } + /// Import a minimal profile so a synthetic provider type resolves. + /// + /// Provider profiles are import-only: a provider whose type no profile + /// declares cannot compose a sandbox. Tests about limits, CAS or credential + /// collisions still need their placeholder types to exist. + async fn import_test_profile(state: &ServerState, id: &str) { + state + .store + .put_message(&crate::provider_profile_sources::stored_provider_profile( + openshell_core::proto::ProviderProfile { + id: id.to_string(), + display_name: id.to_string(), + category: openshell_core::proto::ProviderProfileCategory::Other as i32, + ..Default::default() + }, + )) + .await + .expect("store test provider profile"); + } + fn test_provider(name: &str, provider_type: &str) -> Provider { test_provider_with_credential_key(name, provider_type, "TOKEN") } @@ -3906,7 +3915,7 @@ mod tests { #[tokio::test] async fn attach_sandbox_provider_uses_configured_provider_profile_sources() { - let state = test_server_state_with_user_only_github_profile().await; + let state = test_server_state().await; state .store .put_message(&test_provider("work-github", "github")) @@ -3929,7 +3938,7 @@ mod tests { }), ) .await - .expect("user-only profile catalog should not include the builtin github profile") + .expect("an imported github profile should resolve from the user source") .into_inner(); assert!(response.attached); @@ -4313,6 +4322,8 @@ mod tests { #[tokio::test] async fn create_sandbox_rejects_provider_credential_key_collisions() { let state = test_server_state().await; + import_test_profile(&state, "outlook").await; + import_test_profile(&state, "google-drive").await; state .store .put_message(&test_provider("provider-a", "outlook")) @@ -4351,7 +4362,7 @@ mod tests { #[tokio::test] async fn create_sandbox_uses_configured_provider_profile_sources() { - let state = test_server_state_with_user_only_github_profile().await; + let state = test_server_state().await; let response = handle_create_sandbox( &state, @@ -4367,7 +4378,7 @@ mod tests { }), ) .await - .expect("user-only profile catalog should not include the builtin github profile") + .expect("an imported github profile should resolve from the user source") .into_inner(); assert_eq!( @@ -4376,6 +4387,80 @@ mod tests { ); } + #[tokio::test] + async fn create_sandbox_rejects_a_provider_whose_profile_is_absent() { + let state = test_server_state().await; + state + .store + .put_message(&test_provider("orphan", "never-imported")) + .await + .unwrap(); + + let err = handle_create_sandbox( + &state, + authed_request(CreateSandboxRequest { + request_id: String::new(), + name: "orphan-sandbox".to_string(), + spec: Some(SandboxSpec { + providers: vec!["orphan".to_string()], + ..Default::default() + }), + labels: HashMap::new(), + annotations: HashMap::new(), + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + await_main_process_attachment: false, + workload_template_name: String::new(), + }), + ) + .await + .expect_err("a provider with no profile must not compose a sandbox"); + + assert_eq!(err.code(), tonic::Code::FailedPrecondition); + let message = err.message(); + assert!(message.contains("'orphan'"), "{message}"); + assert!(message.contains("'never-imported'"), "{message}"); + assert!( + message.contains("openshell provider profile import"), + "{message}" + ); + } + + #[tokio::test] + async fn attach_sandbox_provider_rejects_a_provider_whose_profile_is_absent() { + let state = test_server_state().await; + state + .store + .put_message(&test_provider("orphan", "never-imported")) + .await + .unwrap(); + state + .store + .put_message(&test_sandbox("work", Vec::new())) + .await + .unwrap(); + + let err = handle_attach_sandbox_provider( + &state, + authed_request(AttachSandboxProviderRequest { + request_id: String::new(), + sandbox_name: "work".to_string(), + provider_name: "orphan".to_string(), + expected_resource_version: 0, + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + }), + ) + .await + .expect_err("a provider with no profile must not attach"); + + assert_eq!(err.code(), tonic::Code::FailedPrecondition); + let message = err.message(); + assert!(message.contains("'never-imported'"), "{message}"); + assert!( + message.contains("openshell provider profile import"), + "{message}" + ); + } + #[tokio::test] async fn create_sandbox_rejects_reserved_provider_policy_key() { let state = test_server_state().await; @@ -5934,6 +6019,8 @@ mod tests { #[tokio::test] async fn attach_sandbox_provider_rejects_credential_key_collisions() { let state = test_server_state().await; + import_test_profile(&state, "outlook").await; + import_test_profile(&state, "google-drive").await; state .store .put_message(&test_provider("provider-a", "outlook")) @@ -5972,6 +6059,7 @@ mod tests { #[tokio::test] async fn attach_sandbox_provider_accepts_at_max_providers_limit() { let state = test_server_state().await; + import_test_profile(&state, "generic").await; // Create MAX_PROVIDERS (32) providers for i in 0..MAX_PROVIDERS { @@ -6028,6 +6116,7 @@ mod tests { #[tokio::test] async fn attach_sandbox_provider_rejects_beyond_max_providers_limit() { let state = test_server_state().await; + import_test_profile(&state, "generic").await; // Create MAX_PROVIDERS + 1 providers for i in 0..=MAX_PROVIDERS { @@ -6089,6 +6178,7 @@ mod tests { // Provider name that exceeds validation limits let long_name = "a".repeat(1000); + import_test_profile(&state, "generic").await; state .store .put_message(&test_provider(&long_name, "generic")) @@ -6558,6 +6648,7 @@ mod tests { use std::sync::Arc; let state = Arc::new(test_server_state().await); + import_test_profile(&state, "generic").await; // Create multiple providers for i in 0..3 { diff --git a/crates/openshell-server/src/provider_profile_sources.rs b/crates/openshell-server/src/provider_profile_sources.rs index 819d642b1e..3137036721 100644 --- a/crates/openshell-server/src/provider_profile_sources.rs +++ b/crates/openshell-server/src/provider_profile_sources.rs @@ -15,8 +15,7 @@ use openshell_gateway_interceptors::{ ProviderProfileSourceSnapshot as InterceptorProfileSnapshot, }; use openshell_providers::{ - ProfileValidationDiagnostic, ProviderTypeProfile, builtin_profiles, normalize_profile_id, - normalize_provider_type, validate_profile_set, + ProfileValidationDiagnostic, ProviderTypeProfile, normalize_profile_id, validate_profile_set, }; use prost::Message as _; use sha2::{Digest, Sha256}; @@ -26,7 +25,6 @@ use tracing::debug; use crate::persistence::{ObjectListQuery, ObjectType, Store}; use crate::storage_proto::StoredProviderProfile; -const BUILTIN_SOURCE_ID: &str = "builtin"; const USER_SOURCE_ID: &str = "user"; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -66,44 +64,6 @@ pub trait ProviderProfileSource: Send + Sync + std::fmt::Debug { ) -> Result; } -#[derive(Debug, Clone, Default)] -struct BuiltinProviderProfileSource; - -#[async_trait] -impl ProviderProfileSource for BuiltinProviderProfileSource { - fn source_id(&self) -> &str { - BUILTIN_SOURCE_ID - } - - fn user_managed(&self) -> bool { - false - } - - fn allow_empty(&self) -> bool { - false - } - - async fn snapshot( - &self, - _store: &Store, - _workspace: &str, - ) -> Result { - let proto_profiles: Vec = builtin_profiles() - .iter() - .map(ProviderTypeProfile::to_proto) - .collect(); - let revision = profile_snapshot_revision(&proto_profiles); - let profiles = proto_profiles - .into_iter() - .map(|profile| ScopedSnapshotProfile { - scope: ProfileScope::Static, - profile, - }) - .collect(); - Ok(ProviderProfileSnapshot { revision, profiles }) - } -} - #[derive(Debug, Clone, Default)] struct UserProviderProfileSource; @@ -248,7 +208,6 @@ struct ScopedProfileEntry { struct EffectiveProfileEntry { effective: ScopedProfileEntry, platform_fallback: Option, - static_fallback: Option, } #[derive(Debug, Clone)] @@ -259,12 +218,13 @@ pub struct EffectiveProviderProfileCatalog { } impl ProviderProfileSources { + /// The gateway default: user-managed profiles only. + /// + /// A gateway with nothing imported serves an empty catalog, which is a + /// valid state, not a startup failure. pub fn with_default_sources() -> Self { Self { - sources: vec![ - Arc::new(BuiltinProviderProfileSource), - Arc::new(UserProviderProfileSource), - ], + sources: vec![Arc::new(UserProviderProfileSource)], } } @@ -280,9 +240,6 @@ impl ProviderProfileSources { let mut sources: Vec> = Vec::with_capacity(configured.len()); for source in configured { let source: Arc = match source { - GatewayProviderProfileSourceConfig::Builtin => { - Arc::new(BuiltinProviderProfileSource) - } GatewayProviderProfileSourceConfig::User => Arc::new(UserProviderProfileSource), GatewayProviderProfileSourceConfig::Interceptor { name } => { if name.trim().is_empty() { @@ -337,6 +294,18 @@ impl ProviderProfileSources { } } + /// A source-managed catalog composed with the user-managed source. + /// + /// Models the shape an operator gets from an interceptor-vended catalog: + /// the interceptor's profiles are read-only through the profile APIs, while + /// imported profiles beside them are not. + #[cfg(test)] + pub(crate) fn from_test_profiles_with_user_source(profiles: Vec) -> Self { + let mut sources = Self::from_test_profiles(profiles).sources; + sources.push(Arc::new(UserProviderProfileSource)); + Self { sources } + } + #[cfg(test)] pub(crate) fn from_test_snapshot_sequence( snapshots: Vec<(String, Vec)>, @@ -426,9 +395,6 @@ impl EffectiveProviderProfileCatalog { if let Some(fallback) = &entry.platform_fallback { result.push((fallback.scope, fallback.response.clone())); } - if let Some(fallback) = &entry.static_fallback { - result.push((fallback.scope, fallback.response.clone())); - } } result } @@ -458,26 +424,15 @@ impl EffectiveProviderProfileCatalog { .map(|entry| entry.profile.clone()) } + /// Resolve a profile by its exact normalized ID. + /// + /// Profiles are import-only, so a provider type names a profile the + /// operator imported. There is no alias fallback: an unimported ID is + /// absent, not a hint toward some other profile. fn scoped_type_profile_for_scope( &self, id: &str, profile_workspace: &str, - ) -> Option<&ScopedProfileEntry> { - if let Some(entry) = self.exact_scoped_type_profile_for_scope(id, profile_workspace) { - return Some(entry); - } - - let alias = normalize_provider_type(id)?; - if normalize_profile_id(id).as_deref() == Some(alias) { - return None; - } - self.exact_scoped_type_profile_for_scope(alias, profile_workspace) - } - - fn exact_scoped_type_profile_for_scope( - &self, - id: &str, - profile_workspace: &str, ) -> Option<&ScopedProfileEntry> { let id = normalize_profile_id(id)?; let entry = self.profiles.get(&id)?; @@ -490,25 +445,23 @@ impl EffectiveProviderProfileCatalog { match &entry.platform_fallback { Some(fallback) => Some(fallback), None if entry.effective.scope == ProfileScope::Platform => Some(&entry.effective), - None => entry.static_fallback.as_ref(), + None => None, } } else { Some(&entry.effective) } } + /// The non-user source that manages this profile, if any. + /// + /// Profiles are import-only, so the only read-only profiles left are the + /// ones a configured interceptor vends. pub(crate) fn static_source_for_profile(&self, id: &str) -> Option { let id = normalize_profile_id(id)?; self.profiles .get(&id) - .and_then(|entry| { - if entry.effective.user_managed { - entry.static_fallback.as_ref() - } else { - Some(&entry.effective) - } - }) - .map(|entry| entry.source_id.clone()) + .filter(|entry| !entry.effective.user_managed) + .map(|entry| entry.effective.source_id.clone()) } pub(crate) fn hash_type_profile_revision_for_scope( @@ -669,19 +622,9 @@ fn build_effective_profiles( let new_scope = new_entry.scope; match (existing_scope, new_scope) { - (ProfileScope::Static, _) - if existing.effective.source_id == BUILTIN_SOURCE_ID - && new_entry.user_managed => - { - let fallback = std::mem::replace(&mut existing.effective, new_entry); - existing.static_fallback = Some(fallback); - } - (_, ProfileScope::Static) - if new_entry.source_id == BUILTIN_SOURCE_ID - && existing.effective.user_managed => - { - existing.static_fallback = Some(new_entry); - } + // A source-managed profile never yields to an imported one: + // a collision between a vended catalog and a stored profile + // is a configuration error, not an override. (ProfileScope::Static, _) | (_, ProfileScope::Static) => { let location = if existing.effective.source_id == source_id { format!("within source '{source_id}'") @@ -715,7 +658,6 @@ fn build_effective_profiles( EffectiveProfileEntry { effective: new_entry, platform_fallback: None, - static_fallback: None, }, ); } @@ -757,6 +699,7 @@ fn format_diagnostic(diagnostic: ProfileValidationDiagnostic) -> String { } } +#[cfg(test)] fn profile_snapshot_revision(profiles: &[ProviderProfile]) -> String { let mut profiles = profiles.to_vec(); profiles @@ -960,11 +903,7 @@ mod tests { } fn profile(id: &str) -> ProviderProfile { - let mut profile = builtin_profiles() - .iter() - .find(|profile| profile.id == "github") - .expect("github built-in profile") - .clone(); + let mut profile = openshell_providers::example_profiles::load("github"); profile.id = id.to_string(); profile.display_name = id.to_string(); profile.to_proto() @@ -1291,18 +1230,29 @@ mod tests { assert!(err.message().contains("duplicate provider profile id")); } - #[test] - fn configured_local_sources_preserve_order() { + #[tokio::test] + async fn configured_sources_preserve_order() { + let (runtime, task) = interceptor_runtime( + ProtoProviderProfileSnapshot { + revision: "external".to_string(), + profiles: vec![profile("governed-github")], + }, + true, + ) + .await; let sources = ProviderProfileSources::from_config( &[ + GatewayProviderProfileSourceConfig::Interceptor { + name: "governance".to_string(), + }, GatewayProviderProfileSourceConfig::User, - GatewayProviderProfileSourceConfig::Builtin, ], - None, + Some(&runtime), ) .unwrap(); - assert_eq!(sources.source_ids(), vec!["user", "builtin"]); + assert_eq!(sources.source_ids(), vec!["interceptor/governance", "user"]); + task.abort(); } #[test] @@ -1315,13 +1265,13 @@ mod tests { fn configured_sources_must_be_unique() { let err = ProviderProfileSources::from_config( &[ - GatewayProviderProfileSourceConfig::Builtin, - GatewayProviderProfileSourceConfig::Builtin, + GatewayProviderProfileSourceConfig::User, + GatewayProviderProfileSourceConfig::User, ], None, ) .unwrap_err(); - assert!(err.contains("duplicate provider profile source 'builtin'")); + assert!(err.contains("duplicate provider profile source 'user'")); } #[test] @@ -1483,7 +1433,7 @@ mod tests { .await; let sources = ProviderProfileSources::from_config( &[ - GatewayProviderProfileSourceConfig::Builtin, + GatewayProviderProfileSourceConfig::User, GatewayProviderProfileSourceConfig::Interceptor { name: "governance".to_string(), }, @@ -1492,6 +1442,10 @@ mod tests { ) .unwrap(); let store = crate::persistence::test_store().await; + store + .put_message(&stored_provider_profile(profile("github"))) + .await + .unwrap(); let profiles = sources .snapshot_catalog(&store, "default") @@ -1519,7 +1473,7 @@ mod tests { .await; let sources = ProviderProfileSources::from_config( &[ - GatewayProviderProfileSourceConfig::Builtin, + GatewayProviderProfileSourceConfig::User, GatewayProviderProfileSourceConfig::Interceptor { name: "governance".to_string(), }, @@ -1528,6 +1482,10 @@ mod tests { ) .unwrap(); let store = crate::persistence::test_store().await; + store + .put_message(&stored_provider_profile(profile("github"))) + .await + .unwrap(); let err = sources .snapshot_catalog(&store, "default") @@ -1579,7 +1537,7 @@ mod tests { .await; let sources = ProviderProfileSources::from_config( &[ - GatewayProviderProfileSourceConfig::Builtin, + GatewayProviderProfileSourceConfig::User, GatewayProviderProfileSourceConfig::Interceptor { name: "governance".to_string(), }, @@ -1588,6 +1546,10 @@ mod tests { ) .unwrap(); let store = crate::persistence::test_store().await; + store + .put_message(&stored_provider_profile(profile("github"))) + .await + .unwrap(); let err = sources .snapshot_catalog(&store, "default") @@ -1796,46 +1758,32 @@ mod tests { } #[test] - fn user_managed_profiles_shadow_new_builtins_in_scope() { - let catalog = build_effective_profiles(vec![ + fn a_source_managed_profile_is_never_shadowed_by_an_imported_one() { + // Provider profiles are import-only, so an ID a non-user source vends + // is not a default an import may quietly displace. The collision is a + // configuration error and the imported profile does not win. + let err = build_effective_profiles(vec![ CollectedProviderProfileSnapshot { - source_id: "builtin".to_string(), + source_id: "interceptor/gov".to_string(), revision: "v1".to_string(), - profiles: vec![ - scoped(ProfileScope::Static, "openai"), - scoped(ProfileScope::Static, "anthropic"), - ], + profiles: vec![scoped(ProfileScope::Static, "openai")], user_managed: false, allow_empty: false, }, CollectedProviderProfileSnapshot { source_id: "user".to_string(), revision: "v1".to_string(), - profiles: vec![ - scoped(ProfileScope::Platform, "openai"), - scoped(ProfileScope::Workspace, "anthropic"), - ], + profiles: vec![scoped(ProfileScope::Platform, "openai")], user_managed: true, allow_empty: true, }, ]) - .unwrap(); + .unwrap_err(); - let openai = catalog - .get_type_profile_for_scope("openai", "default") - .expect("platform override"); - assert_eq!(openai.source, "user"); - let anthropic = catalog - .get_type_profile_for_scope("anthropic", "default") - .expect("workspace override"); - assert_eq!(anthropic.source, "user"); - let platform_anthropic = catalog - .get_type_profile_for_scope("anthropic", "") - .expect("built-in fallback outside workspace scope"); - assert_eq!(platform_anthropic.source, "builtin"); - assert_eq!( - catalog.static_source_for_profile("openai").as_deref(), - Some("builtin") + assert!( + err.message().contains("duplicate provider profile id"), + "{}", + err.message() ); } diff --git a/docs/about/release-notes.mdx b/docs/about/release-notes.mdx index c5f518fd79..0b774e541c 100644 --- a/docs/about/release-notes.mdx +++ b/docs/about/release-notes.mdx @@ -12,6 +12,30 @@ NVIDIA OpenShell follows a frequent release cadence. Use the following GitHub re ## 0.1.0 migration notes +### Provider profiles are import-only + +OpenShell 0.1.0 stops compiling provider profiles into the gateway binary. A gateway's catalog contains exactly the profiles an operator imported, the default `provider_profile_sources` is `[{ type = "user" }]`, and the `builtin` source type is removed: a `gateway.toml` that still names it is rejected at startup with the import command. A gateway with nothing imported reaches ready and serves an empty catalog. + +Export the profiles your deployment relies on **before** upgrading: + +```shell +openshell provider profile export -o yaml --global > .yaml +``` + +After upgrading, import them at the scope your providers use. You can also take them from the `providers/` directory of the matching release tag: + +```shell +openshell provider profile import --from ./providers --global +``` + +Omit `--global` for workspace-scoped providers. The canonical IDs are no longer reserved, so `github`, `openai`, `pypi` and the rest import at their own IDs, and the imported profile is the only definition for that ID. + +A provider whose profile is absent after the upgrade stays listable and exportable, but creating a sandbox with it, or attaching it to one, fails with a message naming the provider, the missing profile ID, and the import command. Legacy provider type aliases are gone with the compiled catalog: use a profile's own ID, so `--type claude-code` rather than `--type claude`, and `--type github` rather than `--type gh`. + +Command-to-provider inference is removed. `openshell sandbox create -- ` no longer derives a provider from the trailing command, and the compiled alias table that drove it is gone. A profile's `binaries` list authorizes a binary to reach that profile's endpoints; it is not a statement that running the binary asks for the provider, so treating it as attachment intent could attach credentials the operator did not select. Name providers explicitly with `--provider `, which still creates a missing provider from local discovery when the name matches an imported profile ID. + +The files under `providers/` are reviewable examples, not defaults. Read each file's header before importing it: several bind network access to binary paths that exist only in the OpenShell Community image, and imported unchanged into another image the profile matches nothing. + ### Network policy binaries OpenShell 0.1.0 removes the deprecated `NetworkBinary.harness` protobuf field and reserves its field number and name. Generated protobuf decoders ignore the unknown value. When the gateway loads policy history written by an older version, it migrates binaries marked by the former field into endpoint-provenance-marked rules so the upgrade cannot widen private-address access. diff --git a/docs/extensibility/gateway-interceptors.mdx b/docs/extensibility/gateway-interceptors.mdx index bf9656a5ed..4d931da5c3 100644 --- a/docs/extensibility/gateway-interceptors.mdx +++ b/docs/extensibility/gateway-interceptors.mdx @@ -152,7 +152,7 @@ provider_profile_sources = [ ] ``` -Include `{ type = "builtin" }` or `{ type = "user" }` entries to compose interceptor profiles with the built-in or user-managed sources. Duplicate normalized profile IDs fail instead of overriding one source with another. +Include a `{ type = "user" }` entry to compose interceptor profiles with imported profiles. Duplicate normalized profile IDs fail instead of overriding one source with another, so an interceptor-vended profile and an imported profile cannot share an ID. The gateway validates snapshot structure and provider profile semantics. It treats the configured interceptor as a trusted source and does not verify interceptor-defined signature, hash, or key annotations. diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdx index 4d7a3e2deb..91565d71af 100644 --- a/docs/get-started/quickstart.mdx +++ b/docs/get-started/quickstart.mdx @@ -36,6 +36,34 @@ After installing the CLI, run `openshell --help` in your terminal to view the fu Install the public OpenShell agent skills with `npx skills add NVIDIA/OpenShell`. The `openshell-cli` skill guides your agent through common workflows and uses the installed CLI help as the command reference; no OpenShell source checkout is required. +## Import a Provider Profile + +A provider profile describes the credentials, endpoints, and client binaries a +provider needs. A gateway serves only the profiles you imported, so import one +before creating a sandbox that uses a provider. + +The OpenShell repository ships example profiles in +[`providers/`](https://github.com/NVIDIA/OpenShell/tree/main/providers). Download +the one matching your agent and import it at platform scope: + +```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/claude-code.yaml +openshell provider profile import -f claude-code.yaml --global +``` + +Use `codex.yaml` for Codex, or `openai.yaml` for OpenCode. Confirm the catalog: + +```shell +openshell provider list-profiles +``` + + +Read the comment header at the top of each file before importing it. It names +the client binaries the profile expects and the image layout those paths assume. +If your sandbox image installs the agent somewhere else, edit `binaries` first — +otherwise the profile matches nothing and the credential is never injected. + + ## Create Your First OpenShell Sandbox Create a sandbox and launch an agent inside it. @@ -47,11 +75,11 @@ Choose the tab that matches your agent: Run the following command to create a sandbox with Claude Code: ```shell -openshell sandbox create -- claude +openshell sandbox create --provider claude-code -- claude ``` -The CLI prompts you to create a provider from local credentials. -Type `yes` to continue. +`--provider` names the profile to use. If no provider by that name exists yet, +the CLI prompts you to create one from local credentials; type `yes` to continue. If `ANTHROPIC_API_KEY` is set in your environment, the CLI picks it up automatically. If not, you can configure it from inside the sandbox after it launches. @@ -65,11 +93,11 @@ If not, you can configure it from inside the sandbox after it launches. Run the following command to create a sandbox with OpenCode: ```shell -openshell sandbox create -- opencode +openshell sandbox create --provider openai -- opencode ``` -The CLI prompts you to create a provider from local credentials. -Type `yes` to continue. +`--provider` names the profile to use. If no provider by that name exists yet, +the CLI prompts you to create one from local credentials; type `yes` to continue. If `OPENAI_API_KEY` or `OPENROUTER_API_KEY` is set in your environment, the CLI picks it up automatically. If not, you can configure it from inside the sandbox after it launches. @@ -79,11 +107,11 @@ If not, you can configure it from inside the sandbox after it launches. Run the following command to create a sandbox with Codex: ```shell -openshell sandbox create -- codex +openshell sandbox create --provider codex -- codex ``` -The CLI prompts you to create a provider from local credentials. -Type `yes` to continue. +`--provider` names the profile to use. If no provider by that name exists yet, +the CLI prompts you to create one from local credentials; type `yes` to continue. If `OPENAI_API_KEY` is set in your environment, the CLI picks it up automatically. If not, you can configure it from inside the sandbox after it launches. diff --git a/docs/get-started/tutorials/docker-compose.mdx b/docs/get-started/tutorials/docker-compose.mdx index fd8c13f059..77ff79f638 100644 --- a/docs/get-started/tutorials/docker-compose.mdx +++ b/docs/get-started/tutorials/docker-compose.mdx @@ -96,7 +96,16 @@ The output should show `Status: Connected`. ## Configure an AI provider -Set your API key as an environment variable and create a provider: +Import the provider profile for the service you use, then set your API key as an +environment variable and create a provider. A gateway serves only the profiles +you imported: + +```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/anthropic.yaml +openshell provider profile import -f anthropic.yaml --global +``` + +Use `openai.yaml` for the OpenAI tab below. diff --git a/docs/get-started/tutorials/github-sandbox.mdx b/docs/get-started/tutorials/github-sandbox.mdx index 89b6c0885e..e420bb697a 100644 --- a/docs/get-started/tutorials/github-sandbox.mdx +++ b/docs/get-started/tutorials/github-sandbox.mdx @@ -52,11 +52,18 @@ In terminal 2, create a new sandbox with Claude Code. The [default policy](/refe Create a [credential provider](/sandboxes/manage-providers) that injects your GitHub token into the sandbox automatically. The provider reads `GITHUB_TOKEN` from your host environment and sets it as an environment variable inside the sandbox: ```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/github.yaml +openshell provider profile import -f github.yaml --global + GITHUB_TOKEN= openshell provider create --name my-github --type github --from-existing openshell sandbox create --provider my-github -- claude ``` +The import step registers the `github` profile on your gateway. OpenShell ships +no profiles inside the gateway binary, so `--type github` resolves only after the +profile is imported. Import it once per gateway. + `openshell sandbox create` keeps the sandbox running after Claude Code exits, so you can apply policy updates later without recreating the environment. Add `--no-keep` if you want the sandbox deleted automatically instead. Claude Code starts inside the sandbox. It prints an authentication link. Open it in your browser, sign in to your Anthropic account, and return to the terminal. When prompted, trust the `/sandbox` workspace to allow Claude Code to read and write files. diff --git a/docs/providers/aws-sigv4.mdx b/docs/providers/aws-sigv4.mdx index cae64015da..101d796e5c 100644 --- a/docs/providers/aws-sigv4.mdx +++ b/docs/providers/aws-sigv4.mdx @@ -17,6 +17,14 @@ AWS SigV4 credential signing lets sandbox agents call AWS services (Bedrock, S3, ## Provider Setup +Import the `aws` profile first; a gateway serves only the profiles you +imported: + +```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/aws.yaml +openshell provider profile import -f aws.yaml --global +``` + Create a provider with AWS credentials: ```shell diff --git a/docs/providers/google-cloud.mdx b/docs/providers/google-cloud.mdx index 127dae1d6e..9168be25e3 100644 --- a/docs/providers/google-cloud.mdx +++ b/docs/providers/google-cloud.mdx @@ -16,6 +16,14 @@ never holds a real GCP credential. ## Quick Start +Import the `google-cloud` profile first; a gateway serves only the profiles you +imported: + +```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/google-cloud.yaml +openshell provider profile import -f google-cloud.yaml --global +``` + If you already have `gcloud` configured with Application Default Credentials, create a provider with automatic credential refresh in one command: diff --git a/docs/providers/google-vertex-ai.mdx b/docs/providers/google-vertex-ai.mdx index 781768b7ed..0832baee90 100644 --- a/docs/providers/google-vertex-ai.mdx +++ b/docs/providers/google-vertex-ai.mdx @@ -24,6 +24,14 @@ native Vertex endpoint and request format for its selected model. ## Create a Provider +Import the `google-vertex-ai` profile first; a gateway serves only the profiles you +imported: + +```shell +curl -LsSfO https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/google-vertex-ai.yaml +openshell provider profile import -f google-vertex-ai.yaml --global +``` + ### Service Account Key Create the provider with the JSON key as gateway-only bootstrap material: diff --git a/docs/providers/profiles.mdx b/docs/providers/profiles.mdx index 06f17a42fb..e1774470e6 100644 --- a/docs/providers/profiles.mdx +++ b/docs/providers/profiles.mdx @@ -20,7 +20,7 @@ Provider profiles keep those pieces together: | Need | Profile-backed behavior | |---|---| -| Repeatable provider setup | Built-in and custom provider profiles define reusable provider types. | +| Repeatable provider setup | Imported provider profiles define reusable provider types. | | Provider-aware policy | Attached providers contribute `_provider_*` network policy entries to the effective sandbox policy. | | Custom provider definitions | You can export, edit, lint, import, list, and delete custom profiles. | | Runtime provider lifecycle | You can list, attach, and detach providers on existing sandboxes. | @@ -31,14 +31,14 @@ Provider profiles keep those pieces together: Provider profiles include these user-facing features: -- Built-in provider profiles loaded by the gateway by default. -- Gateway configuration can compose built-in, user-managed, and interceptor-vended profile sources. Selecting only an interceptor makes its catalog authoritative by omission. -- A user-managed profile shadows a built-in profile with the same ID in its applicable workspace or platform scope. The built-in remains the fallback outside that scope. Source-managed interceptor collisions still fail closed. +- An import-only catalog: the gateway serves the profiles you imported and nothing else. A gateway with none imported serves an empty catalog. +- Gateway configuration can compose user-managed and interceptor-vended profile sources. Selecting only an interceptor makes its catalog authoritative by omission. +- Platform-scoped and workspace-scoped profiles. A workspace profile takes precedence over a platform profile with the same ID inside that workspace, and the platform profile applies outside it. An interceptor-vended profile cannot share an ID with an imported one; that collision fails closed. - `openshell provider list-profiles` with table, YAML, and JSON output. - `openshell provider profile export`, `import`, `update`, `lint`, and `delete` for custom profiles. -- Provider instances created from built-in or imported profile IDs with `openshell provider create --type `. +- Provider instances created from imported profile IDs with `openshell provider create --type `. - Provider instances whose submitted credentials can be stored by a configured gateway credential driver. -- Profile-backed credential discovery for explicit `openshell provider create --from-existing` and `openshell provider update --from-existing` flows. The built-in `google-vertex-ai` profile also supplements discovery with Vertex config env vars such as `VERTEX_AI_PROJECT_ID` and `VERTEX_AI_REGION`. +- Profile-backed credential discovery for explicit `openshell provider create --from-existing` and `openshell provider update --from-existing` flows. The `google-vertex-ai` profile also supplements discovery with Vertex config env vars such as `VERTEX_AI_PROJECT_ID` and `VERTEX_AI_REGION`. - Just-in-time effective policy composition from sandbox policy plus attached provider profiles. - Runtime sandbox provider commands under `openshell sandbox provider list|attach|detach|status`, with an option to wait until the sandbox applies a change. - Credential refresh configuration with `openshell provider refresh status|configure|rotate|delete`. @@ -55,11 +55,13 @@ supply that boundary by default. For an endpointless profile, a sandbox policy endpoint can name the attached provider instance explicitly. The proxy checks the resulting association before it substitutes the real value. -The built-in `openai` and `anthropic` profiles bind credentials to their public +The example `openai` and `anthropic` profiles bind credentials to their public vendor endpoints. To use a proxy or compatible API at another host, import a -custom profile that declares that host and attach a provider created from that -profile. OpenShell never broadens a built-in profile's credential boundary from -a base URL environment variable alone. +separate profile that declares that host and attach a provider created from that +profile. OpenShell never broadens a profile's credential boundary from a base URL +environment variable alone: if a provider's `*_BASE_URL` points outside the hosts +its profile declares, the profile is treated as endpointless and its credential +binds only through explicit sandbox policy. A request can use a static credential only when all of these checks pass: @@ -220,51 +222,53 @@ List available profiles: openshell provider list-profiles ``` -By default the gateway lists built-in profiles plus custom profiles imported -through the profile APIs. When a configured gateway interceptor vends an -authoritative provider profile catalog, that catalog becomes the visible source -of truth: list, export, provider creation, policy composition, and sandbox -provider environment resolution use the interceptor-vended profiles instead of -built-in or user-imported profiles. +A gateway serves exactly the profiles you imported. OpenShell ships no profiles +inside the gateway binary, so a new gateway lists an empty catalog until you +import one. When a configured gateway interceptor vends an authoritative +provider profile catalog, that catalog becomes the visible source of truth: +list, export, provider creation, policy composition, and sandbox provider +environment resolution use the interceptor-vended profiles. + +### Import the Example Profiles + +The OpenShell repository ships example profiles for GitHub, PyPI, and the major +inference and agent providers in +[`providers/`](https://github.com/NVIDIA/OpenShell/tree/main/providers). They are +reviewable starting points, not platform defaults. + +Read a file's header before importing it. Each one names the client binaries it +expects, the image layout those paths assume, the credential scope, the endpoint +access it grants, and a smoke test. Several name paths that exist only in the +OpenShell Community image, such as `/sandbox/.venv` or +`/usr/lib/node_modules/@openai`. Imported unchanged into a different image the +profile matches nothing: the catalog still lists it, but the credential is never +injected and the traffic is denied. Copy the file, edit `binaries` and +`endpoints` for your image and workload, and import your copy. -Built-in provider profiles currently include: - -| Profile ID | Category | Credential environment variables | -|---|---|---| -| `anthropic` | `inference` | `ANTHROPIC_API_KEY` | -| `claude-code` | `agent` | `ANTHROPIC_API_KEY`, `CLAUDE_API_KEY` | -| `codex` | `agent` | `CODEX_AUTH_ACCESS_TOKEN`, `CODEX_AUTH_REFRESH_TOKEN`, `CODEX_AUTH_ACCOUNT_ID`, `CODEX_AUTH_ID_TOKEN` | -| `copilot` | `agent` | `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN` | -| `cursor` | `agent` | None | -| `deepinfra` | `inference` | `DEEPINFRA_API_KEY` | -| `github` | `source_control` | `GITHUB_TOKEN`, `GH_TOKEN` | -| `google-vertex-ai` | `inference` | `GOOGLE_SERVICE_ACCOUNT_KEY`, `GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN`, `VERTEX_AI_SERVICE_ACCOUNT_TOKEN`, `GOOGLE_VERTEX_AI_TOKEN`, `VERTEX_AI_TOKEN` | -| `nvidia` | `inference` | `NVIDIA_API_KEY` | -| `openai` | `inference` | `OPENAI_API_KEY` | -| `pypi` | `data` | None | - -Export a built-in profile as YAML: +Lint a profile before importing it: ```shell -openshell provider profile export github -o yaml > github-profile.yaml +openshell provider profile lint -f providers/github.yaml ``` -Lint a profile before importing it: +Import one profile file at platform scope: ```shell -openshell provider profile lint -f github-profile.yaml +openshell provider profile import -f providers/github.yaml --global ``` -Import one profile file: +Import all non-recursive `*.yaml`, `*.yml`, and `*.json` files from a directory: ```shell -openshell provider profile import -f github-profile.yaml +openshell provider profile import --from ./providers --global ``` -Import all non-recursive `*.yaml`, `*.yml`, and `*.json` files from a directory: +Omit `--global` to import into the current workspace instead. + +Export a profile as YAML, to edit or to keep before an upgrade: ```shell -openshell provider profile import --from ./provider-profiles +openshell provider profile export github -o yaml --global > github-profile.yaml ``` Import is create-only. It fails if a custom profile with the same ID already exists. @@ -278,7 +282,7 @@ openshell provider profile update github-profile -f github-profile.yaml Exported custom profiles include `resource_version`. OpenShell requires that version during update so stale files cannot silently overwrite newer profile definitions. The target ID in the command must match the profile ID in the file. Update accepts one file at a time. If an update would make dynamic token grants ambiguous for an attached sandbox, OpenShell rejects it before changing the profile. -Custom profile IDs must use lowercase kebab-case with `a-z`, `0-9`, and `-`. Built-in profile IDs and legacy provider aliases are reserved. Built-in and interceptor-managed profiles are read-only through the profile APIs. OpenShell also rejects deleting a custom profile while a sandbox-attached provider uses it. +Profile IDs must use lowercase kebab-case with `a-z`, `0-9`, and `-`. No IDs are reserved: `github`, `openai`, and every other example profile imports at its own ID, and the imported profile is the only definition for it. Interceptor-managed profiles are read-only through the profile APIs. OpenShell rejects deleting a profile while a sandbox-attached provider uses it. ### Category Enum @@ -559,9 +563,9 @@ The gateway only brokers an intermediate token for a sandbox principal, and only ## Provider Instances -A provider instance stores concrete credentials and config for a profile type. Built-in profile IDs and imported custom profile IDs are accepted by `--type`. +A provider instance stores concrete credentials and config for a profile type. `--type` accepts the ID of any imported profile, matched exactly. Creating a provider for a profile the gateway does not serve fails and names the import command. -Create a GitHub provider from the built-in `github` profile: +Create a GitHub provider from an imported `github` profile: ```shell openshell provider create \ @@ -581,11 +585,11 @@ openshell provider create \ `--from-existing` uses the provider profile's `discovery` section. If no profile exists for the requested type, the command fails instead of falling -back to the retired provider registry. The built-in `openai` profile discovers -`OPENAI_API_KEY`; the built-in `anthropic` profile discovers +back to the retired provider registry. The example `openai` profile discovers +`OPENAI_API_KEY`; the example `anthropic` profile discovers `ANTHROPIC_API_KEY`. -Create a provider from an imported custom profile: +Create a provider from another imported profile: ```shell openshell provider create \ @@ -863,7 +867,7 @@ includes credential values, opaque credential handles, or config values. OpenShell stores the base policy and provider attachments separately. When a sandbox asks for its effective policy, the gateway composes the current base policy with provider policy layers just in time. -For example, the built-in GitHub profile contains these endpoints and binaries: +For example, the GitHub example profile contains these endpoints and binaries: ```yaml wordWrap showLineNumbers={false} id: github diff --git a/docs/reference/gateway-config.mdx b/docs/reference/gateway-config.mdx index 04890f8843..abced28b74 100644 --- a/docs/reference/gateway-config.mdx +++ b/docs/reference/gateway-config.mdx @@ -165,9 +165,8 @@ grpc_rate_limit_requests = 120 grpc_rate_limit_window_seconds = 60 # Optional exact provider-profile source composition. When omitted, the -# gateway uses builtin + user. +# gateway uses imported profiles only. provider_profile_sources = [ - { type = "builtin" }, { type = "user" }, ] @@ -398,7 +397,9 @@ Bindings under `allowlist` and `exact` require `rpc` or `service` plus `method`, Bindings that include `post_commit` must resolve to `failure_policy = "fail_open"`; the gateway rejects fail-closed post-commit configuration at startup. Post-commit evaluation is observational. If response observation or interceptor evaluation fails after a handler succeeds, the gateway logs and counts the failure but returns the committed response unchanged. -`provider_profile_sources` selects the exact ordered provider-profile source set. Omit it to use the built-in and user-managed sources. Use `{ type = "builtin" }`, `{ type = "user" }`, and `{ type = "interceptor", name = "" }` entries to compose a catalog. An interceptor entry must reference a configured service whose manifest advertises `provider_profiles = true`. Selecting only an interceptor makes that catalog authoritative; include local sources explicitly to compose them. Empty or duplicate source lists, unknown interceptor names, and duplicate normalized profile IDs fail closed. Source order controls collection and diagnostics, not override precedence. +`provider_profile_sources` selects the exact ordered provider-profile source set. Omit it to use imported profiles only. Use `{ type = "user" }` and `{ type = "interceptor", name = "" }` entries to compose a catalog. An interceptor entry must reference a configured service whose manifest advertises `provider_profiles = true`. Selecting only an interceptor makes that catalog authoritative; include `{ type = "user" }` explicitly to compose imported profiles with it. Empty or duplicate source lists, unknown interceptor names, and duplicate normalized profile IDs fail closed. Source order controls collection and diagnostics, not override precedence. + +OpenShell ships no profiles inside the gateway binary. A gateway with nothing imported reaches ready and serves an empty catalog; import the profiles it needs with `openshell provider profile import`. The `builtin` source type was removed and a configuration that still names it is rejected at startup. For an authoritative interceptor catalog, select only that interceptor: diff --git a/docs/sandboxes/inference-routing.mdx b/docs/sandboxes/inference-routing.mdx index 7a6553adb3..b0234e9686 100644 --- a/docs/sandboxes/inference-routing.mdx +++ b/docs/sandboxes/inference-routing.mdx @@ -28,7 +28,7 @@ Start from an existing profile, review its access, and import it under a new ID. For example, export the NVIDIA profile: ```shell -openshell provider profile export nvidia -o yaml > nvidia-native.yaml +openshell provider profile export nvidia -o yaml --global > nvidia-native.yaml ``` In `nvidia-native.yaml`, change `id` to `nvidia-native`, give the profile a @@ -90,9 +90,11 @@ hosted service. Set a new profile ID, retain only the endpoints and credentials the workload needs, and name the actual client binaries. Provider attachment does not select or rewrite a model. -This release still loads built-in profiles for compatibility, so existing -providers continue to resolve their profiles. Treat those built-ins as starting -templates for new provider definitions rather than the primary setup workflow. +The gateway resolves a provider against the profiles you imported, so a provider +whose profile is missing fails at sandbox creation with a message naming the +profile and the import command. Treat the example profiles in +[`providers/`](https://github.com/NVIDIA/OpenShell/tree/main/providers) as +starting templates you copy and adapt, not as defaults. ## Attach a Provider to a Running Sandbox @@ -119,9 +121,11 @@ openshell sandbox provider detach inference-demo nvidia-prod ## Use a Custom or Self-hosted Endpoint -Do not reuse the built-in `openai` or `anthropic` profile for an alternate -host. Those profiles bind credentials to the public vendor endpoints. Import a -profile that names the intended endpoint and the binaries that may call it. +Do not reuse the `openai` or `anthropic` example profile for an alternate host. +Those profiles bind credentials to the public vendor endpoints, and a provider +that points `OPENAI_BASE_URL` elsewhere is treated as endpointless rather than +silently carrying the credential to the new host. Import a profile that names the +intended endpoint and the binaries that may call it. For a credentialless Ollama server on the gateway host, save this profile as `ollama-openai.yaml`: @@ -212,8 +216,9 @@ If the request is denied: OpenShell removed the workspace-global managed inference route and the `openshell inference` commands. Upgrades remove stored route records. Provider records, provider refresh configuration, and existing sandbox attachments are -preserved. Built-in profiles remain available during the transition, but new -setups should import an explicit profile under a new ID. +preserved. Import the profile each preserved provider refers to before the first +sandbox creation after the upgrade, and give new setups an explicit profile under +their own ID. The old route cannot be converted automatically. It applied one provider and model to every sandbox in a workspace, while provider attachments intentionally @@ -253,9 +258,9 @@ openshell sandbox provider attach inference-demo nvidia-native-prod ``` OpenShell does not export stored credential values or change a provider's -profile type in place. If the original credential source is unavailable, the -compatibility built-in lets you attach the preserved provider while you arrange -credential rotation into the replacement provider. +profile type in place. If the original credential source is unavailable, import +the original profile at its own ID so the preserved provider keeps resolving +while you arrange credential rotation into the replacement provider. Update each workload to: diff --git a/docs/sandboxes/manage-providers.mdx b/docs/sandboxes/manage-providers.mdx index 1b20185ce9..03260b6cce 100644 --- a/docs/sandboxes/manage-providers.mdx +++ b/docs/sandboxes/manage-providers.mdx @@ -37,7 +37,7 @@ The fastest way to create a provider is to let the CLI discover credentials from your shell environment: ```shell -openshell provider create --name my-claude --type claude --from-existing +openshell provider create --name my-claude --type claude-code --from-existing ``` This reads `ANTHROPIC_API_KEY` or `CLAUDE_API_KEY` from your current environment @@ -92,9 +92,9 @@ CLI refreshes it before storing the provider credential. It does not store the OIDC refresh token in the provider. `--from-existing` uses profile-backed discovery. The requested `--type` must -have a built-in or imported provider profile with a `discovery` section. If no -matching profile exists, the CLI returns an error instead of falling back to -legacy discovery. +name an imported provider profile with a `discovery` section. If no matching +profile exists, the CLI returns an error instead of falling back to legacy +discovery. Create a provider whose profile requires no static credentials without a credential source: @@ -117,8 +117,8 @@ openshell provider profile update my-api -f my-api-profile.yaml ``` Import remains create-only and fails if the profile ID already exists. Use -`provider profile update ` for existing custom profiles. Built-in profiles are -read-only. The target ID must match the profile ID in the file. Update accepts +`provider profile update ` for existing profiles. Interceptor-managed +profiles are read-only. The target ID must match the profile ID in the file. Update accepts one file at a time and rejects stale resource versions. Updated profile policy applies to all provider instances of that type on the next sandbox config sync. @@ -133,7 +133,7 @@ failure and continues with the remaining IDs. The command exits with an error after it attempts every requested deletion if any entry failed. -Static credentials require a built-in or imported provider profile. Profiles +Static credentials require an imported provider profile. Profiles normally define at least one endpoint. An endpointless profile requires an explicit `credential_binding.provider` on a sandbox policy endpoint. OpenShell does not activate static credentials from a profileless provider because it @@ -342,20 +342,23 @@ and `openshell sandbox provider detach`. See ### Auto-Discovery Shortcut -When the trailing command in `openshell sandbox create` maps to an available -profile, the CLI auto-creates the required provider from local profile -discovery if one does not already exist. You do not need to create the provider -separately: +Name a provider with `--provider`. If no provider by that name exists and the +name matches an imported profile ID, the CLI creates one from local profile +discovery, so you do not need to create it separately: ```shell -openshell sandbox create -- claude +openshell sandbox create --provider claude-code -- claude ``` -This detects `claude` as a known tool, finds your `ANTHROPIC_API_KEY`, creates -a provider, attaches it to the sandbox, and launches Claude Code. +This finds your `ANTHROPIC_API_KEY`, creates a `claude-code` provider, attaches +it to the sandbox, and launches Claude Code. Add `--auto-providers` to skip the +confirmation prompt, or `--no-auto-providers` to skip creation entirely. -If the inferred type has no built-in or imported profile, creation fails. Import -a custom profile first or pass an existing provider with `--provider `. +A provider is attached only when you name it. OpenShell does not derive one from +the trailing command: a profile's `binaries` list authorizes a binary to reach +that profile's endpoints, which is not a statement that running the binary asks +for the provider. A sandbox with no providers is a normal, fully supported +state. ## How Credential Injection Works @@ -423,51 +426,44 @@ Export the profile used by a provider to inspect its credential boundary: openshell provider profile export github -o yaml ``` -For the built-in GitHub profile, `GITHUB_TOKEN` and `GH_TOKEN` can resolve for +For the GitHub example profile, `GITHUB_TOKEN` and `GH_TOKEN` can resolve for the profile's `api.github.com:443` and `github.com:443` endpoints. Even if a sandbox policy allows `uploads.example.com:443`, sending either placeholder there returns `credential_endpoint_mismatch`. -For a custom service, define the credential in a custom provider profile. Put +For another service, define the credential in its own provider profile. Put stable endpoints in the profile, or leave the profile endpointless and bind each concrete provider instance from sandbox policy. Refer to [Profiles](/providers/profiles#provider-profiles) for the profile workflow and schema. -## Supported Provider Types +## Available Provider Types -The following provider types are supported. +The provider types available to `--type` are the IDs of the profiles you +imported. List them: -| Type | Environment Variables Injected | Typical Use | -|---|---|---| -| `anthropic` | `ANTHROPIC_API_KEY` | Anthropic API | -| `aws-bedrock` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_REGION` | Declarative Bedrock credential shape. The built-in profile does not grant a bridge or AWS endpoint; use an endpoint-bearing profile for direct access. | -| `claude` | `ANTHROPIC_API_KEY`, `CLAUDE_API_KEY` | Claude Code, Anthropic API | -| `codex` | `OPENAI_API_KEY` | OpenAI Codex | -| `copilot` | `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN` | GitHub Copilot CLI | -| `deepinfra` | `DEEPINFRA_API_KEY` | DeepInfra inference API | -| `github` | `GITHUB_TOKEN`, `GH_TOKEN` | GitHub API and `gh` CLI. Refer to [GitHub Sandbox](/get-started/tutorials/github-sandbox). | -| `nvidia` | `NVIDIA_API_KEY` | NVIDIA API Catalog | -| `openai` | `OPENAI_API_KEY` | Public OpenAI API. Use a custom endpoint-bearing profile for another OpenAI-compatible host. | +```shell +openshell provider list-profiles +``` + +The repository's +[`providers/`](https://github.com/NVIDIA/OpenShell/tree/main/providers) directory +ships example profiles for GitHub, PyPI, and the major inference and agent +providers. Each file's header states the credential environment variables it +declares, the binaries it authorizes, and the endpoints it grants. Read it, +adjust the binary paths for your image, and import your copy. `ANTHROPIC_API_KEY` is an API key from [console.anthropic.com](https://console.anthropic.com), not a subscription token. Subscription users must generate a separate API key from the Anthropic Console. - -For a service not listed above, import a custom provider profile that declares -its credential environment variables and endpoints. Use the imported profile -ID as the provider `--type`. - - - ## Inference Provider Access Attach an inference provider to each sandbox that needs it and configure the workload to call the provider's native endpoint. The workload, not OpenShell, selects the model and request timeout. -| Provider | Built-in profile | Native base URL | Credential variable | +| Provider | Example profile | Native base URL | Credential variable | |---|---|---|---| | OpenAI | `openai` | `https://api.openai.com/v1` | `OPENAI_API_KEY` | | Anthropic | `anthropic` | `https://api.anthropic.com` | `ANTHROPIC_API_KEY` | @@ -475,10 +471,10 @@ selects the model and request timeout. | DeepInfra | `deepinfra` | `https://api.deepinfra.com/v1/openai` | `DEEPINFRA_API_KEY` | | Google Vertex AI | `google-vertex-ai` | Region and model dependent | `GOOGLE_VERTEX_AI_TOKEN` or `GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN` | -An OpenAI-compatible protocol does not make the built-in `openai` profile safe -for an arbitrary host. Baseten, Bitdeer, Groq, Ollama, LM Studio, self-hosted -NIM, and other alternate endpoints need a custom profile that declares the -actual host, port, credential, and allowed binaries. See +An OpenAI-compatible protocol does not make the `openai` profile safe for an +arbitrary host. Baseten, Bitdeer, Groq, Ollama, LM Studio, self-hosted NIM, and +other alternate endpoints need their own profile declaring the actual host, +port, credential, and allowed binaries. See [Provider-backed Inference](/sandboxes/inference-routing) for complete examples and migration guidance. diff --git a/e2e/python/oidc/oidc_auth_test.py b/e2e/python/oidc/oidc_auth_test.py index 8b0a1f70f9..39e7a54e0c 100644 --- a/e2e/python/oidc/oidc_auth_test.py +++ b/e2e/python/oidc/oidc_auth_test.py @@ -54,7 +54,7 @@ def test_admin_can_create_provider(self) -> None: workspace_scope=datamodel_pb2.WorkspaceSelector(workspace="default"), provider=datamodel_pb2.Provider( metadata=datamodel_pb2.ObjectMeta(name="e2e-oidc-admin-test"), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "test-value"}, ), ) @@ -84,7 +84,7 @@ def test_user_cannot_create_provider(self) -> None: workspace_scope=datamodel_pb2.WorkspaceSelector(workspace="default"), provider=datamodel_pb2.Provider( metadata=datamodel_pb2.ObjectMeta(name="e2e-oidc-user-blocked"), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "test-value"}, ), ) diff --git a/e2e/python/oidc/workspace_authz_test.py b/e2e/python/oidc/workspace_authz_test.py index fe8ad4bcea..5a8a7b6f2b 100644 --- a/e2e/python/oidc/workspace_authz_test.py +++ b/e2e/python/oidc/workspace_authz_test.py @@ -255,7 +255,7 @@ def _workspace_rpcs() -> list[tuple[str, Callable]]: metadata=datamodel_pb2.ObjectMeta( name="authz-test", workspace=WS ), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "v"}, ), ), @@ -290,7 +290,7 @@ def _workspace_rpcs() -> list[tuple[str, Callable]]: metadata=datamodel_pb2.ObjectMeta( name="nonexistent", workspace=WS ), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "v"}, ), ), @@ -676,7 +676,7 @@ def seed_provider(self, admin_ctx: Any, workspace: str) -> Any: metadata=datamodel_pb2.ObjectMeta( name=prov_name, workspace=workspace ), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "test"}, ), ), @@ -1015,7 +1015,7 @@ def test_user_member_admin_operations_denied( metadata=datamodel_pb2.ObjectMeta( name="user-blocked", workspace=WS ), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "v"}, ), ), @@ -1084,7 +1084,7 @@ def test_workspace_admin_can_create_provider( workspace_scope=datamodel_pb2.WorkspaceSelector(workspace=WS), provider=datamodel_pb2.Provider( metadata=datamodel_pb2.ObjectMeta(name=prov_name, workspace=WS), - type="claude", + type="claude-code", credentials={"ANTHROPIC_API_KEY": "v"}, ), ), diff --git a/e2e/python/test_sandbox_providers.py b/e2e/python/test_sandbox_providers.py index d3af3f3ecb..72a4a90d36 100644 --- a/e2e/python/test_sandbox_providers.py +++ b/e2e/python/test_sandbox_providers.py @@ -297,7 +297,7 @@ def test_provider_credentials_available_as_env_vars( with provider( sandbox_client._stub, name="e2e-test-provider-env", - provider_type="claude", + provider_type="claude-code", credentials={"ANTHROPIC_API_KEY": "sk-e2e-test-key-12345"}, ) as provider_name: spec = datamodel_pb2.SandboxSpec( @@ -726,7 +726,7 @@ def test_credentials_not_in_persisted_spec_environment( with provider( sandbox_client._stub, name="e2e-test-no-persist", - provider_type="claude", + provider_type="claude-code", credentials={"ANTHROPIC_API_KEY": "sk-should-not-persist"}, ) as provider_name: spec = datamodel_pb2.SandboxSpec( diff --git a/e2e/rust/e2e-vm.sh b/e2e/rust/e2e-vm.sh index 5528c00871..8f687e5fed 100755 --- a/e2e/rust/e2e-vm.sh +++ b/e2e/rust/e2e-vm.sh @@ -388,6 +388,12 @@ export OPENSHELL_PROVISION_TIMEOUT="${SANDBOX_PROVISION_TIMEOUT}" e2e_run_openshell_conformance "VM" +# Seed the catalog once for the whole lane. The profiles live in the gateway +# for as long as it runs, and the import is create-only: a second import of +# the same directory fails with "custom provider profile '' already +# exists", so this cannot move inside the per-target helper below. +e2e_import_example_provider_profiles "${CLI_BIN}" "${ROOT}" || exit 1 + run_e2e_test() { local test_target="$1" shift diff --git a/e2e/rust/tests/oidc_pkce.rs b/e2e/rust/tests/oidc_pkce.rs index 8798670e7a..929f21b676 100644 --- a/e2e/rust/tests/oidc_pkce.rs +++ b/e2e/rust/tests/oidc_pkce.rs @@ -141,21 +141,21 @@ async fn user_can_create_sandbox() { delete_workspace(&admin, WORKSPACE).await; } -/// Workspace users must be able to create sandboxes with inferred-provider -/// commands (e.g. `claude`) without requiring Platform Admin access. +/// Workspace users must be able to resolve a provider profile when naming a +/// provider with `--provider`, without requiring Platform Admin access. #[tokio::test] #[serial(oidc_pkce)] -async fn user_can_create_sandbox_with_inferred_provider_command() { - const WORKSPACE: &str = "oidc-inferred-cmd"; +async fn user_can_resolve_provider_profile_for_sandbox() { + const WORKSPACE: &str = "oidc-named-provider"; let user = login_identity(USER).await; let admin = login_identity(ADMIN).await; prepare_workspace(&admin, &user, WORKSPACE, "user").await; let _lifecycle = SANDBOX_LIFECYCLE_LOCK.lock().await; - // Use `claude` as the command so the CLI infers provider type - // `claude-code`. The sandbox won't actually start (no provider - // credentials), but provider inference must remain available to a - // workspace user. + // `claude-code` names no existing provider, so the CLI has to look up the + // profile of that id before it can auto-create one. The lane imported the + // example profiles at platform scope; reaching them from a workspace is + // what this test guards. let output = run_workspace_cli( &user, WORKSPACE, @@ -163,21 +163,22 @@ async fn user_can_create_sandbox_with_inferred_provider_command() { "sandbox", "create", "--name", - "oidc-inferred-cmd", + "oidc-named-provider", "--no-tty", - "--", - "claude", + "--provider", + "claude-code", ], ) .await; let combined = combined_output(&output); - // The sandbox won't start because there are no provider credentials, - // but the error must be about the missing provider — NOT a - // platform-admin gate on GetGatewayConfig. + // The provider cannot be auto-created without a terminal to confirm at, + // so creation stops there. That error proves the profile lookup + // succeeded; a permission error would mean the workspace user was gated + // out of the catalog. assert!( !combined.to_ascii_lowercase().contains("platform admin"), - "workspace user hit a platform-admin gate on an inferred-provider command:\n{combined}" + "workspace user hit a platform-admin gate while resolving a provider profile:\n{combined}" ); assert!( combined.contains("missing required provider"), @@ -187,7 +188,7 @@ async fn user_can_create_sandbox_with_inferred_provider_command() { let _ = run_workspace_cli( &user, WORKSPACE, - &["sandbox", "delete", "oidc-inferred-cmd"], + &["sandbox", "delete", "oidc-named-provider"], ) .await; delete_workspace(&admin, WORKSPACE).await; diff --git a/e2e/support/gateway-common.sh b/e2e/support/gateway-common.sh index 93b09621ab..f9079c7bfd 100644 --- a/e2e/support/gateway-common.sh +++ b/e2e/support/gateway-common.sh @@ -146,6 +146,111 @@ EOF printf '%s' "${name}" >"${config_home}/openshell/active_gateway" } +# Import the example provider profiles at platform scope. +# +# OpenShell compiles no provider profile into a binary, so a freshly started +# gateway serves an empty catalog. The e2e suites exercise providers built from +# github, openai, nvidia and the rest, which means the lane has to import them +# first — the same step the upgrade notes give operators. +e2e_import_example_provider_profiles() { + local cli_bin=$1 + local root=$2 + + echo "Importing example provider profiles from ${root}/providers..." + if ! "${cli_bin}" provider profile import --from "${root}/providers" --global; then + echo "ERROR: failed to import example provider profiles" >&2 + return 1 + fi +} + +# Register an administrator OIDC session for a gateway, non-interactively. +# +# The browser PKCE flow the CLI normally uses cannot run unattended, so mint an +# admin access token with Keycloak's password grant and write the same token +# bundle `openshell gateway login` would have stored. Used only to establish a +# setup identity; the tests themselves still authenticate however they choose. +e2e_register_oidc_admin_session() { + local config_home=$1 + local name=$2 + local endpoint=$3 + local port=$4 + local issuer=$5 + local username=$6 + local password=$7 + local pki_dir=$8 + local cli_bin=$9 + local client_id="${10:-openshell-cli}" + local gateway_config_dir="${config_home}/openshell/gateways/${name}" + + # The OpenShell scopes are optional client scopes on openshell-cli, so + # Keycloak mints them only when they are asked for. Without an explicit + # scope the token carries the realm defaults alone and every authorized RPC + # fails with "scope '' required". + local token + token=$(curl -sf -X POST "${issuer}/protocol/openid-connect/token" \ + -d "grant_type=password" \ + -d "client_id=${client_id}" \ + -d "username=${username}" \ + -d "password=${password}" \ + --data-urlencode "scope=openid openshell:all" \ + | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])' 2>/dev/null) || true + + if [ -z "${token}" ]; then + echo "ERROR: could not obtain an admin OIDC token from ${issuer}" >&2 + return 1 + fi + + mkdir -p "${gateway_config_dir}" + + # Trust the gateway's self-signed serving certificate. Only the CA is + # installed: these lanes start the gateway without --tls-client-ca, and with + # no client cert/key on disk the CLI falls back to CA-only server + # verification and authenticates with the bearer token instead of an mTLS + # identity. + mkdir -p "${gateway_config_dir}/mtls" + cp "${pki_dir}/ca.crt" "${gateway_config_dir}/mtls/ca.crt" + + # auth_mode must be "oidc": the CLI dispatches on this field alone when + # deciding to load a stored bearer token, so omitting it leaves + # oidc_token.json on disk and unread, and the request goes unauthenticated. + cat >"${gateway_config_dir}/metadata.json" <"${gateway_config_dir}/oidc_token.json" <"${config_home}/openshell/active_gateway" + + # Assert the CLI reaches the gateway as an authenticated administrator before + # anything depends on it. ListProviderProfiles is annotated + # auth_mode: "bearer", so it cannot succeed unless the stored token was + # loaded and accepted -- this fails here, with the cause named, rather than + # surfacing later as an opaque profile import error. + if ! "${cli_bin}" provider list-profiles --global --output json >/dev/null 2>&1; then + echo "ERROR: the CLI could not make an authenticated call as the OIDC administrator" >&2 + echo " gateway config: ${gateway_config_dir}" >&2 + echo " CLI output follows:" >&2 + "${cli_bin}" provider list-profiles --global --output json >&2 || true + return 1 + fi + + echo "Established an authenticated OIDC administrator session for '${name}'." +} + e2e_toml_string() { local value="$1" value="${value//\\/\\\\}" diff --git a/e2e/with-docker-gateway.sh b/e2e/with-docker-gateway.sh index 95c6d6e3c4..5a8c904e6a 100755 --- a/e2e/with-docker-gateway.sh +++ b/e2e/with-docker-gateway.sh @@ -706,5 +706,23 @@ if [ "${elapsed}" -ge "${timeout}" ]; then exit 1 fi +# Seed the example profiles the provider tests rely on. The mTLS lanes already +# have a registered gateway identity; the OIDC lanes deliberately skip +# registration and have no token yet, so establish an administrator session +# first rather than importing unauthenticated. +if [ "${OIDC_MODE}" = "1" ]; then + e2e_register_oidc_admin_session \ + "${XDG_CONFIG_HOME}" \ + "${GATEWAY_NAME}" \ + "${CLI_GATEWAY_ENDPOINT}" \ + "${HOST_PORT}" \ + "${OIDC_ISSUER}" \ + "${OPENSHELL_E2E_OIDC_USERNAME:-admin@test}" \ + "${OPENSHELL_E2E_OIDC_PASSWORD:-admin}" \ + "${PKI_DIR}" \ + "${CLI_BIN}" || exit 1 +fi +e2e_import_example_provider_profiles "${CLI_BIN}" "${ROOT}" || exit 1 + echo "Running e2e command against ${CLI_GATEWAY_ENDPOINT}: $*" "$@" diff --git a/e2e/with-kube-gateway.sh b/e2e/with-kube-gateway.sh index 9588015fa1..c4ed805293 100755 --- a/e2e/with-kube-gateway.sh +++ b/e2e/with-kube-gateway.sh @@ -566,6 +566,9 @@ run_scenario() { export OPENSHELL_E2E_SANDBOX_NAMESPACE="${NAMESPACE}" export OPENSHELL_PROVISION_TIMEOUT="${OPENSHELL_PROVISION_TIMEOUT:-300}" + e2e_import_example_provider_profiles \ + "${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" "${ROOT}" || return 1 + echo "Running e2e command against ${GATEWAY_ENDPOINT}: ${E2E_CMD[*]}" "${E2E_CMD[@]}" || scenario_exit=$? @@ -1209,6 +1212,9 @@ else export OPENSHELL_E2E_SANDBOX_NAMESPACE="${NAMESPACE}" export OPENSHELL_PROVISION_TIMEOUT="${OPENSHELL_PROVISION_TIMEOUT:-300}" + e2e_import_example_provider_profiles \ + "${OPENSHELL_BIN:-${ROOT}/target/debug/openshell}" "${ROOT}" || exit 1 + echo "Running e2e command against ${GATEWAY_ENDPOINT}: $*" "$@" fi diff --git a/e2e/with-podman-gateway.sh b/e2e/with-podman-gateway.sh index 058b389af1..76750199b7 100755 --- a/e2e/with-podman-gateway.sh +++ b/e2e/with-podman-gateway.sh @@ -919,5 +919,23 @@ if [ -n "${OPENSHELL_E2E_EXPECTED_CONFORMANCE_SHA256:-}" ]; then require_expected_sha256 "conformance CLI" "${OPENSHELL_CONFORMANCE_BIN}" \ "${OPENSHELL_E2E_EXPECTED_CONFORMANCE_SHA256}" fi +# Seed the example profiles the provider tests rely on. The mTLS lanes already +# have a registered gateway identity; the OIDC lanes deliberately skip +# registration and have no token yet, so establish an administrator session +# first rather than importing unauthenticated. +if [ "${OIDC_MODE}" = "1" ]; then + e2e_register_oidc_admin_session \ + "${XDG_CONFIG_HOME}" \ + "${GATEWAY_NAME}" \ + "${CLI_GATEWAY_ENDPOINT}" \ + "${HOST_PORT}" \ + "${OIDC_ISSUER}" \ + "${OPENSHELL_E2E_OIDC_USERNAME:-admin@test}" \ + "${OPENSHELL_E2E_OIDC_PASSWORD:-admin}" \ + "${PKI_DIR}" \ + "${CLI_BIN}" || exit 1 +fi +e2e_import_example_provider_profiles "${CLI_BIN}" "${ROOT}" || exit 1 + echo "Running e2e command against ${CLI_GATEWAY_ENDPOINT}: $*" "$@" diff --git a/examples/governance-interceptor/README.md b/examples/governance-interceptor/README.md index ad1e5d486b..bf528f6c57 100644 --- a/examples/governance-interceptor/README.md +++ b/examples/governance-interceptor/README.md @@ -78,8 +78,8 @@ YAML files do not need an `id` field; if one is present, the filename still wins The interceptor advertises `provider_profiles = true` in its manifest and vends the current profile set through `SnapshotProviderProfiles`. The gateway config selects the interceptor as its only provider profile source, so -`provider list-profiles` shows only `github` and `slack`; built-in and user -sources are omitted. The example signs each profile's canonical protobuf payload +`provider list-profiles` shows only `github` and `slack`; the user source is +omitted, so imported profiles do not appear beside them. The example signs each profile's canonical protobuf payload and exposes the JWT under `annotations["openshell.nvidia.com/profile-signature"]`; the signed hash and key ID are exposed beside it. These annotations demonstrate logic an interceptor diff --git a/examples/governance-interceptor/smoke.sh b/examples/governance-interceptor/smoke.sh index 8e777f921f..e4ddcbca80 100755 --- a/examples/governance-interceptor/smoke.sh +++ b/examples/governance-interceptor/smoke.sh @@ -440,8 +440,19 @@ configure_gateway() { run_suite() { expect_output_contains "lists github profile" "github" "${CLI[@]}" provider list-profiles expect_output_contains "lists slack profile" "slack" "${CLI[@]}" provider list-profiles - expect_output_not_contains "hides codex profile" "codex" "${CLI[@]}" provider list-profiles - expect_output_not_contains "hides google cloud profile" "google-cloud" "${CLI[@]}" provider list-profiles + # The interceptor is the only configured source, so a profile imported into + # the user source stays out of the catalog. + cat >"$TMPDIR/unvended-profile.yaml" <<'EOF' +id: unvended-api +display_name: Unvended API +category: other +endpoints: + - host: api.unvended.example + port: 443 +binaries: [/usr/bin/curl] +EOF + "${CLI[@]}" provider profile import -f "$TMPDIR/unvended-profile.yaml" --global >/dev/null 2>&1 || true + expect_output_not_contains "hides profiles the interceptor does not vend" "unvended-api" "${CLI[@]}" provider list-profiles expect_output_contains "github profile has governance profile signature" "openshell.nvidia.com/profile-signature" "${CLI[@]}" provider profile export github -o json expect_output_contains "github profile has governance profile hash" "openshell.nvidia.com/profile-hash" "${CLI[@]}" provider profile export github -o json diff --git a/proto/datamodel.proto b/proto/datamodel.proto index f34d8a0098..7506360d67 100644 --- a/proto/datamodel.proto +++ b/proto/datamodel.proto @@ -108,7 +108,8 @@ message Provider { reserved "credential_expires_at_ms"; // Kubernetes-style metadata (id, name, labels, timestamps, resource version). ObjectMeta metadata = 1; - // Canonical provider type slug (for example: "claude", "gitlab"). + // ID of the provider profile this provider was created from, matched + // exactly (for example: "claude-code", "github"). string type = 2; // Secret values used for authentication. map credentials = 3 [(openshell.options.v1.secret) = true]; diff --git a/providers/README.md b/providers/README.md new file mode 100644 index 0000000000..740bb05f12 --- /dev/null +++ b/providers/README.md @@ -0,0 +1,54 @@ + + +# Example provider profiles + +These files are reviewable examples. OpenShell does not compile them into any +binary and no gateway loads them on its own: a gateway's profile catalog +contains exactly what an operator imported. + +Import one at platform scope: + +```shell +openshell provider profile lint -f providers/github.yaml +openshell provider profile import -f providers/github.yaml --global +``` + +Or import the whole directory: + +```shell +openshell provider profile import --from providers --global +``` + +Drop `--global` to import into the current workspace instead. + +## Read the header before importing + +Every file opens with a comment block naming its expected client binaries, the +image layout those paths assume, the credential scope, the endpoint access it +grants, and a smoke test. Read it. A profile's `binaries` list is the control +that decides which processes may reach its endpoints, and several of these +examples name paths that only exist in the OpenShell Community image +(`/sandbox/.venv`, `/app/.venv`, `/sandbox/.cursor-server`, +`/usr/lib/node_modules/...`). Imported unchanged into a different image, such a +profile matches nothing: the catalog still advertises it, but the credential is +never injected and the traffic is denied. + +Copy the file, edit `binaries` and `endpoints` to match your image and your +workload, and import your copy. + +## Adapting one + +- Give your copy a distinct `id` if it diverges from the example, so the two + cannot be confused in the catalog. +- Keep `binaries` as narrow as the workload allows. Widening it to match every + image trades away the binary-scoped least privilege that makes credential + injection safe. +- Keep `endpoints` limited to the hosts the credential should reach. A + credential is only sent to the endpoints its profile declares. +- Run `openshell provider profile lint` before importing. + +See [Provider profiles](https://docs.nvidia.com/openshell/latest/providers/profiles.html) for the +full schema. diff --git a/providers/anthropic.yaml b/providers/anthropic.yaml index 752bff6e4f..53c5917425 100644 --- a/providers/anthropic.yaml +++ b/providers/anthropic.yaml @@ -1,6 +1,25 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/anthropic.yaml +# openshell provider profile import -f providers/anthropic.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: curl. +# Reference layout: curl at /usr/bin/curl or /usr/local/bin/curl. Add the SDK +# interpreter (for example /usr/bin/python3) if the workload +# calls the API through a library instead of curl. +# Credential scope: ANTHROPIC_API_KEY, sent as the x-api-key header to +# api.anthropic.com and nowhere else. Pointing a client at a +# different base URL does not carry the credential with it. +# Endpoint access: api.anthropic.com, read-write, L7 enforced. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS https://api.anthropic.com/v1/models + id: anthropic display_name: Anthropic description: Anthropic inference API diff --git a/providers/aws-bedrock.yaml b/providers/aws-bedrock.yaml index d009673439..fa50881b60 100644 --- a/providers/aws-bedrock.yaml +++ b/providers/aws-bedrock.yaml @@ -1,6 +1,27 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/aws-bedrock.yaml +# openshell provider profile import -f providers/aws-bedrock.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: none declared, by design — see the description below. +# Reference layout: any image that can reach your Bedrock bridge. The bridge, +# not this profile, declares its own egress endpoint and +# binary attribution. +# Credential scope: the AWS_* credentials below are declarative schema only. +# Nothing is required, nothing is auto-discovered, and the +# router does not inject them on outbound requests. +# Endpoint access: none. Selecting this profile deliberately does not open a +# path to AWS; point BEDROCK_BASE_URL at your bridge and grant +# that host through your own policy. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS "$BEDROCK_BASE_URL/model/anthropic.claude-3-5-sonnet-20241022-v2:0/invoke" + id: aws-bedrock display_name: AWS Bedrock description: | diff --git a/providers/aws-s3.yaml b/providers/aws-s3.yaml index f51ffedb9a..a3f13625c7 100644 --- a/providers/aws-s3.yaml +++ b/providers/aws-s3.yaml @@ -1,6 +1,33 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/aws-s3.yaml +# openshell provider profile import -f providers/aws-s3.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: python, python3, curl, aws, bash. +# Reference layout: the venv and uv paths below (/sandbox/.venv, +# /sandbox/.uv/python) are OpenShell Community image paths, +# and /usr/local/bin/aws assumes the AWS CLI v2 installer. +# Edit `binaries` to match your image before importing. +# `binaries` also matches a process's ancestors, so the +# /bin/bash entry reaches every process descended from a +# shell — far broader than the other entries. Review it +# against your workload before importing. +# Credential scope: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and +# AWS_SESSION_TOKEN, minted by the gateway with one STS +# AssumeRole call. The proxy re-signs requests with SigV4 for +# the s3 service, so the sandbox never holds a usable +# long-lived key. +# Endpoint access: the S3 regional, dualstack and virtual-hosted-style hosts, +# read-write, TLS terminated for SigV4 signing. +# Smoke test: openshell sandbox create --provider -- \ +# aws s3 ls s3:// + id: aws-s3 display_name: AWS S3 description: AWS S3 storage via STS temporary credentials diff --git a/providers/aws.yaml b/providers/aws.yaml index 90f13765f0..087b3ac1d4 100644 --- a/providers/aws.yaml +++ b/providers/aws.yaml @@ -1,6 +1,30 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/aws.yaml +# openshell provider profile import -f providers/aws.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: none declared — this profile grants no egress. +# Reference layout: any image with an AWS SDK or the aws CLI. Credentials arrive +# as the standard AWS_* environment variables, so clients pick +# them up without configuration. +# Credential scope: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and +# AWS_SESSION_TOKEN, minted by the gateway with one STS +# AssumeRole call and rotated before expiry. The role ARN and +# any long-lived source keys stay at the gateway; configure +# them with `openshell provider refresh configure`. +# Endpoint access: none. The profile declares no endpoints, so it grants no +# network access on its own — pair it with a sandbox policy +# or another profile (see aws-s3.yaml) that names the AWS +# hosts the workload needs. +# Smoke test: openshell sandbox create --provider -- \ +# aws sts get-caller-identity + id: aws display_name: AWS description: Generic AWS access via STS temporary credentials diff --git a/providers/claude-code.yaml b/providers/claude-code.yaml index 341853252f..dcfde7f7e8 100644 --- a/providers/claude-code.yaml +++ b/providers/claude-code.yaml @@ -1,6 +1,27 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/claude-code.yaml +# openshell provider profile import -f providers/claude-code.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: claude. +# Reference layout: the Claude Code CLI at /usr/bin/claude or +# /usr/local/bin/claude. An npm global install resolves +# elsewhere (for example /usr/lib/node_modules/@anthropic-ai/**); +# add that path if your image installs it that way. +# Credential scope: ANTHROPIC_API_KEY or CLAUDE_API_KEY, sent as the x-api-key +# header to the endpoints below and nowhere else. +# Endpoint access: api.anthropic.com for inference; statsig.anthropic.com and +# sentry.io for the CLI's telemetry and error reporting. Drop +# the last two if your policy forbids that traffic. +# Smoke test: openshell sandbox create --provider -- \ +# claude -p 'reply with OK' + id: claude-code display_name: Claude Code description: Claude Code CLI diff --git a/providers/codex.yaml b/providers/codex.yaml index 7edd86a975..c9572a0a1b 100644 --- a/providers/codex.yaml +++ b/providers/codex.yaml @@ -1,6 +1,28 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/codex.yaml +# openshell provider profile import -f providers/codex.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: codex. +# Reference layout: /usr/bin/codex or /usr/local/bin/codex, plus the npm global +# install at /usr/lib/node_modules/@openai/**. The npm path is +# an OpenShell Community image layout; check where `npm root +# -g` points in your image. +# Credential scope: the CODEX_AUTH_* OAuth tokens and account id. They are +# injected into the sandbox environment for the codex CLI to +# read; only the endpoints below are reachable with them. +# Endpoint access: api.openai.com and chatgpt.com for inference, +# auth.openai.com for token refresh, ab.chatgpt.com for the +# CLI's experiment lookups. +# Smoke test: openshell sandbox create --provider -- \ +# codex exec 'reply with OK' + id: codex display_name: Codex description: OpenAI Codex CLI diff --git a/providers/copilot.yaml b/providers/copilot.yaml index cc7e5145c3..7a9419a1fc 100644 --- a/providers/copilot.yaml +++ b/providers/copilot.yaml @@ -1,6 +1,28 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/copilot.yaml +# openshell provider profile import -f providers/copilot.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: copilot. +# Reference layout: /usr/bin/copilot plus the npm global install under +# /usr/lib/node_modules/@github/copilot/**. That npm path is +# an OpenShell Community image layout; check `npm root -g` in +# your image. +# Credential scope: COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN, sent as a +# bearer authorization header to the Copilot API hosts below. +# Endpoint access: the githubcopilot.com API hosts (individual, business and +# enterprise variants) read-write and L7 enforced. The two +# telemetry hosts are L4 passthrough and do not receive the +# credential; drop them if your policy forbids telemetry. +# Smoke test: openshell sandbox create --provider -- \ +# copilot -p 'reply with OK' + id: copilot display_name: GitHub Copilot description: GitHub Copilot CLI and Copilot service APIs diff --git a/providers/cursor.yaml b/providers/cursor.yaml index a8899bb166..8f60619381 100644 --- a/providers/cursor.yaml +++ b/providers/cursor.yaml @@ -1,6 +1,25 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/cursor.yaml +# openshell provider profile import -f providers/cursor.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: curl, wget, and the Cursor remote server. +# Reference layout: the server path below (/sandbox/.cursor-server/**) is where +# Cursor unpacks itself when it connects to an OpenShell +# Community image over SSH. A different HOME or user means a +# different path — check where the server actually lands. +# Credential scope: none. This profile only opens the bootstrap and update +# endpoints; Cursor authenticates the user separately. +# Endpoint access: the Cursor download, update and API hosts, L4 passthrough. +# Smoke test: connect Cursor to the sandbox over SSH and confirm the +# remote server downloads and attaches. + id: cursor display_name: Cursor description: Cursor editor server bootstrap and update endpoints diff --git a/providers/deepinfra.yaml b/providers/deepinfra.yaml index ffc2e3e412..f4dfb669d7 100644 --- a/providers/deepinfra.yaml +++ b/providers/deepinfra.yaml @@ -1,6 +1,23 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/deepinfra.yaml +# openshell provider profile import -f providers/deepinfra.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: curl. +# Reference layout: curl at /usr/bin/curl or /usr/local/bin/curl. Add the SDK +# interpreter if the workload calls the API through a library. +# Credential scope: DEEPINFRA_API_KEY, sent as a bearer authorization header to +# api.deepinfra.com and nowhere else. +# Endpoint access: api.deepinfra.com, read-write, L7 enforced. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS https://api.deepinfra.com/v1/openai/models + id: deepinfra display_name: DeepInfra description: DeepInfra inference endpoints diff --git a/providers/github.yaml b/providers/github.yaml index 4f23c2e3d8..3854d2cdc8 100644 --- a/providers/github.yaml +++ b/providers/github.yaml @@ -1,6 +1,24 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/github.yaml +# openshell provider profile import -f providers/github.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: gh, git (git's git-remote-https helper matches by ancestry). +# Reference layout: gh and git on PATH at /usr/bin or /usr/local/bin +# (Debian/Ubuntu `apt install git gh`, Alpine `apk add git github-cli`). +# Credential scope: GITHUB_TOKEN or GH_TOKEN, sent as a bearer authorization +# header to the endpoints below and nowhere else. +# Endpoint access: api.github.com REST and GraphQL read-only; github.com +# clone/fetch only. Push (git-receive-pack) stays denied. +# Smoke test: openshell sandbox create --provider -- \ +# git clone --depth 1 https://github.com/octocat/Hello-World.git /tmp/hw + id: github display_name: GitHub description: GitHub API and Git operations diff --git a/providers/google-cloud.yaml b/providers/google-cloud.yaml index 77ed72e1c9..17fa04fa14 100644 --- a/providers/google-cloud.yaml +++ b/providers/google-cloud.yaml @@ -1,6 +1,31 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/google-cloud.yaml +# openshell provider profile import -f providers/google-cloud.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: none declared — this profile grants no egress. +# Reference layout: any image whose GCP SDKs honour the metadata server. The +# sandbox reaches credentials through OpenShell's GCE metadata +# emulator, so gcloud, google-cloud-* libraries and anything +# else using Application Default Credentials work unmodified. +# Credential scope: a gateway-refreshed GCP access token, as GCP_SA_ACCESS_TOKEN +# (service-account JWT flow) or GCP_ADC_ACCESS_TOKEN (gcloud +# ADC flow). Configure the refresh material with +# `openshell provider refresh configure`; the private key and +# refresh token stay at the gateway and are never injected. +# Endpoint access: none. The profile declares no endpoints, so it grants no +# network access on its own. Add the Google API hosts your +# workload needs to the sandbox policy, or import a profile +# that declares them. +# Smoke test: openshell sandbox create --provider -- \ +# gcloud auth print-access-token + id: google-cloud display_name: Google Cloud (GCP APIs) description: Native GCP SDK credentials for sandboxes via metadata emulator diff --git a/providers/google-vertex-ai.yaml b/providers/google-vertex-ai.yaml index 86be2e4301..a0994e413e 100644 --- a/providers/google-vertex-ai.yaml +++ b/providers/google-vertex-ai.yaml @@ -1,6 +1,31 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/google-vertex-ai.yaml +# openshell provider profile import -f providers/google-vertex-ai.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: none declared. Add the binaries that call Vertex — the SDK +# interpreter, curl, or an agent CLI — before relying on +# binary-scoped attribution for this profile. +# Reference layout: any image with a Vertex-capable client. The profile also +# projects VERTEX_AI_PROJECT_ID and VERTEX_AI_REGION into the +# sandbox so SDKs and agent CLIs pick up the target project. +# Credential scope: a gateway-refreshed Google access token, as +# GOOGLE_VERTEX_AI_SERVICE_ACCOUNT_TOKEN (service-account JWT) +# or GOOGLE_VERTEX_AI_TOKEN (gcloud ADC), sent as a bearer +# authorization header. GOOGLE_SERVICE_ACCOUNT_KEY is refresh +# bootstrap material and is never injected into the sandbox. +# Endpoint access: the aiplatform.googleapis.com regional and replicated hosts, +# read-write, L7 enforced. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS -H "Authorization: Bearer $GOOGLE_VERTEX_AI_TOKEN" \ +# https://us-central1-aiplatform.googleapis.com/v1/projects/$VERTEX_AI_PROJECT_ID/locations/us-central1/publishers/google/models + id: google-vertex-ai display_name: Google Vertex AI description: Google Vertex AI inference provider (Anthropic Claude, Gemini, and third-party models) diff --git a/providers/nvidia.yaml b/providers/nvidia.yaml index d056a08de2..d334aec8a6 100644 --- a/providers/nvidia.yaml +++ b/providers/nvidia.yaml @@ -1,6 +1,23 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/nvidia.yaml +# openshell provider profile import -f providers/nvidia.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: curl. +# Reference layout: curl at /usr/bin/curl or /usr/local/bin/curl. Add the SDK +# interpreter if the workload calls the API through a library. +# Credential scope: NVIDIA_API_KEY, sent as a bearer authorization header to +# integrate.api.nvidia.com and nowhere else. +# Endpoint access: integrate.api.nvidia.com, read-write, L7 enforced. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS https://integrate.api.nvidia.com/v1/models + id: nvidia display_name: NVIDIA description: NVIDIA inference endpoints diff --git a/providers/openai.yaml b/providers/openai.yaml index fe09cb0ed4..552afd66a6 100644 --- a/providers/openai.yaml +++ b/providers/openai.yaml @@ -1,6 +1,25 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/openai.yaml +# openshell provider profile import -f providers/openai.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: curl. +# Reference layout: curl at /usr/bin/curl or /usr/local/bin/curl. Add the SDK +# interpreter if the workload calls the API through a library. +# Credential scope: OPENAI_API_KEY, sent as a bearer authorization header to +# api.openai.com and nowhere else. For an OpenAI-compatible +# service on another host, import a separate profile naming +# that host — do not repoint this one. +# Endpoint access: api.openai.com, read-write, L7 enforced. +# Smoke test: openshell sandbox create --provider -- \ +# curl -sS https://api.openai.com/v1/models + id: openai display_name: OpenAI description: OpenAI inference API diff --git a/providers/pypi.yaml b/providers/pypi.yaml index c129b45d56..73c9573e19 100644 --- a/providers/pypi.yaml +++ b/providers/pypi.yaml @@ -1,6 +1,29 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# Example provider profile. OpenShell does not load it; import it explicitly: +# openshell provider profile lint -f providers/pypi.yaml +# openshell provider profile import -f providers/pypi.yaml --global +# +# Copy and edit this file rather than importing it unchanged. `binaries` is the +# least-privilege control that decides which processes may reach the endpoints +# below, so it has to name the paths in *your* image. +# +# Client binaries: python, python3, pip, uv. +# Reference layout: the paths below are OpenShell Community image paths — a +# virtualenv at /sandbox/.venv or /app/.venv, uv at +# /usr/local/bin/uv, uv-managed interpreters under +# /sandbox/.uv/python. Almost every other image differs +# (/usr/bin/python3, /usr/local/bin/pip, a venv elsewhere). +# Edit `binaries` before importing or the profile is inert. +# Credential scope: none. PyPI access here is anonymous. +# Endpoint access: pypi.org and files.pythonhosted.org for packages; +# downloads.python.org for interpreters; github.com, +# api.github.com and objects.githubusercontent.com for +# sdists that build from a Git source. +# Smoke test: openshell sandbox create --provider -- \ +# python -m pip download --no-deps -d /tmp/wheels requests + id: pypi display_name: PyPI description: Python package installation from PyPI and related package sources diff --git a/sdk/go/proto/datamodelv1/datamodel.pb.go b/sdk/go/proto/datamodelv1/datamodel.pb.go index b1566376c8..917f9bbc59 100644 --- a/sdk/go/proto/datamodelv1/datamodel.pb.go +++ b/sdk/go/proto/datamodelv1/datamodel.pb.go @@ -497,7 +497,8 @@ type Provider struct { state protoimpl.MessageState `protogen:"open.v1"` // Kubernetes-style metadata (id, name, labels, timestamps, resource version). Metadata *ObjectMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // Canonical provider type slug (for example: "claude", "gitlab"). + // ID of the provider profile this provider was created from, matched + // exactly (for example: "claude-code", "github"). Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // Secret values used for authentication. Credentials map[string]string `protobuf:"bytes,3,rep,name=credentials,proto3" json:"credentials,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` diff --git a/skills/debug-openshell-cluster/SKILL.md b/skills/debug-openshell-cluster/SKILL.md index c0a30f14a7..e53f571108 100644 --- a/skills/debug-openshell-cluster/SKILL.md +++ b/skills/debug-openshell-cluster/SKILL.md @@ -148,7 +148,7 @@ journalctl -u --no-pager --lines=200 journalctl -u openshell-gateway --no-pager --lines=200 ``` -The gateway calls each interceptor's `Describe` RPC and validates its manifest at startup. Check for unreachable endpoints, invalid RPC/phase bindings, strict `allowlist` or `exact` mismatches, and `post_commit` bindings that resolve to `fail_closed`. If gateway JWT signing is enabled, authenticated network interceptors require HTTPS and a valid bearer token; check the private CA path, endpoint hostname, expected audience, issuer, `kid`, and interceptor logs for token rejection. `allow_insecure_transport = true` explicitly preserves unauthenticated plaintext behavior. If `provider_profile_sources` names an interceptor, that interceptor must advertise provider-profile capability and return a valid, duplicate-free catalog. A selected interceptor-only source is authoritative; include `builtin` or `user` sources explicitly when composition is intended. +The gateway calls each interceptor's `Describe` RPC and validates its manifest at startup. Check for unreachable endpoints, invalid RPC/phase bindings, strict `allowlist` or `exact` mismatches, and `post_commit` bindings that resolve to `fail_closed`. If gateway JWT signing is enabled, authenticated network interceptors require HTTPS and a valid bearer token; check the private CA path, endpoint hostname, expected audience, issuer, `kid`, and interceptor logs for token rejection. `allow_insecure_transport = true` explicitly preserves unauthenticated plaintext behavior. If `provider_profile_sources` names an interceptor, that interceptor must advertise provider-profile capability and return a valid, duplicate-free catalog. A selected interceptor-only source is authoritative; include a `user` source explicitly when composition is intended. The `builtin` source type was removed: a config that still names it is rejected at startup. If the deployment uses supervisor middleware, follow the [supervisor middleware troubleshooting reference](references/supervisor-middleware.md) @@ -775,8 +775,12 @@ credential failures. | Edge or OIDC gateway returns `Unauthenticated` | Stored login expired, audience/scopes mismatch, or gateway auth configuration changed | `openshell gateway info`, `openshell gateway login `, gateway auth logs | | Gateway exits during OIDC initialization | Issuer is not HTTPS, discovery redirected, metadata used a non-JSON media type or exceeded its size limit, or `jwks_uri` uses an untrusted origin | Use an HTTPS issuer; mount a private CA with `server.oidc.caConfigMapName`; keep JWKS on the issuer origin or explicitly add its HTTPS origin to `server.oidc.jwksAllowedOrigins`. Numeric-loopback HTTP is development-only and also requires `server.oidc.dangerouslyAllowInsecureHttp=true` | | Gateway fails before serving health after enabling an interceptor | Interceptor endpoint unavailable or manifest/binding validation failed | Gateway and interceptor logs; interceptor socket; `binding_policy`, phases, and failure policy | -| Authenticated interceptor rejects gateway calls | Private CA or hostname mismatch, expected audience or issuer mismatch, stale/unknown `kid`, or malformed extension token | `tls_ca_cert_path`, registration `audience`, service verifier config and logs; fetch well-known metadata only through the already-trusted gateway TLS endpoint | -| Provider profiles disappear after enabling an interceptor catalog | `provider_profile_sources` selected only an authoritative interceptor or returned invalid/duplicate IDs | Inspect source list and interceptor `Describe`/catalog logs; include `builtin` and `user` when intended | +| Authenticated interceptor or middleware rejects gateway calls | Private CA or hostname mismatch, expected audience or issuer mismatch, stale/unknown `kid`, or malformed extension token | `tls_ca_cert_path`, registration `audience`, service verifier config and logs; fetch well-known metadata only through the already-trusted gateway TLS endpoint | +| Provider profiles disappear after enabling an interceptor catalog | `provider_profile_sources` selected only an authoritative interceptor or returned invalid/duplicate IDs | Inspect source list and interceptor `Describe`/catalog logs; include `user` when composition with imported profiles is intended | +| `provider list-profiles` is empty on a new gateway | Profiles are import-only and nothing has been imported | Import with `openshell provider profile import --from providers --global`; an empty catalog is a valid ready state, not a failure | +| Sandbox create or provider attach fails naming a missing profile | The provider's profile was never imported, was deleted, or lives at another scope | Import it at the scope the provider uses; the error names the profile ID and the command | +| Gateway fails after registering supervisor middleware | Service unavailable, invalid manifest, duplicate binding, reserved name, or invalid payload/timeout limit | Middleware service and gateway logs; `[[openshell.supervisor.middleware]]`; `Describe` response | +| Policy update rejects `network_middlewares` | Unknown middleware name, implementation-owned config invalid, duplicate order, broad/invalid host selector, or fail-closed coverage of `tls: skip` | Policy error, gateway logs, middleware `ValidateConfig`, selector and order fields | | Policy mutation returns `FAILED_PRECONDITION` for endpoint ambiguity | Equally specific effective endpoint selectors disagree on connection or request-processing metadata | CLI error, base and provider-composed policy, affected profile attachments; confirm no new revision was stored | | Supervisor enters policy quarantine | A runtime candidate failed validation while `policy_validation_failure_mode = "fail_closed"` | Sandbox OCSF config/finding events, validation rationale, active generation, `previous_policy_active` | | Custom compute driver is unavailable | Driver process/socket missing, inaccessible, or selected name does not match its endpoint/config key | Socket ownership/mode, driver service logs, gateway `GetCapabilities` logs | diff --git a/skills/openshell-cli/SKILL.md b/skills/openshell-cli/SKILL.md index 052fe4c7bc..cb23c6e6f8 100644 --- a/skills/openshell-cli/SKILL.md +++ b/skills/openshell-cli/SKILL.md @@ -90,11 +90,14 @@ attachment and delete its sandbox after the service exits. When supplying `--name`, use a portable DNS-1123 label: at most 63 lowercase alphanumeric or `-` characters, beginning and ending with an alphanumeric character. The Kubernetes driver rejects uppercase letters, underscores, dots, and other names that cannot become Kubernetes resource labels. -**Shortcut for known tools**: When the trailing command is a recognized tool, the CLI auto-creates the required provider from local credentials: +Provider attachment is explicit. Name each provider with `--provider`; the +trailing command does not select or attach one. If the named provider does not +exist but a profile with that ID is available, the CLI can create it from local +credentials: ```bash -openshell sandbox create -- claude # Auto-creates claude provider -openshell sandbox create -- codex # Auto-creates codex provider +openshell sandbox create --provider claude-code -- claude +openshell sandbox create --provider codex -- codex ``` The agent will be prompted interactively if credentials are missing. @@ -111,7 +114,7 @@ openshell sandbox delete ## Workflow 2: Provider Management -Providers supply credentials and provider-specific configuration to sandboxes. Provider types come from built-in and custom profiles; do not rely on a hard-coded type list. Discover the profiles available on the selected gateway: +Providers supply credentials and provider-specific configuration to sandboxes. Provider profiles are import-only: a gateway serves exactly what an operator imported, and a new gateway serves an empty catalog. Never rely on a hard-coded type list or on a legacy alias such as `gh` or `claude` — `--type` matches a profile ID exactly. Discover the profiles available on the selected gateway: ```bash openshell provider list-profiles diff --git a/tasks/scripts/sandbox.sh b/tasks/scripts/sandbox.sh index 264b5c6d0a..6adc8b2123 100755 --- a/tasks/scripts/sandbox.sh +++ b/tasks/scripts/sandbox.sh @@ -50,7 +50,7 @@ ensure_anthropic_provider() { echo "Registering anthropic provider..." openshell provider create \ --name anthropic \ - --type claude \ + --type claude-code \ --credential "ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}" } From 50c5cf8ed0423f545fee7e0ccc7e7699eec9e290 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Thu, 17 Sep 2026 23:14:35 +0000 Subject: [PATCH 09/12] refactor(compute): remove legacy host users encoding (#3248) * refactor(compute): remove legacy host users encoding Closes #2861 Remove the Kubernetes driver fallback for platform_config.host_users and document the typed-only user namespace contract for 0.1.0. Signed-off-by: Drew Newberry * docs(compute): defer public compatibility guidance Signed-off-by: Drew Newberry * docs(compute): defer contract documentation Signed-off-by: Drew Newberry --------- Signed-off-by: Drew Newberry --- .../openshell-driver-kubernetes/src/driver.rs | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/crates/openshell-driver-kubernetes/src/driver.rs b/crates/openshell-driver-kubernetes/src/driver.rs index c9e2682983..baaedbe4cd 100644 --- a/crates/openshell-driver-kubernetes/src/driver.rs +++ b/crates/openshell-driver-kubernetes/src/driver.rs @@ -5825,12 +5825,9 @@ fn sandbox_template_to_k8s_with_validated_config( apply_pod_driver_config(&mut spec, &driver_config.pod); // Per-sandbox portable intent overrides the cluster-wide default. This - // driver owns the Kubernetes-specific `hostUsers` translation. Accept the - // former platform_config encoding during rolling upgrades from gateways - // that predate the typed field. + // driver owns the Kubernetes-specific `hostUsers` translation. let use_user_namespaces = template .user_namespaces - .or_else(|| platform_config_bool(template, "host_users").map(|host_users| !host_users)) .unwrap_or(params.enable_user_namespaces); if use_user_namespaces { @@ -6155,15 +6152,6 @@ fn platform_config_string(template: &SandboxTemplate, key: &str) -> Option Option { - let config = template.platform_config.as_ref()?; - let value = config.fields.get(key)?; - match value.kind.as_ref() { - Some(prost_types::value::Kind::BoolValue(value)) => Some(*value), - _ => None, - } -} - /// Extract a nested Struct value from the template's `platform_config`, /// converting it to `serde_json::Value`. fn platform_config_struct(template: &SandboxTemplate, key: &str) -> Option { @@ -8985,7 +8973,7 @@ mod tests { } #[test] - fn user_namespaces_accepts_legacy_host_users_encoding() { + fn user_namespaces_ignores_legacy_host_users_encoding() { let template = SandboxTemplate { platform_config: Some(Struct { fields: std::iter::once(( @@ -9008,10 +8996,9 @@ mod tests { ¶ms, ); - assert_eq!( - pod_template["spec"]["hostUsers"], - serde_json::json!(false), - "legacy host_users: false must still enable user namespaces" + assert!( + pod_template["spec"]["hostUsers"].is_null(), + "legacy host_users must not enable user namespaces" ); } From 9836bffeedd7083251c63e65df4e3fe3643ba3ac Mon Sep 17 00:00:00 2001 From: Piotr Mlocek Date: Fri, 18 Sep 2026 00:13:06 +0000 Subject: [PATCH 10/12] fix(kubernetes): stop supervisor before workload (#3424) * fix(kubernetes): stop supervisor before workload Make Kubernetes sandbox stop crash-resumable and give supervisor Pod deletion its configured grace period plus API observation headroom.\n\nCloses #3421 Signed-off-by: Piotr Mlocek * fix(kubernetes): harden resumed sandbox stops Signed-off-by: Piotr Mlocek * test(kubernetes): simplify resumed stop regression Signed-off-by: Piotr Mlocek * fix(kubernetes): generalize runtime control release Signed-off-by: Drew Newberry * refactor(kubernetes): clarify stop phase names Signed-off-by: Drew Newberry --------- Signed-off-by: Piotr Mlocek Signed-off-by: Drew Newberry Co-authored-by: Drew Newberry --- architecture/compute-runtimes.md | 9 + .../openshell-driver-kubernetes/src/driver.rs | 630 ++++++++++++++++-- .../src/sandbox_runtime.rs | 6 + skills/debug-openshell-cluster/SKILL.md | 24 +- 4 files changed, 596 insertions(+), 73 deletions(-) diff --git a/architecture/compute-runtimes.md b/architecture/compute-runtimes.md index 3999e32ebc..0077c86689 100644 --- a/architecture/compute-runtimes.md +++ b/architecture/compute-runtimes.md @@ -186,6 +186,15 @@ A driver stop operation does not complete while its backend still reports an in-progress stop. This prevents an immediate start from racing the previous run's delayed exit event and regressing the new run to `Error`. +The Kubernetes driver records stop as a durable two-phase transition. The +`releasing` phase releases the sandbox's runtime-control relationship while the +workload boundary remains reachable. The `suspending` phase then suspends the +Agent Sandbox workload and cleans generation bootstrap material. The current +dedicated-supervisor implementation releases control by deleting the supervisor +Pod. Periodic reconciliation resumes either phase after a gateway restart. Pod +deletion waits include the configured termination grace period plus Kubernetes +API observation headroom. + Persisted `Stopping` and `Starting` rows are retried at startup. Stable `Stopped` rows remain stopped. Docker and Podman retain the stopped container and attached storage, Kubernetes retains the Sandbox CR and PVC while scaling diff --git a/crates/openshell-driver-kubernetes/src/driver.rs b/crates/openshell-driver-kubernetes/src/driver.rs index baaedbe4cd..2cb44af1a9 100644 --- a/crates/openshell-driver-kubernetes/src/driver.rs +++ b/crates/openshell-driver-kubernetes/src/driver.rs @@ -13,7 +13,8 @@ use crate::isolation::{ }; use crate::sandbox_runtime::{ BOUNDARY_CERTIFICATE_PATH, BOUNDARY_CONFIG_PATH, BOUNDARY_PRIVATE_KEY_PATH, - SANDBOX_SECRET_COMPONENT, SUPERVISOR_SECRET_COMPONENT, SandboxRuntimeNames, boundary_service, + SANDBOX_SECRET_COMPONENT, SUPERVISOR_SECRET_COMPONENT, + SUPERVISOR_TERMINATION_GRACE_PERIOD_SECONDS, SandboxRuntimeNames, boundary_service, generate_proxy_ca_material, sandbox_bootstrap_secret, sandbox_owner_reference as sandbox_runtime_sandbox_owner_reference, supervisor_bootstrap_secret, supervisor_pod, workload_fence, @@ -108,7 +109,8 @@ const ANNOTATION_SANDBOX_RUNTIME_NETWORK_POLICY_VERSION: &str = enum SandboxRuntimeBootstrapPhase { Preparing, Released, - RollingBack, + Releasing, + Suspending, } impl SandboxRuntimeBootstrapPhase { @@ -116,7 +118,8 @@ impl SandboxRuntimeBootstrapPhase { match self { Self::Preparing => "preparing", Self::Released => "released", - Self::RollingBack => "rolling-back", + Self::Releasing => "releasing", + Self::Suspending => "suspending", } } @@ -124,7 +127,8 @@ impl SandboxRuntimeBootstrapPhase { match value { "preparing" => Some(Self::Preparing), "released" => Some(Self::Released), - "rolling-back" => Some(Self::RollingBack), + "releasing" => Some(Self::Releasing), + "suspending" => Some(Self::Suspending), _ => None, } } @@ -2705,9 +2709,20 @@ impl KubernetesComputeDriver { } async fn stop_sandbox_inner(&self, sandbox_id: &str) -> Result<(), KubernetesDriverError> { - let (agent_sandbox_api, kube_name, pod_name, namespace, stop_timeout) = self - .patch_sandbox_operating_state(sandbox_id, false) + let (agent_sandbox_api, kube_name, pod_name, namespace, stop_timeout, phase) = + self.prepare_sandbox_stop(sandbox_id).await?; + if phase != Some(SandboxRuntimeBootstrapPhase::Suspending) { + self.delete_sandbox_runtime_supervisor_pod(sandbox_id, &namespace) + .await?; + patch_dynamic_object_with_resource_version_retry( + &agent_sandbox_api.api, + &kube_name, + |version| { + sandbox_runtime_suspension_patch(&agent_sandbox_api.resource.version, version) + }, + ) .await?; + } let pod_api = Api::::namespaced(self.client.clone(), &namespace); let deadline = tokio::time::Instant::now() + stop_timeout; @@ -2750,7 +2765,7 @@ impl KubernetesComputeDriver { patch_dynamic_object_with_resource_version_retry( &agent_sandbox_api.api, &kube_name, - sandbox_runtime_rollback_completion_patch, + sandbox_runtime_suspension_completion_patch, ) .await?; return Ok(()); @@ -2818,7 +2833,7 @@ impl KubernetesComputeDriver { let mut object = objects.pop().ok_or(KubernetesDriverError::NotFound)?; if sandbox_runtime_bootstrap_in_progress(&object) { let phase = sandbox_runtime_bootstrap_phase(&object); - if phase != Some(SandboxRuntimeBootstrapPhase::RollingBack) + if phase != Some(SandboxRuntimeBootstrapPhase::Suspending) && sandbox_runtime_bootstrap_operation(&object) != Some("restart") { return Err(KubernetesDriverError::Precondition( @@ -2837,7 +2852,7 @@ impl KubernetesComputeDriver { .unwrap_or(&self.config.namespace); if sandbox_runtime_control_availability(&self.client, namespace, sandbox_id).await == SandboxRuntimeControlAvailability::Available - && sandbox_runtime_runtime_is_ready(&object) + && sandbox_runtime_bootstrap_is_ready_to_complete(&object) { self.complete_sandbox_runtime_bootstrap(&lookup_api, &object) .await; @@ -3037,11 +3052,20 @@ impl KubernetesComputeDriver { Ok(()) } - async fn patch_sandbox_operating_state( + async fn prepare_sandbox_stop( &self, sandbox_id: &str, - running: bool, - ) -> Result<(AgentSandboxApi, String, String, String, Duration), KubernetesDriverError> { + ) -> Result< + ( + AgentSandboxApi, + String, + String, + String, + Duration, + Option, + ), + KubernetesDriverError, + > { let lookup_api = self .supported_sandbox_api_for_lookup(self.client.clone()) .await @@ -3066,6 +3090,7 @@ impl KubernetesComputeDriver { .into_iter() .next() .ok_or(KubernetesDriverError::NotFound)?; + let phase = sandbox_runtime_bootstrap_phase(&object); let namespace = object .metadata .namespace @@ -3087,20 +3112,24 @@ impl KubernetesComputeDriver { .and_then(|annotations| annotations.get(SANDBOX_POD_NAME_ANNOTATION)) .cloned() .unwrap_or_else(|| kube_name.clone()); - patch_dynamic_object_with_resource_version_retry( - &agent_sandbox_api.api, - &kube_name, - |version| { - sandbox_operating_state_patch(&agent_sandbox_api.resource.version, version, running) - }, - ) - .await?; + if !matches!( + phase, + Some( + SandboxRuntimeBootstrapPhase::Releasing | SandboxRuntimeBootstrapPhase::Suspending + ) + ) { + patch_dynamic_object_with_resource_version_retry( + &agent_sandbox_api.api, + &kube_name, + sandbox_runtime_stop_begin_patch, + ) + .await?; + } info!( sandbox_id, sandbox_api_version = %agent_sandbox_api.resource.version, - running, - "Updated Kubernetes sandbox operating state" + "Prepared Kubernetes sandbox stop" ); Ok(( agent_sandbox_api, @@ -3108,10 +3137,11 @@ impl KubernetesComputeDriver { pod_name, namespace, stop_timeout, + phase, )) } - async fn delete_sandbox_runtime_supervisor( + async fn delete_sandbox_runtime_supervisor_pod( &self, sandbox_id: &str, namespace: &str, @@ -3123,16 +3153,22 @@ impl KubernetesComputeDriver { .await .map_err(KubernetesDriverError::from_kube)? { - pods.delete( - &names.supervisor_pod, - &DeleteParams::foreground().preconditions(Preconditions { - uid: pod.metadata.uid, - resource_version: None, - }), - ) - .await - .map_err(KubernetesDriverError::from_kube)?; - let deadline = tokio::time::Instant::now() + KUBE_API_TIMEOUT; + let deletion_timeout = kubernetes_pod_termination_timeout(&pod); + match pods + .delete( + &names.supervisor_pod, + &DeleteParams::foreground().preconditions(Preconditions { + uid: pod.metadata.uid, + resource_version: None, + }), + ) + .await + { + Ok(_) => {} + Err(KubeError::Api(error)) if error.code == 404 => return Ok(()), + Err(error) => return Err(KubernetesDriverError::from_kube(error)), + } + let deadline = tokio::time::Instant::now() + deletion_timeout; loop { if pods .get_opt(&names.supervisor_pod) @@ -3143,13 +3179,24 @@ impl KubernetesComputeDriver { break; } if tokio::time::Instant::now() >= deadline { - return Err(KubernetesDriverError::Message( - "timed out waiting for supervisor Pod deletion".to_string(), - )); + return Err(KubernetesDriverError::Message(format!( + "timed out after {}s waiting for supervisor Pod deletion", + deletion_timeout.as_secs() + ))); } tokio::time::sleep(Duration::from_millis(100)).await; } } + Ok(()) + } + + async fn delete_sandbox_runtime_supervisor( + &self, + sandbox_id: &str, + namespace: &str, + ) -> Result<(), KubernetesDriverError> { + self.delete_sandbox_runtime_supervisor_pod(sandbox_id, namespace) + .await?; self.delete_sandbox_runtime_generation_secrets(sandbox_id, namespace) .await } @@ -3407,9 +3454,22 @@ impl KubernetesComputeDriver { .unwrap_or(&self.config.namespace); let cr_name = object.metadata.name.as_deref().unwrap_or_default(); if sandbox_runtime_bootstrap_phase(&object) - == Some(SandboxRuntimeBootstrapPhase::RollingBack) + == Some(SandboxRuntimeBootstrapPhase::Releasing) { - self.reconcile_sandbox_runtime_rollback( + self.reconcile_sandbox_runtime_control_release( + &lookup_api, + &object, + &sandbox_id, + namespace, + cr_name, + ) + .await; + continue; + } + if sandbox_runtime_bootstrap_phase(&object) + == Some(SandboxRuntimeBootstrapPhase::Suspending) + { + self.reconcile_sandbox_runtime_suspending( &lookup_api, &object, &sandbox_id, @@ -3451,7 +3511,7 @@ impl KubernetesComputeDriver { if sandbox_runtime_bootstrap_in_progress(&object) { if sandbox_runtime_control_availability(&self.client, namespace, &sandbox_id).await == SandboxRuntimeControlAvailability::Available - && sandbox_runtime_runtime_is_ready(&object) + && sandbox_runtime_bootstrap_is_ready_to_complete(&object) { self.complete_sandbox_runtime_bootstrap(&lookup_api, &object) .await; @@ -3540,7 +3600,7 @@ impl KubernetesComputeDriver { } } - async fn reconcile_sandbox_runtime_rollback( + async fn reconcile_sandbox_runtime_suspending( &self, lookup_api: &AgentSandboxApi, object: &DynamicObject, @@ -3560,7 +3620,7 @@ impl KubernetesComputeDriver { Ok(true) => {} Ok(false) => return, Err(error) => { - debug!(sandbox_id, %error, "could not verify sandbox-runtime rollback; reconciliation will retry"); + debug!(sandbox_id, %error, "could not verify sandbox-runtime suspension; reconciliation will retry"); return; } } @@ -3568,7 +3628,48 @@ impl KubernetesComputeDriver { .delete_sandbox_runtime_supervisor(sandbox_id, namespace) .await { - warn!(sandbox_id, %error, "could not finish sandbox-runtime rollback cleanup"); + warn!(sandbox_id, %error, "could not finish sandbox-runtime suspension cleanup"); + return; + } + let Some(resource_version) = object.metadata.resource_version.as_deref() else { + return; + }; + let api = + Self::agent_sandbox_api(self.client.clone(), &lookup_api.resource.version, namespace); + let patch = sandbox_runtime_suspension_completion_patch(resource_version); + match tokio::time::timeout( + KUBE_API_TIMEOUT, + api.api + .patch(cr_name, &PatchParams::default(), &Patch::Merge(&patch)), + ) + .await + { + Ok(Ok(_)) => {} + Ok(Err(error)) => { + debug!(sandbox_id, %error, "sandbox-runtime suspension completion raced; reconciliation will retry"); + } + Err(_) => { + warn!( + sandbox_id, + "timed out completing sandbox-runtime suspension" + ); + } + } + } + + async fn reconcile_sandbox_runtime_control_release( + &self, + lookup_api: &AgentSandboxApi, + object: &DynamicObject, + sandbox_id: &str, + namespace: &str, + cr_name: &str, + ) { + if let Err(error) = self + .delete_sandbox_runtime_supervisor_pod(sandbox_id, namespace) + .await + { + warn!(sandbox_id, %error, "could not release sandbox-runtime control; reconciliation will retry"); return; } let Some(resource_version) = object.metadata.resource_version.as_deref() else { @@ -3576,7 +3677,8 @@ impl KubernetesComputeDriver { }; let api = Self::agent_sandbox_api(self.client.clone(), &lookup_api.resource.version, namespace); - let patch = sandbox_runtime_rollback_completion_patch(resource_version); + let patch = + sandbox_runtime_suspension_patch(&lookup_api.resource.version, resource_version); match tokio::time::timeout( KUBE_API_TIMEOUT, api.api @@ -3586,10 +3688,13 @@ impl KubernetesComputeDriver { { Ok(Ok(_)) => {} Ok(Err(error)) => { - debug!(sandbox_id, %error, "sandbox-runtime rollback completion raced; reconciliation will retry"); + debug!(sandbox_id, %error, "sandbox-runtime control release raced; reconciliation will retry"); } Err(_) => { - warn!(sandbox_id, "timed out completing sandbox-runtime rollback"); + warn!( + sandbox_id, + "timed out completing sandbox-runtime control release" + ); } } } @@ -3663,7 +3768,7 @@ impl KubernetesComputeDriver { .unwrap_or(&self.config.namespace); let api = Self::agent_sandbox_api(self.client.clone(), &lookup_api.resource.version, namespace); - let patch = sandbox_runtime_rollback_patch( + let patch = sandbox_runtime_suspension_patch( &lookup_api.resource.version, object .metadata @@ -3750,6 +3855,9 @@ impl KubernetesComputeDriver { lookup_api: &AgentSandboxApi, object: &DynamicObject, ) { + if !sandbox_runtime_bootstrap_is_ready_to_complete(object) { + return; + } let (Some(name), Some(resource_version)) = ( object.metadata.name.as_deref(), object.metadata.resource_version.as_deref(), @@ -4051,8 +4159,7 @@ fn spawn_sandbox_runtime_bootstrap_completion( let runtime_ready = |object: Option<&DynamicObject>| { object.is_some_and(|object| { object.metadata.uid == expected_sandbox_uid - && sandbox_runtime_bootstrap_in_progress(object) - && sandbox_runtime_runtime_is_ready(object) + && sandbox_runtime_bootstrap_is_ready_to_complete(object) }) }; let object = match tokio::time::timeout_at( @@ -4134,6 +4241,16 @@ fn sandbox_runtime_bootstrap_operation(object: &DynamicObject) -> Option<&str> { .map(String::as_str) } +fn sandbox_runtime_bootstrap_is_ready_to_complete(object: &DynamicObject) -> bool { + sandbox_runtime_bootstrap_in_progress(object) + && sandbox_runtime_bootstrap_phase(object) == Some(SandboxRuntimeBootstrapPhase::Released) + && matches!( + sandbox_runtime_bootstrap_operation(object), + Some("create" | "restart") + ) + && sandbox_runtime_runtime_is_ready(object) +} + fn sandbox_runtime_bootstrap_phase(object: &DynamicObject) -> Option { object .metadata @@ -6450,6 +6567,18 @@ fn kubernetes_sandbox_stop_timeout(obj: &DynamicObject) -> Duration { termination_grace_period.saturating_add(KUBE_API_TIMEOUT) } +fn kubernetes_pod_termination_timeout(pod: &Pod) -> Duration { + let default_grace = u64::try_from(SUPERVISOR_TERMINATION_GRACE_PERIOD_SECONDS) + .map_or(DEFAULT_POD_TERMINATION_GRACE_PERIOD, Duration::from_secs); + let termination_grace = pod + .spec + .as_ref() + .and_then(|spec| spec.termination_grace_period_seconds) + .and_then(|seconds| u64::try_from(seconds).ok()) + .map_or(default_grace, Duration::from_secs); + termination_grace.saturating_add(KUBE_API_TIMEOUT) +} + fn next_stop_poll_interval(current: Duration) -> Duration { current.saturating_mul(2).min(STOP_MAX_POLL_INTERVAL) } @@ -6466,7 +6595,7 @@ fn sandbox_operating_state_patch( "spec": {"operatingMode": "Running"} }) } else { - sandbox_runtime_rollback_patch(api_version, resource_version) + sandbox_runtime_suspension_patch(api_version, resource_version) } } else { if running { @@ -6475,12 +6604,30 @@ fn sandbox_operating_state_patch( "spec": {"replicas": 1} }) } else { - sandbox_runtime_rollback_patch(api_version, resource_version) + sandbox_runtime_suspension_patch(api_version, resource_version) } } } -fn sandbox_runtime_rollback_patch(api_version: &str, resource_version: &str) -> serde_json::Value { +fn sandbox_runtime_stop_begin_patch(resource_version: &str) -> serde_json::Value { + serde_json::json!({ + "metadata": { + "resourceVersion": resource_version, + "annotations": { + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING: "true", + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_STARTED_AT: openshell_core::time::now_ms().to_string(), + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION: "stop", + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE: SandboxRuntimeBootstrapPhase::Releasing.as_str(), + ANNOTATION_SANDBOX_RUNTIME_READINESS: "unavailable", + }, + }, + }) +} + +fn sandbox_runtime_suspension_patch( + api_version: &str, + resource_version: &str, +) -> serde_json::Value { let desired_state = if api_version == SANDBOX_VERSION_V1BETA1 { serde_json::json!({"operatingMode": "Suspended"}) } else { @@ -6493,7 +6640,7 @@ fn sandbox_runtime_rollback_patch(api_version: &str, resource_version: &str) -> ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING: "true", ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_STARTED_AT: openshell_core::time::now_ms().to_string(), ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION: "stop", - ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE: SandboxRuntimeBootstrapPhase::RollingBack.as_str(), + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE: SandboxRuntimeBootstrapPhase::Suspending.as_str(), ANNOTATION_SANDBOX_RUNTIME_READINESS: "unavailable", }, }, @@ -6501,7 +6648,7 @@ fn sandbox_runtime_rollback_patch(api_version: &str, resource_version: &str) -> }) } -fn sandbox_runtime_rollback_completion_patch(resource_version: &str) -> serde_json::Value { +fn sandbox_runtime_suspension_completion_patch(resource_version: &str) -> serde_json::Value { serde_json::json!({ "metadata": { "resourceVersion": resource_version, @@ -6795,11 +6942,37 @@ mod tests { }; use openshell_core::proto::compute::v1::{GpuResourceRequirements, ResourceRequirements}; use prost_types::{Struct, Value, value::Kind}; - use std::collections::BTreeSet; + use std::collections::{BTreeSet, VecDeque}; static ENV_LOCK: std::sync::LazyLock> = std::sync::LazyLock::new(|| std::sync::Mutex::new(())); + fn kube_test_response( + status: http::StatusCode, + body: serde_json::Value, + ) -> http::Response { + http::Response::builder() + .status(status) + .header(http::header::CONTENT_TYPE, "application/json") + .body(kube::client::Body::from(body.to_string().into_bytes())) + .expect("valid Kubernetes test response") + } + + fn kube_test_not_found(kind: &str, name: &str) -> http::Response { + kube_test_response( + http::StatusCode::NOT_FOUND, + serde_json::json!({ + "apiVersion": "v1", + "kind": "Status", + "status": "Failure", + "message": format!("{kind} {name} not found"), + "reason": "NotFound", + "details": {"kind": kind, "name": name}, + "code": 404 + }), + ) + } + #[test] fn boundary_authority_uses_stable_service_dns_name() { let names = SandboxRuntimeNames::new("sandbox-1"); @@ -7393,27 +7566,255 @@ mod tests { } #[test] - fn lifecycle_patch_uses_version_specific_operating_state() { - let beta_stop = sandbox_operating_state_patch(SANDBOX_VERSION_V1BETA1, "42", false); - assert_eq!(beta_stop["metadata"]["resourceVersion"], "42"); + fn lifecycle_patch_stops_supervisor_before_suspending_workload() { + let stop_begin = sandbox_runtime_stop_begin_patch("42"); + assert_eq!(stop_begin["metadata"]["resourceVersion"], "42"); assert_eq!( - beta_stop["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING], + stop_begin["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING], "true" ); assert_eq!( - beta_stop["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE], - SandboxRuntimeBootstrapPhase::RollingBack.as_str() + stop_begin["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE], + SandboxRuntimeBootstrapPhase::Releasing.as_str() ); + assert!(stop_begin.get("spec").is_none()); + + let beta_stop = sandbox_runtime_suspension_patch(SANDBOX_VERSION_V1BETA1, "43"); assert_eq!(beta_stop["spec"]["operatingMode"], "Suspended"); assert!(beta_stop["spec"].get("replicas").is_none()); - let alpha_start = sandbox_operating_state_patch(SANDBOX_VERSION_V1ALPHA1, "43", true); - assert_eq!(alpha_start["metadata"]["resourceVersion"], "43"); + let alpha_stop = sandbox_runtime_suspension_patch(SANDBOX_VERSION_V1ALPHA1, "44"); + assert_eq!(alpha_stop["spec"]["replicas"], 0); + assert!(alpha_stop["spec"].get("operatingMode").is_none()); + + let alpha_start = sandbox_operating_state_patch(SANDBOX_VERSION_V1ALPHA1, "45", true); + assert_eq!(alpha_start["metadata"]["resourceVersion"], "45"); assert!(alpha_start["metadata"].get("annotations").is_none()); assert_eq!(alpha_start["spec"]["replicas"], 1); assert!(alpha_start["spec"].get("operatingMode").is_none()); } + #[tokio::test] + async fn stop_resumed_from_suspending_removes_the_complete_runtime() { + let sandbox = serde_json::json!({ + "apiVersion": "agents.x-k8s.io/v1beta1", + "kind": "Sandbox", + "metadata": { + "name": "sandbox-cr", + "namespace": "openshell", + "resourceVersion": "42", + "annotations": { + SANDBOX_POD_NAME_ANNOTATION: "workload-pod", + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE: + SandboxRuntimeBootstrapPhase::Suspending.as_str() + } + }, + "status": {"conditions": [{"type": "Suspended", "status": "True"}]} + }); + let sandbox_path = + "/apis/agents.x-k8s.io/v1beta1/namespaces/openshell/sandboxes/sandbox-cr"; + let supervisor_path = "/api/v1/namespaces/openshell/pods/os-supervisor-sandbox-1"; + let success = || { + kube_test_response( + http::StatusCode::OK, + serde_json::json!({"kind": "Status", "status": "Success", "code": 200}), + ) + }; + let no_secrets = || { + kube_test_response( + http::StatusCode::OK, + serde_json::json!({"apiVersion": "v1", "kind": "SecretList", "items": []}), + ) + }; + let steps = Arc::new(std::sync::Mutex::new(VecDeque::from([ + ( + http::Method::GET, + "/apis/agents.x-k8s.io/v1beta1/namespaces/openshell/sandboxes", + kube_test_response( + http::StatusCode::OK, + serde_json::json!({ + "apiVersion": "agents.x-k8s.io/v1beta1", + "kind": "SandboxList", + "items": [sandbox.clone()] + }), + ), + ), + ( + http::Method::GET, + sandbox_path, + kube_test_response(http::StatusCode::OK, sandbox.clone()), + ), + ( + http::Method::GET, + "/api/v1/namespaces/openshell/pods/workload-pod", + kube_test_not_found("pods", "workload-pod"), + ), + ( + http::Method::GET, + supervisor_path, + kube_test_response( + http::StatusCode::OK, + serde_json::json!({ + "apiVersion": "v1", + "kind": "Pod", + "metadata": {"name": "os-supervisor-sandbox-1", "uid": "supervisor-uid"}, + "spec": {"containers": []} + }), + ), + ), + (http::Method::DELETE, supervisor_path, success()), + ( + http::Method::GET, + supervisor_path, + kube_test_not_found("pods", "os-supervisor-sandbox-1"), + ), + ( + http::Method::GET, + "/api/v1/namespaces/openshell/secrets", + no_secrets(), + ), + ( + http::Method::GET, + "/api/v1/namespaces/openshell/secrets", + no_secrets(), + ), + ( + http::Method::GET, + sandbox_path, + kube_test_response(http::StatusCode::OK, sandbox.clone()), + ), + ( + http::Method::PATCH, + sandbox_path, + kube_test_response(http::StatusCode::OK, sandbox), + ), + ]))); + let service_steps = steps.clone(); + let service = tower::service_fn(move |request: http::Request| { + let steps = service_steps.clone(); + async move { + let (method, path, response) = steps + .lock() + .unwrap() + .pop_front() + .expect("unexpected Kubernetes API request"); + assert_eq!(request.method(), method); + assert_eq!(request.uri().path(), path); + Ok::<_, std::convert::Infallible>(response) + } + }); + let client = Client::new(service, "openshell"); + let driver = KubernetesComputeDriver { + client: client.clone(), + watch_client: client, + sandbox_api_version: Arc::new(OnceCell::new()), + config: KubernetesComputeConfig::default(), + operator_allowlist: None, + }; + driver + .sandbox_api_version + .set(SANDBOX_VERSION_V1BETA1) + .expect("set test Sandbox API version"); + + tokio::time::timeout(Duration::from_secs(1), driver.stop_sandbox("sandbox-1")) + .await + .expect("stop timed out") + .expect("resume stop from Suspending"); + assert!(steps.lock().unwrap().is_empty()); + } + + #[test] + fn bootstrap_phase_round_trips_releasing() { + let phase = SandboxRuntimeBootstrapPhase::Releasing; + assert_eq!( + SandboxRuntimeBootstrapPhase::parse(phase.as_str()), + Some(phase) + ); + } + + #[tokio::test] + async fn control_release_reconcile_does_not_retry_a_stale_transition() { + let resource = ApiResource::from_gvk(&GroupVersionKind::gvk( + SANDBOX_GROUP, + SANDBOX_VERSION_V1BETA1, + SANDBOX_KIND, + )); + let mut sandbox = DynamicObject::new("sandbox-cr", &resource); + sandbox.metadata.namespace = Some("openshell".to_string()); + sandbox.metadata.resource_version = Some("42".to_string()); + sandbox.metadata.annotations = Some(BTreeMap::from([ + ( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION.to_string(), + "stop".to_string(), + ), + ( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE.to_string(), + SandboxRuntimeBootstrapPhase::Releasing.as_str().to_string(), + ), + ])); + + let steps = Arc::new(std::sync::Mutex::new(VecDeque::from([ + ( + http::Method::GET, + "/api/v1/namespaces/openshell/pods/os-supervisor-sandbox-1", + kube_test_not_found("pods", "os-supervisor-sandbox-1"), + ), + ( + http::Method::PATCH, + "/apis/agents.x-k8s.io/v1beta1/namespaces/openshell/sandboxes/sandbox-cr", + kube_test_response( + http::StatusCode::CONFLICT, + serde_json::json!({ + "apiVersion": "v1", + "kind": "Status", + "status": "Failure", + "message": "the object has been modified", + "reason": "Conflict", + "code": 409 + }), + ), + ), + ]))); + let service_steps = steps.clone(); + let service = tower::service_fn(move |request: http::Request| { + let steps = service_steps.clone(); + async move { + let (method, path, response) = + steps.lock().unwrap().pop_front().expect( + "stale reconciliation must not retry with a newer resource version", + ); + assert_eq!(request.method(), method); + assert_eq!(request.uri().path(), path); + Ok::<_, std::convert::Infallible>(response) + } + }); + let client = Client::new(service, "openshell"); + let lookup_api = KubernetesComputeDriver::agent_sandbox_api( + client.clone(), + SANDBOX_VERSION_V1BETA1, + "openshell", + ); + let driver = KubernetesComputeDriver { + client: client.clone(), + watch_client: client, + sandbox_api_version: Arc::new(OnceCell::new()), + config: KubernetesComputeConfig::default(), + operator_allowlist: None, + }; + + driver + .reconcile_sandbox_runtime_control_release( + &lookup_api, + &sandbox, + "sandbox-1", + "openshell", + "sandbox-cr", + ) + .await; + + assert!(steps.lock().unwrap().is_empty()); + } + #[test] fn stop_timeout_includes_pod_grace_period_and_reconcile_headroom() { let resource = ApiResource::from_gvk(&GroupVersionKind::gvk( @@ -7442,6 +7843,29 @@ mod tests { ); } + #[test] + fn supervisor_deletion_timeout_includes_grace_and_api_headroom() { + let mut pod = Pod::default(); + assert_eq!( + kubernetes_pod_termination_timeout(&pod), + Duration::from_mins(1), + "an older Pod without an explicit grace uses the Kubernetes default" + ); + + pod.spec = Some(k8s_openapi::api::core::v1::PodSpec { + containers: Vec::new(), + termination_grace_period_seconds: Some(45), + ..Default::default() + }); + assert_eq!( + kubernetes_pod_termination_timeout(&pod), + Duration::from_secs(75) + ); + + pod.spec.as_mut().unwrap().termination_grace_period_seconds = Some(0); + assert_eq!(kubernetes_pod_termination_timeout(&pod), KUBE_API_TIMEOUT); + } + #[test] fn stop_poll_interval_backs_off_to_cap() { let mut interval = STOP_INITIAL_POLL_INTERVAL; @@ -9952,24 +10376,24 @@ mod tests { } #[test] - fn sandbox_runtime_rollback_is_durable_until_cleanup_completes() { - let rollback = sandbox_runtime_rollback_patch(SANDBOX_VERSION_V1BETA1, "42"); - assert_eq!(rollback["metadata"]["resourceVersion"], "42"); + fn sandbox_runtime_suspension_is_durable_until_cleanup_completes() { + let suspension = sandbox_runtime_suspension_patch(SANDBOX_VERSION_V1BETA1, "42"); + assert_eq!(suspension["metadata"]["resourceVersion"], "42"); assert_eq!( - rollback["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING], + suspension["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING], "true" ); assert_eq!( - rollback["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION], + suspension["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION], "stop" ); assert_eq!( - rollback["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE], - SandboxRuntimeBootstrapPhase::RollingBack.as_str() + suspension["metadata"]["annotations"][ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE], + SandboxRuntimeBootstrapPhase::Suspending.as_str() ); - assert_eq!(rollback["spec"]["operatingMode"], "Suspended"); + assert_eq!(suspension["spec"]["operatingMode"], "Suspended"); - let complete = sandbox_runtime_rollback_completion_patch("43"); + let complete = sandbox_runtime_suspension_completion_patch("43"); assert_eq!(complete["metadata"]["resourceVersion"], "43"); for annotation in [ ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING, @@ -10025,6 +10449,70 @@ mod tests { assert!(!sandbox_runtime_runtime_is_ready(&sandbox)); } + #[test] + fn sandbox_runtime_bootstrap_completion_requires_released_create_or_restart() { + let resource = ApiResource::from_gvk(&GroupVersionKind::gvk( + SANDBOX_GROUP, + SANDBOX_VERSION_V1BETA1, + SANDBOX_KIND, + )); + let mut sandbox = DynamicObject::new("sandbox", &resource); + sandbox.metadata.generation = Some(7); + sandbox.data = serde_json::json!({ + "status": { + "conditions": [{ + "type": "Ready", + "status": "True", + "observedGeneration": 7 + }] + } + }); + let annotations = sandbox.metadata.annotations.get_or_insert_default(); + annotations.insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAPPING.to_string(), + "true".to_string(), + ); + annotations.insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE.to_string(), + SandboxRuntimeBootstrapPhase::Released.as_str().to_string(), + ); + annotations.insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION.to_string(), + "create".to_string(), + ); + assert!(sandbox_runtime_bootstrap_is_ready_to_complete(&sandbox)); + + sandbox.metadata.annotations.as_mut().unwrap().insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION.to_string(), + "restart".to_string(), + ); + assert!(sandbox_runtime_bootstrap_is_ready_to_complete(&sandbox)); + + sandbox.metadata.annotations.as_mut().unwrap().insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE.to_string(), + SandboxRuntimeBootstrapPhase::Releasing.as_str().to_string(), + ); + assert!(!sandbox_runtime_bootstrap_is_ready_to_complete(&sandbox)); + + sandbox.metadata.annotations.as_mut().unwrap().insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE.to_string(), + SandboxRuntimeBootstrapPhase::Suspending + .as_str() + .to_string(), + ); + assert!(!sandbox_runtime_bootstrap_is_ready_to_complete(&sandbox)); + + sandbox.metadata.annotations.as_mut().unwrap().insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_PHASE.to_string(), + SandboxRuntimeBootstrapPhase::Released.as_str().to_string(), + ); + sandbox.metadata.annotations.as_mut().unwrap().insert( + ANNOTATION_SANDBOX_RUNTIME_BOOTSTRAP_OPERATION.to_string(), + "stop".to_string(), + ); + assert!(!sandbox_runtime_bootstrap_is_ready_to_complete(&sandbox)); + } + #[test] fn sandbox_runtime_readiness_is_downgraded_with_a_transient_reason() { let mut sandbox = Sandbox { diff --git a/crates/openshell-driver-kubernetes/src/sandbox_runtime.rs b/crates/openshell-driver-kubernetes/src/sandbox_runtime.rs index 2653597ff3..791cbda3c3 100644 --- a/crates/openshell-driver-kubernetes/src/sandbox_runtime.rs +++ b/crates/openshell-driver-kubernetes/src/sandbox_runtime.rs @@ -43,6 +43,7 @@ pub const PROXY_CA_PRIVATE_KEY_PATH: &str = "/.openshell/supervisor/proxy-ca.key pub const CONTROL_HEALTH_SOCKET_PATH: &str = "/run/openshell/health.sock"; pub const NAMESPACE_WORKLOAD_POLICY_NAME: &str = "openshell-sandbox-workloads"; pub const NAMESPACE_SUPERVISOR_EGRESS_POLICY_NAME: &str = "openshell-sandbox-supervisors"; +pub const SUPERVISOR_TERMINATION_GRACE_PERIOD_SECONDS: i64 = 30; pub struct ProxyCaMaterial { pub certificate_pem: String, @@ -389,6 +390,7 @@ pub fn supervisor_pod( ..Default::default() }, spec: Some(PodSpec { + termination_grace_period_seconds: Some(SUPERVISOR_TERMINATION_GRACE_PERIOD_SECONDS), service_account_name: Some(service_account_name.to_string()), image_pull_secrets: Some( image_pull_secrets @@ -656,6 +658,10 @@ mod tests { assert_eq!(container.image_pull_policy.as_deref(), Some("IfNotPresent")); assert_eq!(pod_spec.automount_service_account_token, Some(false)); assert_eq!(pod_spec.restart_policy.as_deref(), Some("Never")); + assert_eq!( + pod_spec.termination_grace_period_seconds, + Some(SUPERVISOR_TERMINATION_GRACE_PERIOD_SECONDS) + ); assert_eq!( pod_spec .scheduling_gates diff --git a/skills/debug-openshell-cluster/SKILL.md b/skills/debug-openshell-cluster/SKILL.md index e53f571108..5e312ae718 100644 --- a/skills/debug-openshell-cluster/SKILL.md +++ b/skills/debug-openshell-cluster/SKILL.md @@ -646,11 +646,31 @@ a required unprivileged seccomp, task-memory, or Landlock operation. Do not add capabilities, gateway egress, or credentials to the workload Pod as a workaround. -If a Sandbox remains in the `rolling-back` bootstrap phase, verify that the +If a Sandbox remains in the `releasing` bootstrap phase, inspect the supervisor +Pod first. The gateway keeps the workload running during this phase so the +supervisor can release that sandbox's runtime-control relationship cleanly. +Check the Pod's deletion timestamp, termination grace period, events, and +finalizers, and verify that the gateway ServiceAccount can delete Pods in the +sandbox namespace: + +```bash +kubectl -n get pod \ + -l openshell.ai/sandbox-id=,openshell.ai/boundary-role=supervisor \ + -o yaml +kubectl auth can-i delete pods \ + --namespace \ + --as system:serviceaccount:openshell:openshell +``` + +Do not suspend or delete the workload Pod manually. The driver advances to +`suspending` only after runtime control has been released, and then suspends the +workload. + +If a Sandbox remains in the `suspending` bootstrap phase, verify that the gateway ServiceAccount can create, list, and delete Secrets in the sandbox namespace. Recovery lists generation Secrets by sandbox and component labels even when none remain, then deletes stale entries with UID preconditions before -clearing the rollback annotations: +clearing the suspension annotations: ```bash for verb in create list delete; do From 1d010f4187830b56535f35a36b203514634f27aa Mon Sep 17 00:00:00 2001 From: "John T. Myers" <9696606+johntmyers@users.noreply.github.com> Date: Fri, 18 Sep 2026 00:16:18 +0000 Subject: [PATCH 11/12] feat(sandbox): validate configuration before workload activation (#3259) * feat(sandbox): validate configuration before workload activation Closes #3145 Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(sandbox): bound startup failures and preserve activation history Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(sandbox): enforce deadlines on startup RPC attempts Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(sandbox): isolate provider auto-create policy fixture Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(sandbox): remove unnecessary fixture string delimiters Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(sandbox): capture startup logs before ephemeral cleanup Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(sandbox): preserve credential revocation after rebase Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(server): retain provider revision helper for endpoint reports Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(server): import provider object trait in production Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(supervisor): preserve admission across boundary extraction Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(sandbox): use existing boundary discovery imports Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(sandbox): distinguish workload and supervisor containers Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(server): reconcile admission schema with timestamp migration Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(server): reconcile admission with typed deletion schema Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(server): reconcile admission with mutation request IDs Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(supervisor): adapt local startup fixture to admission state Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(supervisor): deduplicate startup quarantine diagnostics Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(tui): show configuration blockers in sandbox notes Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * feat(sandbox): expire provisioning repair attempts after five minutes Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(supervisor): reconcile admission with provider readiness Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(tui): separate configuration summaries from full diagnostics Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * fix(tui): shorten invalid configuration note Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> * test(server): refresh schema inventory after rebase Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> --------- Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com> --- .agents/skills/tui-development/SKILL.md | 2 +- architecture/gateway.md | 23 + architecture/sandbox.md | 87 +- architecture/security-policy.md | 8 + crates/openshell-cli/src/run.rs | 162 +- .../tests/ensure_providers_integration.rs | 7 + .../openshell-cli/tests/mtls_integration.rs | 7 + .../tests/provider_commands_integration.rs | 7 + .../sandbox_create_lifecycle_integration.rs | 7 + .../sandbox_name_fallback_integration.rs | 7 + crates/openshell-core/src/grpc_client.rs | 55 +- .../src/provider_credentials.rs | 149 ++ crates/openshell-driver-docker/src/lib.rs | 113 +- crates/openshell-driver-podman/src/driver.rs | 26 +- .../src/boundary_protocol.rs | 7 + .../openshell-sandbox-backend/src/runtime.rs | 20 +- .../openshell-sandbox/src/boundary_server.rs | 84 +- crates/openshell-sdk/tests/client_mock.rs | 7 + .../openshell-server/src/auth/method_authz.rs | 3 + crates/openshell-server/src/compute/mod.rs | 930 ++++++- .../src/compute/provisioning_deadline.rs | 799 ++++++ crates/openshell-server/src/grpc/mod.rs | 17 + crates/openshell-server/src/grpc/policy.rs | 737 ++++- .../src/grpc/policy/provisioning_clock.rs | 271 ++ crates/openshell-server/src/grpc/sandbox.rs | 33 + crates/openshell-server/src/lib.rs | 8 +- crates/openshell-server/src/policy_store.rs | 91 + crates/openshell-server/src/storage_proto.rs | 37 +- crates/openshell-server/tests/common/mod.rs | 7 + .../tests/supervisor_relay_integration.rs | 7 + .../openshell-supervisor-network/src/opa.rs | 98 +- crates/openshell-supervisor/Cargo.toml | 1 + crates/openshell-supervisor/src/lib.rs | 1657 +++++++++--- crates/openshell-tui/src/app.rs | 3 + crates/openshell-tui/src/lib.rs | 148 +- crates/openshell-tui/src/ui/mod.rs | 53 +- crates/openshell-tui/src/ui/sandbox_detail.rs | 38 +- crates/openshell-tui/src/ui/sandbox_draft.rs | 2 +- crates/openshell-tui/src/ui/sandboxes.rs | 4 +- docs/reference/gateway-config.mdx | 2 +- docs/sandboxes/manage-sandboxes.mdx | 35 + docs/sandboxes/policies.mdx | 34 +- e2e/rust/Cargo.toml | 5 + e2e/rust/tests/policy_activation.rs | 383 +++ e2e/rust/tests/provider_auto_create.rs | 23 + e2e/rust/tests/sandbox_lifecycle.rs | 61 +- proto/openshell.proto | 58 + proto/sandbox.proto | 7 + .../v1/internal/converter/coverage_test.go | 31 +- .../v1/internal/converter/sandbox.go | 19 + .../v1/internal/converter/sandbox_test.go | 27 + sdk/go/openshell/v1/types/sandbox.go | 25 +- sdk/go/proto/openshellv1/openshell.pb.go | 2367 ++++++++++------- sdk/go/proto/openshellv1/openshell_grpc.pb.go | 40 + sdk/go/proto/sandboxv1/sandbox.pb.go | 35 +- skills/debug-openshell-cluster/SKILL.md | 19 + skills/generate-sandbox-policy/SKILL.md | 6 + skills/openshell-cli/SKILL.md | 16 +- 58 files changed, 7238 insertions(+), 1677 deletions(-) create mode 100644 crates/openshell-server/src/compute/provisioning_deadline.rs create mode 100644 crates/openshell-server/src/grpc/policy/provisioning_clock.rs create mode 100644 e2e/rust/tests/policy_activation.rs diff --git a/.agents/skills/tui-development/SKILL.md b/.agents/skills/tui-development/SKILL.md index 0de6246c9f..6aeb75091c 100644 --- a/.agents/skills/tui-development/SKILL.md +++ b/.agents/skills/tui-development/SKILL.md @@ -170,7 +170,7 @@ Phase 1: GetSandboxLogs → 500 initial lines → send via Event::LogLines Phase 2: WatchSandbox(follow_logs: true) → live tail → send via Event::LogLines ``` -**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. +**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. The NOTES column summarizes active `ConfigurationInvalid` readiness conditions as `Invalid config` before port forwards and clears the note on refresh after repair. Full diagnostics remain available through `openshell sandbox get -o json`. Timed-out provisioning attempts show `Provisioning timed out` with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field. **Providers**: Fetched via `ListProviders` in the background collection-refresh task. Provider profiles are fetched per-workspace via `ListProviderProfiles` and cached in a `ProviderProfileCache` keyed by `(workspace, profile_id)`. Follow each list RPC's `next_page_token` until empty. diff --git a/architecture/gateway.md b/architecture/gateway.md index 6d944cd0d0..2df02d0f2d 100644 --- a/architecture/gateway.md +++ b/architecture/gateway.md @@ -436,6 +436,29 @@ and number; this coordinated pre-1.0 API change does not alter durable schemas. The outcome alone does not provide request deduplication. Opted-in unary methods require a request UUID for the admission contract. +Configuration admission adds `SandboxStatus.configuration_admission` at field +11 and optional `configuration_activated` at field 12, extending the public and +durable closures. New sandboxes explicitly store `false` until first acceptance; +acceptance stores `true` permanently, including across restart. Legacy rows +have neither field and conservatively retain static-policy restrictions. No +database rewrite is required. A pre-admission byte fixture verifies that legacy +phase and policy-version fields survive without fabricated admission or activation. +`SandboxStatus.provisioning` uses field 13 for gateway-owned attempt timing and +compute reclamation progress. Its timestamps survive supervisor reconnects and +ordinary driver status updates. Older records decode with no provisioning +record; timing must be adopted once and persisted, never reconstructed from the +object's frequently changing update timestamp. The additive message requires +no rewrite of existing payloads and leaves the frozen storage-v1 schema intact. +Stored settings JSON also carries per-key change IDs and commit timestamps, +including deletion tombstones. Legacy values acquire stable source identities +on read; a subsequent write preserves them. These clocks distinguish effective +edits from no-op writes without treating status updates as configuration edits. +With timestamp types, deletion outcomes, and optional mutation request IDs, the +admission contract brings the public closure to 298 messages and 21 enums, the +durable closure to 92 messages and 16 enums, and their overlap to 80 messages +and 16 enums. Mutation request IDs extend public request fields without adding +messages to these closures or changing the durable protobuf schema. + | Dual-purpose encoded root | Current decision | |---|---| | `Sandbox` | Defer a storage twin; govern its complete dependency closure as durable. | diff --git a/architecture/sandbox.md b/architecture/sandbox.md index 12b3d74315..74bbfb4aea 100644 --- a/architecture/sandbox.md +++ b/architecture/sandbox.md @@ -612,6 +612,82 @@ the structured 403 and authors the narrowest rule. Mechanistically mapping L7 would either over-broaden rules or require path-templating logic that rots quickly. +## Configuration Admission + +Gateway-managed supervisors reconcile configuration before launching the main +process or exposing workload services. Admission covers the effective policy, +provider layers, credential bindings, and gateway-derived provenance. Explicit +user and global policy precedence is unchanged; an image without a policy uses +the restrictive baseline. An invalid image policy does not become a launchable +default. + +The gateway tracks configuration admission independently of compute health. +A blocked startup remains `Provisioning` with a `ConfigurationInvalid` readiness +condition, even when the container backend reports readiness. Gateway management +operations remain available. The TUI summarizes configuration rejection in sandbox +NOTES alongside active port forwards; the detail view wraps the full diagnostic, +which is also available through sandbox inspection. +Replacing the policy or repairing providers allows +the same supervisor to reconcile and launch; it does not recreate the sandbox. +Startup retries continue reporting readiness, but unchanged configuration rejections +produce only one log event. A changed configuration or diagnostic emits a new +rejection event; successful repair emits a recovery event. +The gateway gives each initial provisioning attempt and explicit restart a +300-second repair window. Persisted configuration-source clocks reset the window +from the latest effective stored change, including settings deletion and provider +attachment changes. The first accepted rejection for that generation grants one +full window; repeated reports and reconnects do not extend it. Ready disarms the +timer. Failed desired updates to a running sandbox do not arm it. + +A leader-owned scan runs independently of driver inventory. Expiry records +`Error`/`ProvisioningTimedOut` before reclaiming compute; cleanup progress and +backoff survive restart. Late runtime reports cannot replace that result. The +record and restartable storage survive cleanup, including for ephemeral creates. +Explicit start is blocked while cleanup is pending, then creates a fresh attempt +using the latest configuration. Configuration edits alone never restart an +expired sandbox. Legacy provisioning records receive one persisted rollout +window. Cross-object configuration serialization uses the gateway's existing +single-writer guard; enabling concurrent configuration writers still requires +the database-backed invariant work tracked by #1255. + +Docker startup health remains unready during policy quarantine. A failed probe +does not terminate a live provisioning supervisor; the gateway deadline owns +that decision. Cleanup cancels pending driver startup before stopping compute +so a late startup failure cannot remove retained workload storage. + +Static policy fields can be replaced before the first accepted activation. +A durable first-activation marker closes this repair window permanently, including +across stop/start and later rejected configurations. Legacy records without the +marker retain static-field immutability. +Admission validates policy composition; image and host setup failures, such as +an unresolved OCI user or unavailable isolation facilities, retain their existing +startup error behavior. + +Acceptance identifies the effective policy hash/version, configuration revision, +provider-environment revision, and reporting supervisor instance. Startup captures +the matching provider environment and constructs the runtime before reporting +acceptance. Live reconciliation begins only after the main process has spawned, +so it cannot replace the configuration captured for that launch. Restart resets +admission and requires a fresh accepted configuration. Permanent gateway errors +and exhausted transient retries terminate startup; each RPC attempt has a +10-second deadline, including acceptance reports; only acknowledged configuration +rejections wait for repair within the gateway's provisioning deadline. Image discovery uses the authenticated +sandbox boundary control request deadline. + +Policy and provider refreshes are prepared before publication. Publication +invalidates prior policy guards before exposing new provider material and swaps +the policy under the same publication locks. Rejected candidates cannot install +their credentials alongside the previous policy. Existing runtime fail-closed +checks remain necessary for in-flight traffic and invalid live updates. + +The supervisor reads the workload image policy through an authenticated, +read-only `DiscoverPolicy` boundary request before attaching or launching the +workload. The boundary reads only the well-known policy paths, bounds the response, +and distinguishes missing policy from unreadable or invalid content. The supervisor +validates this candidate with gateway provider composition and obtains admission +before `Attach`, `Confirm`, networking startup, and `StartAgent`. Workload image +environment variables cannot configure the isolated supervisor. + ## Policy Revision Acknowledgement When the supervisor loads a sandbox-scoped policy from the gateway, it retains @@ -647,12 +723,11 @@ outages cannot block policy polling, enforcement, settings, or provider refreshes and cannot permanently lose the initial acknowledgement. Only sandbox-scoped revisions (`PolicySource::Sandbox`, version greater than -zero) are acknowledged. Global policies and local-file development policies do -not use the sandbox revision API and produce no acknowledgement. When explicit -local Rego and data files are provisioned into the supervisor, it continues -polling the gateway for settings and provider refreshes but never replaces the -local OPA engine with a gateway policy revision. Workload image files and -environment variables do not configure the separately isolated supervisor. +zero) use the policy revision acknowledgement API. Global policies use the +configuration admission contract without a sandbox policy revision acknowledgement. +Local Rego/data overrides remain available for standalone development; combining +them with a gateway-managed sandbox is rejected because the gateway cannot admit +the runtime policy it would enforce. ## Failure Behavior diff --git a/architecture/security-policy.md b/architecture/security-policy.md index 3b490ceee4..667694a1fc 100644 --- a/architecture/security-policy.md +++ b/architecture/security-policy.md @@ -160,6 +160,14 @@ flag defaults to `false` and is security-flagged in policy approval flows. Incremental merges only ever add the flag to a matching endpoint; clearing it requires removing the endpoint or replacing the policy. +Image discovery may persist a desired policy for repair, but does not authorize +workload activation. The gateway applies the credential gate after full provider +composition and provenance derivation. A rejected effective configuration keeps +startup blocked with a bounded diagnostic; the supervisor waits for management +repair instead of launching with connection-time denials or a fallback policy. +Accepted runtime state includes the matching provider-environment revision, so +policy and credential updates cannot activate independently. + The network supervisor independently enforces the same boundary. Credentialed WebSocket upgrades use the parsed relay, binary frames fail closed, and text placeholders require rewrite. REST bodies continue streaming when body rewrite is disabled. The relay holds diff --git a/crates/openshell-cli/src/run.rs b/crates/openshell-cli/src/run.rs index 87af586f8e..098c52c1cf 100644 --- a/crates/openshell-cli/src/run.rs +++ b/crates/openshell-cli/src/run.rs @@ -1173,7 +1173,16 @@ pub async fn sandbox_create( SandboxPhase::Error => { drop(stream); drop(client); - let create_result = if last_error_reason.is_empty() { + let provisioning_timed_out = last_sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| record.timeout_time.is_some()); + let create_result = if provisioning_timed_out { + Err(miette::miette!( + "{last_error_reason}\nSandbox '{sandbox_name}' was retained. Inspect it with `openshell sandbox get {sandbox_name}`; repair its configuration, then run `openshell sandbox start {sandbox_name}` after cleanup completes." + )) + } else if last_error_reason.is_empty() { Err(miette::miette!( "sandbox entered error phase while provisioning" )) @@ -1186,7 +1195,12 @@ pub async fn sandbox_create( finalize_sandbox_create_session( &effective_server, &sandbox_name, - persist, + persist + || last_sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| record.timeout_time.is_some()), create_result, workspace, &effective_tls, @@ -1567,11 +1581,23 @@ where sandbox.object_id().to_string() }; - let config = client + let config_result = client .get_sandbox_config(GetSandboxConfigRequest { sandbox_id }) - .await - .into_diagnostic()? - .into_inner(); + .await; + let config = match config_result { + Ok(response) => response.into_inner(), + Err(_) if !policy_only && configuration_failure_message(&sandbox).is_some() => { + // An invalid desired policy must not hide the status needed to + // repair it. Keep payload-only reads strict. + GetSandboxConfigResponse { + configuration_error: configuration_failure_message(&sandbox) + .unwrap_or_default() + .to_string(), + ..Default::default() + } + } + Err(error) => return Err(error).into_diagnostic(), + }; if policy_only { let Some(ref policy) = config.policy else { @@ -1605,6 +1631,22 @@ where println!(" {} {}", "Id:".dimmed(), id); println!(" {} {}", "Name:".dimmed(), name); println!(" {} {}", "Phase:".dimmed(), phase_name(sandbox.phase())); + if let Some(status) = sandbox.status.as_ref() { + for condition in &status.conditions { + if matches!( + condition.r#type.as_str(), + "ConfigurationReady" | "DesiredConfigurationReady" + ) && condition.status.eq_ignore_ascii_case("false") + { + println!( + " {} {}: {}", + "Configuration:".dimmed(), + condition.reason, + condition.message + ); + } + } + } if let Some(exit_code) = sandbox.status.as_ref().and_then(|status| status.exit_code) { println!(" {} {}", "Exit Code:".dimmed(), exit_code); } @@ -2467,7 +2509,19 @@ pub async fn sandbox_list( Ok(()) } +fn configuration_failure_message(sandbox: &Sandbox) -> Option<&str> { + sandbox + .status + .as_ref()? + .configuration_admission + .as_ref() + .map(|admission| admission.error.as_str()) + .filter(|message| !message.is_empty()) +} + fn sandbox_to_json(sandbox: &Sandbox) -> serde_json::Value { + use openshell_core::proto::ConfigurationAdmissionState; + let meta = sandbox.metadata.as_ref(); let labels = meta.map_or_else(|| serde_json::json!({}), |m| serde_json::json!(m.labels)); let annotations = meta.map_or_else( @@ -2507,6 +2561,37 @@ fn sandbox_to_json(sandbox: &Sandbox) -> serde_json::Value { }) .collect::>() }); + let admission = sandbox + .status + .as_ref() + .and_then(|status| status.configuration_admission.as_ref()) + .map(|admission| { + serde_json::json!({ + "state": match ConfigurationAdmissionState::try_from(admission.state) { + Ok(ConfigurationAdmissionState::Pending) => "pending", + Ok(ConfigurationAdmissionState::Accepted) => "accepted", + Ok(ConfigurationAdmissionState::Rejected) => "rejected", + _ => "unknown", + }, + "error": admission.error, + "policy_version": admission.policy_version, + "policy_hash": admission.policy_hash, + "config_revision": admission.config_revision, + "provider_env_revision": admission.provider_env_revision, + }) + }); + let provisioning = sandbox.status.as_ref().and_then(|status| status.provisioning.as_ref()) + .map(|record| serde_json::json!({ + "attempt_id": record.attempt_id, + "configuration_change_id": record.configuration_change_id, + "configuration_change_time": record.configuration_change_time.as_ref().map(ToString::to_string), + "first_rejection_time": record.first_rejection_time.as_ref().map(ToString::to_string), + "deadline": record.deadline.as_ref().map(ToString::to_string), + "timeout_time": record.timeout_time.as_ref().map(ToString::to_string), + "cleanup_completed_time": record.cleanup_completed_time.as_ref().map(ToString::to_string), + "cleanup_error": record.cleanup_error, + "cleanup_retry_time": record.cleanup_retry_time.as_ref().map(ToString::to_string), + })); serde_json::json!({ "id": sandbox.object_id(), "name": sandbox.object_name(), @@ -2520,6 +2605,8 @@ fn sandbox_to_json(sandbox: &Sandbox) -> serde_json::Value { "exit_code": sandbox.status.as_ref().and_then(|status| status.exit_code), "conditions": conditions, "endpoint_statuses": endpoint_statuses, + "configuration_admission": admission, + "provisioning": provisioning, "created_from_workload_template": created_from_workload_template, }) } @@ -7365,6 +7452,69 @@ mod tests { assert_eq!(json["resources"]["gpu"], 2); } + #[test] + fn provisioning_json_exposes_deadline_and_cleanup_separately() { + let mut sandbox = Sandbox::default(); + sandbox.set_phase(SandboxPhase::Error.into()); + sandbox.status.as_mut().unwrap().provisioning = + Some(openshell_core::proto::SandboxProvisioning { + attempt_id: "attempt".into(), + timeout_time: openshell_core::time::timestamp_from_millis(300_000).ok(), + cleanup_error: "Compute reclamation is pending; the gateway will retry".into(), + ..Default::default() + }); + let json = super::sandbox_to_json(&sandbox); + assert_eq!(json["provisioning"]["attempt_id"], "attempt"); + assert!(json["provisioning"]["deadline"].is_null()); + assert!(json["provisioning"]["cleanup_completed_time"].is_null()); + assert_eq!(json["provisioning"]["timeout_time"], "1970-01-01T00:05:00Z"); + assert!( + json["provisioning"]["cleanup_error"] + .as_str() + .unwrap() + .contains("pending") + ); + } + + #[test] + fn sandbox_json_exposes_repair_diagnostic_and_accepted_generation() { + use openshell_core::proto::{ConfigurationAdmissionState, SandboxConfigurationAdmission}; + + let mut sandbox = Sandbox::default(); + sandbox.set_phase(SandboxPhase::Provisioning as i32); + let status = sandbox.status.as_mut().unwrap(); + status.configuration_admission = Some(SandboxConfigurationAdmission { + state: ConfigurationAdmissionState::Rejected as i32, + error: "rule image_api requires L7 inspection".to_string(), + policy_hash: "candidate-hash".to_string(), + ..Default::default() + }); + status.conditions.push(SandboxCondition { + r#type: "ConfigurationReady".to_string(), + status: "False".to_string(), + reason: "ConfigurationInvalid".to_string(), + message: "rule image_api requires L7 inspection".to_string(), + ..Default::default() + }); + let json = super::sandbox_to_json(&sandbox); + assert_eq!(json["configuration_admission"]["state"], "rejected"); + assert_eq!(json["conditions"][0]["reason"], "ConfigurationInvalid"); + assert_eq!( + super::configuration_failure_message(&sandbox), + Some("rule image_api requires L7 inspection") + ); + sandbox + .status + .as_mut() + .unwrap() + .configuration_admission + .as_mut() + .unwrap() + .error + .clear(); + assert_eq!(super::configuration_failure_message(&sandbox), None); + } + #[test] fn sandbox_detail_to_json_includes_policy_fields() { let mut sandbox = Sandbox { diff --git a/crates/openshell-cli/tests/ensure_providers_integration.rs b/crates/openshell-cli/tests/ensure_providers_integration.rs index 730c7271d0..9541d38bf4 100644 --- a/crates/openshell-cli/tests/ensure_providers_integration.rs +++ b/crates/openshell-cli/tests/ensure_providers_integration.rs @@ -586,6 +586,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-cli/tests/mtls_integration.rs b/crates/openshell-cli/tests/mtls_integration.rs index e188d541f1..59ba2d287d 100644 --- a/crates/openshell-cli/tests/mtls_integration.rs +++ b/crates/openshell-cli/tests/mtls_integration.rs @@ -438,6 +438,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-cli/tests/provider_commands_integration.rs b/crates/openshell-cli/tests/provider_commands_integration.rs index a8b4579287..e6e5a10567 100644 --- a/crates/openshell-cli/tests/provider_commands_integration.rs +++ b/crates/openshell-cli/tests/provider_commands_integration.rs @@ -1318,6 +1318,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs index 5a5e00accb..033bd2479e 100644 --- a/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs +++ b/crates/openshell-cli/tests/sandbox_create_lifecycle_integration.rs @@ -862,6 +862,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-cli/tests/sandbox_name_fallback_integration.rs b/crates/openshell-cli/tests/sandbox_name_fallback_integration.rs index 316cd3d1d0..27cf9d63ea 100644 --- a/crates/openshell-cli/tests/sandbox_name_fallback_integration.rs +++ b/crates/openshell-cli/tests/sandbox_name_fallback_integration.rs @@ -528,6 +528,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-core/src/grpc_client.rs b/crates/openshell-core/src/grpc_client.rs index fcdbe907e3..a64fbaf918 100644 --- a/crates/openshell-core/src/grpc_client.rs +++ b/crates/openshell-core/src/grpc_client.rs @@ -43,6 +43,15 @@ use tonic::service::interceptor::InterceptedService; use tonic::transport::{Certificate, Channel, ClientTlsConfig, Endpoint, Identity}; use tracing::{debug, info, warn}; +/// Preserve the gRPC status as a source so callers can classify retryable errors. +/// `IntoDiagnostic` alone hides the wrapped error's concrete type. +pub fn grpc_status_error(status: Status) -> miette::Report { + #[derive(Debug, thiserror::Error, miette::Diagnostic)] + #[error("{0}")] + struct GrpcStatusError(#[source] Status); + GrpcStatusError(status).into() +} + /// Channel type after the [`AuthInterceptor`] is applied. Aliased so the /// generated client type signatures stay readable. pub type AuthedChannel = InterceptedService; @@ -920,7 +929,7 @@ async fn fetch_settings_snapshot_with_client( sandbox_id: sandbox_id.to_string(), }) .await - .into_diagnostic()?; + .map_err(grpc_status_error)?; Ok(settings_poll_result(response.into_inner())) } @@ -957,7 +966,7 @@ async fn sync_policy_with_client( ..Default::default() }) .await - .into_diagnostic() + .map_err(grpc_status_error) .wrap_err("failed to sync policy to server")?; Ok(()) @@ -1022,6 +1031,40 @@ pub async fn sync_policy_and_fetch_snapshot( fetch_settings_snapshot_with_client(&mut client, sandbox_id).await } +/// Report an exact runtime configuration generation. Pending registration uses +/// the snapshot's instance fence; retain that snapshot across registration retries. +pub async fn report_sandbox_configuration( + endpoint: &str, + sandbox_id: &str, + instance_id: &str, + snapshot: Option<&SettingsPollResult>, + state: crate::proto::ConfigurationAdmissionState, + error: &str, +) -> Result<()> { + let mut client = connect(endpoint).await?; + client + .report_sandbox_configuration(crate::proto::ReportSandboxConfigurationRequest { + sandbox_id: sandbox_id.to_string(), + expected_instance_id: snapshot.map_or_else(String::new, |snapshot| { + snapshot.configuration_instance_id.clone() + }), + admission: Some(crate::proto::SandboxConfigurationAdmission { + instance_id: instance_id.to_string(), + state: state.into(), + policy_version: snapshot.map_or(0, |snapshot| snapshot.version), + policy_hash: snapshot + .map_or_else(String::new, |snapshot| snapshot.policy_hash.clone()), + config_revision: snapshot.map_or(0, |snapshot| snapshot.config_revision), + provider_env_revision: snapshot + .map_or(0, |snapshot| snapshot.provider_env_revision), + error: error.to_string(), + }), + }) + .await + .map_err(grpc_status_error)?; + Ok(()) +} + /// Fetch provider environment variables for a sandbox from `OpenShell` server via gRPC. /// /// Returns the credential snapshot and its exact readiness identity. An empty @@ -1041,7 +1084,7 @@ pub async fn fetch_provider_environment( supports_static_credential_bindings: true, }) .await - .into_diagnostic()?; + .map_err(grpc_status_error)?; provider_environment_result(response.into_inner()) } @@ -1218,6 +1261,9 @@ pub struct CachedOpenShellClient { /// Settings poll result returned by [`CachedOpenShellClient::poll_settings`]. #[derive(Clone, Debug)] pub struct SettingsPollResult { + pub configuration_instance_id: String, + pub configuration_admitted: bool, + pub configuration_error: String, pub policy: Option, pub version: u32, pub policy_hash: String, @@ -1241,6 +1287,9 @@ pub struct SettingsPollResult { fn settings_poll_result(inner: crate::proto::GetSandboxConfigResponse) -> SettingsPollResult { SettingsPollResult { + configuration_instance_id: inner.configuration_instance_id, + configuration_admitted: inner.configuration_admitted, + configuration_error: inner.configuration_error, policy: inner.policy, version: inner.version, policy_hash: inner.policy_hash, diff --git a/crates/openshell-core/src/provider_credentials.rs b/crates/openshell-core/src/provider_credentials.rs index beec21de37..fee82e0d3f 100644 --- a/crates/openshell-core/src/provider_credentials.rs +++ b/crates/openshell-core/src/provider_credentials.rs @@ -729,6 +729,66 @@ impl ProviderCredentialState { Ok(inner.current.child_env.len()) } + /// Install a validated candidate without repeating fallible compilation. + /// + /// Existing clones keep observing this live state. Preserve suppressed + /// environment keys and identity history so refresh cannot restore removed + /// keys or authorize old placeholders for a different provider. Callers + /// must serialize installs and revocations, as for bound-environment installs. + pub fn install_prepared(&self, prepared: &Self) -> usize { + // Release the candidate lock before taking the live lock, including + // when a caller passes another handle to the same state. + let (snapshot, generations, current_resolver, bindings, non_secret_keys) = { + let candidate = prepared + .inner + .read() + .expect("provider credential state poisoned"); + ( + (*candidate.current).clone(), + candidate.generations.clone(), + candidate.current_resolver.clone(), + candidate.static_credential_bindings.clone(), + candidate.non_secret_environment_keys.clone(), + ) + }; + let mut inner = self + .inner + .write() + .expect("provider credential state poisoned"); + let mut snapshot = snapshot; + for key in &inner.suppressed_keys { + snapshot.child_env.remove(key); + } + if static_credential_identities(&inner.static_credential_bindings) + != static_credential_identities(&bindings) + { + inner.generations.clear(); + } + inner.generations.extend(generations); + while inner.generations.len() > MAX_RETAINED_CREDENTIAL_GENERATIONS { + inner.generations.pop_front(); + } + inner.current_resolver = current_resolver; + inner.combined_resolver = + merge_resolvers(&inner.generations, inner.current_resolver.as_ref()); + inner + .known_static_credential_keys + .extend(bindings.keys().cloned()); + update_static_credential_identity_epochs( + &mut inner.static_credential_identity_epochs, + snapshot.revision, + &bindings, + ); + inner.static_credential_bindings = bindings; + inner.non_secret_environment_keys = non_secret_keys; + inner.body_inventory_available = true; + inner + .known_body_keys + .extend(snapshot.child_env.keys().cloned()); + inner.current = Arc::new(snapshot); + inner.current.child_env.len() + } + /// Atomically remove static provider material after a failed refresh. /// /// Dynamic token grants retain their independently endpoint-bound state @@ -2369,6 +2429,95 @@ mod tests { ); } + #[test] + fn prepared_install_retains_placeholders_for_same_provider_identity() { + let make_state = |revision, secret: &str| { + ProviderCredentialState::from_bound_environment( + revision, + HashMap::from([("API_KEY".to_string(), secret.to_string())]), + HashMap::new(), + HashMap::new(), + HashMap::from([( + "API_KEY".to_string(), + binding("api.example.com", 443, "/**"), + )]), + Vec::new(), + ) + .unwrap() + }; + let live = make_state(1, "first-secret"); + let old_placeholder = live.snapshot().child_env["API_KEY"].clone(); + live.install_prepared(&make_state(2, "second-secret")); + let resolver = live + .resolver_for_endpoint("api.example.com", 443, "/") + .unwrap(); + assert_eq!( + resolver.resolve_placeholder(&old_placeholder), + Some("first-secret") + ); + assert_eq!( + resolver.resolve_placeholder(&live.snapshot().child_env["API_KEY"]), + Some("second-secret"), + ); + } + + #[test] + fn prepared_install_restores_body_inventory_after_revocation() { + let live = ProviderCredentialState::from_environment( + 1, + HashMap::new(), + HashMap::new(), + HashMap::new(), + ); + live.revoke_static_provider_environment(2); + assert!(!live.inner.read().unwrap().body_inventory_available); + let candidate = ProviderCredentialState::from_bound_environment( + 3, + HashMap::from([("NEW_KEY".to_string(), "secret".to_string())]), + HashMap::new(), + HashMap::new(), + HashMap::from([( + "NEW_KEY".to_string(), + binding("api.example.com", 443, "/**"), + )]), + Vec::new(), + ) + .unwrap(); + live.install_prepared(&candidate); + let inner = live.inner.read().unwrap(); + assert!(inner.body_inventory_available); + assert!(inner.known_body_keys.contains("NEW_KEY")); + } + + #[test] + fn prepared_install_preserves_suppression_and_rejects_replaced_identity() { + let make_state = |revision, identity: &str, secret: &str| { + let mut binding = binding("api.example.com", 443, "/**"); + binding.credential_identity = identity.to_string(); + ProviderCredentialState::from_bound_environment( + revision, + HashMap::from([("API_KEY".to_string(), secret.to_string())]), + HashMap::new(), + HashMap::new(), + HashMap::from([("API_KEY".to_string(), binding)]), + Vec::new(), + ) + .unwrap() + }; + let live = make_state(1, "first:API_KEY", "first-secret"); + let observer = live.clone(); + let old_placeholder = live.snapshot().child_env["API_KEY"].clone(); + live.remove_env_key("API_KEY"); + let candidate = make_state(2, "second:API_KEY", "second-secret"); + live.install_prepared(&candidate); + assert_eq!(observer.snapshot().revision, 2); + assert!(!observer.snapshot().child_env.contains_key("API_KEY")); + let resolver = observer + .resolver_for_endpoint("api.example.com", 443, "/") + .unwrap(); + assert!(resolver.resolve_placeholder(&old_placeholder).is_none()); + } + #[test] fn suppressed_keys_survive_install_environment() { let state = ProviderCredentialState::from_environment( diff --git a/crates/openshell-driver-docker/src/lib.rs b/crates/openshell-driver-docker/src/lib.rs index 1bdfac927f..7fa57ed07f 100644 --- a/crates/openshell-driver-docker/src/lib.rs +++ b/crates/openshell-driver-docker/src/lib.rs @@ -89,7 +89,6 @@ use url::Url; const WATCH_BUFFER: usize = 128; const WATCH_POLL_INTERVAL: Duration = Duration::from_secs(2); const WATCH_POLL_MAX_BACKOFF: Duration = Duration::from_secs(30); -const SUPERVISOR_READY_TIMEOUT: Duration = Duration::from_secs(90); // The gateway closes a supervisor session as soon as it commits a sandbox to // Stopping, just before the compute-driver StopSandbox RPC arrives. Give that // request a bounded opportunity to mark the control exit intentional before @@ -2131,27 +2130,36 @@ impl DockerComputeDriver { } async fn stop_sandbox_inner(&self, sandbox_id: &str, sandbox_name: &str) -> Result<(), Status> { - let Some(container) = self + let container = self .find_managed_container_summary(sandbox_id, sandbox_name) - .await? - else { - if let Some(record) = self - .remove_pending_sandbox(sandbox_id, sandbox_name) - .await? - { + .await?; + // Startup can still be waiting for supervisor readiness after the + // workload container exists. Cancel it before removing the supervisor + // so its failure path cannot delete retained workload storage. + let mut pending = self + .remove_pending_sandbox(sandbox_id, sandbox_name) + .await?; + if let Some(task) = pending.as_mut().and_then(|record| record.task.take()) { + task.abort(); + let _ = task.await; + } + let Some(container) = container else { + if let Some(record) = pending { self.stop_control_process(&record.sandbox.id).await; self.remove_auxiliary_containers_for_sandbox(&record.sandbox.id) .await?; self.clear_runtime_failure(&record.sandbox.id).await; - if let Some(task) = record.task { - task.abort(); - } remove_docker_channel_volume_by_id(&self.docker, &record.sandbox.id, &self.config) .await?; cleanup_docker_boundary_state(&record.sandbox, &self.config); self.publish_deleted(record.sandbox.id); return Ok(()); } + if !sandbox_id.is_empty() { + self.stop_control_process(sandbox_id).await; + self.remove_auxiliary_containers_for_sandbox(sandbox_id) + .await?; + } return Err(Status::not_found("sandbox not found")); }; let Some(target) = summary_container_target(&container) else { @@ -5161,64 +5169,43 @@ async fn wait_for_docker_supervisor_ready( supervisor_id: &str, sandbox_id: &str, ) -> Result<(), Status> { - let wait = async { - loop { - let sandbox = docker - .inspect_container(sandbox_id, None) - .await - .map_err(|error| { - Status::internal(format!("inspect Docker sandbox container: {error}")) - })?; - if sandbox.state.unwrap_or_default().running == Some(false) { + // Gateway provisioning deadlines own startup expiration, including policy + // repairs that extend the window. Unhealthy means not ready while the + // supervisor is quarantined; only a stopped process is a startup failure. + loop { + let sandbox = docker + .inspect_container(sandbox_id, None) + .await + .map_err(|error| { + Status::internal(format!("inspect Docker sandbox container: {error}")) + })?; + if sandbox.state.unwrap_or_default().running == Some(false) { + let sandbox_log_tail = docker_container_log_tail(docker, sandbox_id).await; + return Err(Status::unavailable(format!( + "Docker sandbox exited before supervisor became ready{}", + format_named_log_tail("sandbox log tail", &sandbox_log_tail) + ))); + } + let inspected = docker + .inspect_container(supervisor_id, None) + .await + .map_err(|error| { + Status::internal(format!("inspect Docker supervisor container: {error}")) + })?; + let state = inspected.state.unwrap_or_default(); + match state.health.and_then(|health| health.status) { + Some(HealthStatusEnum::HEALTHY) => return Ok(()), + _ if state.running == Some(false) => { + let log_tail = docker_container_log_tail(docker, supervisor_id).await; let sandbox_log_tail = docker_container_log_tail(docker, sandbox_id).await; return Err(Status::unavailable(format!( - "Docker sandbox exited before supervisor became ready{}", + "Docker supervisor exited before becoming ready{}{}", + format_log_tail(&log_tail), format_named_log_tail("sandbox log tail", &sandbox_log_tail) ))); } - let inspected = docker - .inspect_container(supervisor_id, None) - .await - .map_err(|error| { - Status::internal(format!("inspect Docker supervisor container: {error}")) - })?; - let state = inspected.state.unwrap_or_default(); - match state.health.and_then(|health| health.status) { - Some(HealthStatusEnum::HEALTHY) => return Ok(()), - Some(HealthStatusEnum::UNHEALTHY) => { - let log_tail = docker_container_log_tail(docker, supervisor_id).await; - let sandbox_log_tail = docker_container_log_tail(docker, sandbox_id).await; - return Err(Status::unavailable(format!( - "Docker supervisor failed its readiness check{}{}", - format_log_tail(&log_tail), - format_named_log_tail("sandbox log tail", &sandbox_log_tail) - ))); - } - _ if state.running == Some(false) => { - let log_tail = docker_container_log_tail(docker, supervisor_id).await; - let sandbox_log_tail = docker_container_log_tail(docker, sandbox_id).await; - return Err(Status::unavailable(format!( - "Docker supervisor exited before becoming ready{}{}", - format_log_tail(&log_tail), - format_named_log_tail("sandbox log tail", &sandbox_log_tail) - ))); - } - _ => tokio::time::sleep(Duration::from_millis(100)).await, - } + _ => tokio::time::sleep(Duration::from_millis(100)).await, } - }; - - if let Ok(result) = tokio::time::timeout(SUPERVISOR_READY_TIMEOUT, wait).await { - result - } else { - let log_tail = docker_container_log_tail(docker, supervisor_id).await; - let sandbox_log_tail = docker_container_log_tail(docker, sandbox_id).await; - Err(Status::deadline_exceeded(format!( - "Docker supervisor did not become ready within {} seconds{}{}", - SUPERVISOR_READY_TIMEOUT.as_secs(), - format_log_tail(&log_tail), - format_named_log_tail("sandbox log tail", &sandbox_log_tail) - ))) } } diff --git a/crates/openshell-driver-podman/src/driver.rs b/crates/openshell-driver-podman/src/driver.rs index 62142a3157..32419fdf3e 100644 --- a/crates/openshell-driver-podman/src/driver.rs +++ b/crates/openshell-driver-podman/src/driver.rs @@ -1250,11 +1250,7 @@ impl PodmanComputeDriver { )] pub async fn stop_sandbox(&self, sandbox_id: &str) -> Result<(), ComputeDriverError> { let span_status = openshell_otel::ErrorStatusGuard::current(); - let container = self - .find_container(sandbox_id) - .await? - .ok_or(ComputeDriverError::NotFound)?; - let container_id = container.id; + let container = self.find_container(sandbox_id).await?; let supervisor = crate::isolation::supervisor_name(sandbox_id); match self .client @@ -1264,6 +1260,8 @@ impl PodmanComputeDriver { Ok(()) | Err(PodmanApiError::NotFound(_)) => {} Err(error) => return Err(error.into()), } + let container = container.ok_or(ComputeDriverError::NotFound)?; + let container_id = container.id; if container.state == "stopping" { let result = async { let finished_at = self @@ -2013,6 +2011,24 @@ mod tests { assert!(matches!(err, ComputeDriverError::NotFound)); } + #[tokio::test] + async fn stop_missing_workload_still_reclaims_supervisor() { + let (socket, requests, handle) = spawn_podman_stub( + "stop-orphan-supervisor", + vec![ + StubResponse::new(StatusCode::OK, "[]"), + StubResponse::new(StatusCode::NO_CONTENT, ""), + ], + ); + let result = test_driver(socket).stop_sandbox("sandbox-1").await; + assert!(matches!(result, Err(ComputeDriverError::NotFound))); + handle.await.unwrap(); + let requests = requests.lock().unwrap(); + assert_eq!(requests.len(), 2); + assert!(requests[1].contains("/stop?timeout=10")); + assert!(requests[1].contains(&crate::isolation::supervisor_name("sandbox-1"))); + } + #[tokio::test] async fn stop_and_start_target_the_existing_container() { let (stop_socket, stop_requests, stop_handle) = spawn_podman_stub( diff --git a/crates/openshell-sandbox-backend/src/boundary_protocol.rs b/crates/openshell-sandbox-backend/src/boundary_protocol.rs index 73668daae1..05542fb2bc 100644 --- a/crates/openshell-sandbox-backend/src/boundary_protocol.rs +++ b/crates/openshell-sandbox-backend/src/boundary_protocol.rs @@ -520,6 +520,8 @@ impl fmt::Debug for RequestEnvelope { #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "operation", rename_all = "snake_case")] pub enum Request { + /// Read image policy without attaching or launching a workload. + DiscoverPolicy, Attach { supervisor_instance_id: SupervisorInstanceId, policy: Box, @@ -603,6 +605,7 @@ impl Request { impl fmt::Debug for Request { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + Self::DiscoverPolicy => formatter.write_str("DiscoverPolicy"), Self::Attach { supervisor_instance_id: _, policy: _, @@ -701,6 +704,10 @@ pub struct ResponseEnvelope { #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "result", rename_all = "snake_case")] pub enum Response { + ImagePolicy { + yaml: Option, + invalid: bool, + }, Attached { snapshot: SessionSnapshotWire, }, diff --git a/crates/openshell-sandbox-backend/src/runtime.rs b/crates/openshell-sandbox-backend/src/runtime.rs index 96085e0940..1b56d6df9d 100644 --- a/crates/openshell-sandbox-backend/src/runtime.rs +++ b/crates/openshell-sandbox-backend/src/runtime.rs @@ -69,6 +69,20 @@ pub struct OpenShellRuntimeBackend { } impl OpenShellRuntimeBackend { + /// Read the workload image policy over the authenticated boundary before admission. + pub async fn discover_policy( + descriptor: SandboxRuntimeDescriptor, + bearer: openshell_core::jwt::SessionBearerTokenSlot, + ) -> Result<(Option, bool), BackendError> { + let client = BoundaryClient::new(descriptor, bearer); + match client.call_idempotent(Request::DiscoverPolicy).await? { + Response::ImagePolicy { yaml, invalid } => Ok((yaml, invalid)), + _ => Err(BackendError::Descriptor( + "expected image policy discovery response".to_string(), + )), + } + } + pub fn new( ca_file_paths: Arc>>, provider_credentials: openshell_core::provider_credentials::ProviderCredentialState, @@ -1074,7 +1088,7 @@ impl BoundaryClient { async fn call_idempotent(&self, request: Request) -> Result { let remember_attach = matches!(request, Request::Attach { .. }); let remember_confirm = matches!(request, Request::Confirm); - let timeout = if remember_attach { + let timeout = if remember_attach || matches!(request, Request::DiscoverPolicy) { ATTACH_REQUEST_TIMEOUT } else { REQUEST_TIMEOUT @@ -1999,6 +2013,10 @@ mod tests { match encode_frame(&ResponseEnvelope { request_id: envelope.request_id, response: match envelope.request { + Request::DiscoverPolicy => Response::ImagePolicy { + yaml: None, + invalid: false, + }, Request::Attach { .. } => Response::Attached { snapshot: crate::boundary_protocol::SessionSnapshotWire { generation: "test-generation".to_string(), diff --git a/crates/openshell-sandbox/src/boundary_server.rs b/crates/openshell-sandbox/src/boundary_server.rs index a926074f95..5452ea6efa 100644 --- a/crates/openshell-sandbox/src/boundary_server.rs +++ b/crates/openshell-sandbox/src/boundary_server.rs @@ -1537,12 +1537,53 @@ mod linux { .map_err(|error| tonic::Status::unauthenticated(error.to_string())) } + fn discover_image_policy() -> Response { + Self::discover_image_policy_from_paths(&[ + openshell_policy::CONTAINER_POLICY_PATH, + openshell_policy::LEGACY_CONTAINER_POLICY_PATH, + ]) + } + + fn discover_image_policy_from_paths(paths: &[&str]) -> Response { + use std::io::Read as _; + for path in paths { + match File::open(path) { + Ok(file) => { + let mut yaml = String::new(); + if file.take(1_048_577).read_to_string(&mut yaml).is_err() + || yaml.len() > 1_048_576 + { + return Response::ImagePolicy { + yaml: None, + invalid: true, + }; + } + return Response::ImagePolicy { + yaml: Some(yaml), + invalid: false, + }; + } + Err(error) if error.kind() == io::ErrorKind::NotFound => {} + Err(_) => { + return Response::ImagePolicy { + yaml: None, + invalid: true, + }; + } + } + } + Response::ImagePolicy { + yaml: None, + invalid: false, + } + } + fn authorize_request( &self, principal: &SandboxProtocolPrincipal, request: &Request, ) -> Result<(), String> { - if matches!(request, Request::Attach { .. }) { + if matches!(request, Request::Attach { .. } | Request::DiscoverPolicy) { return Ok(()); } if matches!(request, Request::Confirm) { @@ -1830,6 +1871,7 @@ mod linux { let request_id = envelope.request_id; let payload_digest = envelope.payload_digest; let response = match envelope.request { + Request::DiscoverPolicy => Self::discover_image_policy(), Request::Attach { supervisor_instance_id: _, policy, @@ -4258,6 +4300,46 @@ mod linux { ) } + #[test] + fn image_discovery_preserves_invalid_content_and_bounds_reads() { + let directory = tempfile::tempdir().unwrap(); + let primary = directory.path().join("policy.yaml"); + let legacy = directory.path().join("legacy.yaml"); + let paths = [primary.to_str().unwrap(), legacy.to_str().unwrap()]; + assert_eq!( + BoundaryRuntime::discover_image_policy_from_paths(&paths), + Response::ImagePolicy { + yaml: None, + invalid: false + } + ); + std::fs::write(&legacy, "legacy policy").unwrap(); + assert_eq!( + BoundaryRuntime::discover_image_policy_from_paths(&paths), + Response::ImagePolicy { + yaml: Some("legacy policy".to_string()), + invalid: false + } + ); + // Parsing belongs to admission; malformed primary content must never fall back. + std::fs::write(&primary, "not: [valid yaml").unwrap(); + assert_eq!( + BoundaryRuntime::discover_image_policy_from_paths(&paths), + Response::ImagePolicy { + yaml: Some("not: [valid yaml".to_string()), + invalid: false + } + ); + std::fs::write(&primary, vec![b'x'; 1_048_577]).unwrap(); + assert_eq!( + BoundaryRuntime::discover_image_policy_from_paths(&paths), + Response::ImagePolicy { + yaml: None, + invalid: true + } + ); + } + #[test] fn unix_listener_allows_authenticated_cross_uid_control() { use std::os::unix::fs::PermissionsExt as _; diff --git a/crates/openshell-sdk/tests/client_mock.rs b/crates/openshell-sdk/tests/client_mock.rs index f2fc52b5ff..34678e23e1 100644 --- a/crates/openshell-sdk/tests/client_mock.rs +++ b/crates/openshell-sdk/tests/client_mock.rs @@ -701,6 +701,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("unused")) } + async fn report_sandbox_configuration( + &self, + _: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _: tonic::Request, diff --git a/crates/openshell-server/src/auth/method_authz.rs b/crates/openshell-server/src/auth/method_authz.rs index 35ff82e925..92d3b0a56a 100644 --- a/crates/openshell-server/src/auth/method_authz.rs +++ b/crates/openshell-server/src/auth/method_authz.rs @@ -128,6 +128,9 @@ mod tests { assert!(!is_user_callable( "/openshell.v1.OpenShell/ReportPolicyStatus" )); + assert!(!is_user_callable( + "/openshell.v1.OpenShell/ReportSandboxConfiguration" + )); assert!(!is_user_callable("/openshell.v1.OpenShell/PushSandboxLogs")); assert!(!is_user_callable( "/openshell.v1.OpenShell/GetSandboxProviderEnvironment" diff --git a/crates/openshell-server/src/compute/mod.rs b/crates/openshell-server/src/compute/mod.rs index 4cca02d6ac..9732999c31 100644 --- a/crates/openshell-server/src/compute/mod.rs +++ b/crates/openshell-server/src/compute/mod.rs @@ -5,6 +5,7 @@ pub mod driver_config; pub mod lease; +pub mod provisioning_deadline; pub mod rootfs_tar; use crate::grpc::policy::SANDBOX_SETTINGS_OBJECT_TYPE; @@ -328,6 +329,21 @@ pub struct ComputeDriverInfoSnapshot { pub rootfs_tar_max_bytes: u64, } +// Startup recovery owns persisted desired state before normal observations +// resume. Only deadline enforcement may run while startup is still pending. +async fn wait_for_startup( + mut startup: watch::Receiver, + mut cancel: watch::Receiver, +) -> bool { + if *cancel.borrow() { + return false; + } + tokio::select! { + result = startup.wait_for(|ready| *ready) => result.is_ok(), + _ = cancel.changed() => false, + } +} + /// Interval between store-vs-backend reconciliation sweeps. const RECONCILE_INTERVAL: Duration = Duration::from_mins(1); @@ -1156,15 +1172,14 @@ impl ComputeRuntime { let request_span = tracing::Span::current(); tokio::spawn( async move { - runtime - .complete_sandbox_stop( - sandbox_id, - sandbox_name, - previous, - stopping, - lifecycle_guard, - ) - .await + Box::pin(runtime.complete_sandbox_stop( + sandbox_id, + sandbox_name, + previous, + stopping, + lifecycle_guard, + )) + .await } .instrument(request_span), ) @@ -1269,6 +1284,17 @@ impl ComputeRuntime { .await .map_err(|e| Status::internal(format!("fetch sandbox failed: {e}")))? .ok_or_else(|| Status::not_found("sandbox not found"))?; + if provisioning_deadline::timed_out(&candidate) + && candidate + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| record.cleanup_completed_time.is_none()) + { + return Err(Status::failed_precondition( + "provisioning timeout cleanup is still pending; retry start after compute is reclaimed", + )); + } let sandbox_id = candidate.object_id().to_string(); let sandbox_name = candidate.object_name().to_string(); let lifecycle_guard = self.lifecycle_gates.lock_for(&sandbox_id).await; @@ -1289,10 +1315,24 @@ impl ComputeRuntime { if phase == SandboxPhase::Ready { return Ok(current); } + let provisioning_timeout = + phase == SandboxPhase::Error && provisioning_deadline::timed_out(¤t); + if provisioning_timeout + && current + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| record.cleanup_completed_time.is_none()) + { + return Err(Status::failed_precondition( + "provisioning timeout cleanup is still pending; retry start after compute is reclaimed", + )); + } if !matches!( phase, SandboxPhase::Stopped | SandboxPhase::Completed | SandboxPhase::Starting ) && !is_failed_main_process_result(¤t) + && !provisioning_timeout { return Err(Status::failed_precondition(format!( "sandbox must be Stopped, Completed, or a failed main-process Error to start (current phase: {phase:?})" @@ -1331,16 +1371,15 @@ impl ComputeRuntime { let request_span = tracing::Span::current(); tokio::spawn( async move { - runtime - .complete_sandbox_start( - sandbox_id, - sandbox_name, - previous, - starting, - lifecycle_guard, - launch_authentication, - ) - .await + Box::pin(runtime.complete_sandbox_start( + sandbox_id, + sandbox_name, + previous, + starting, + lifecycle_guard, + launch_authentication, + )) + .await } .instrument(request_span), ) @@ -1352,6 +1391,30 @@ impl ComputeRuntime { })? } + /// Release the lifecycle gate after the durable deadline expires, allowing + /// cleanup to cancel partial startup. Configuration repairs can extend this + /// deadline, so a fixed timeout around the driver RPC would expire too soon. + async fn await_provisioning_operation( + &self, + starting: &Sandbox, + operation: impl std::future::Future>, + ) -> Result { + tokio::pin!(operation); + loop { + tokio::select! { + result = &mut operation => return result, + () = tokio::time::sleep(Duration::from_secs(1)) => { + let current = self.store.get_message::(starting.object_id()) + .await.map_err(|error| Status::internal(error.to_string()))? + .ok_or_else(|| Status::not_found("sandbox removed during startup"))?; + if provisioning_deadline::timed_out(¤t) { + return Err(Status::deadline_exceeded("provisioning repair window expired")); + } + } + } + } + } + async fn complete_sandbox_start( &self, sandbox_id: String, @@ -1364,28 +1427,64 @@ impl ComputeRuntime { let generation_id = sandbox_runtime_generation(&starting) .map_err(Status::failed_precondition)? .into_string(); - let result = self - .driver - .call( - openshell_otel::rpc::START_SANDBOX, - Some(&sandbox_id), - |driver| { - let sandbox_id = sandbox_id.clone(); - let sandbox_name = sandbox_name.clone(); - async move { - driver - .start_sandbox(Request::new(StartSandboxRequest { - sandbox_id, - sandbox_name, - launch_authentication, - generation_id, - })) - .await - } - }, + let authentication_for_recreate = launch_authentication.clone(); + let mut result = self + .await_provisioning_operation( + &starting, + self.driver.call( + openshell_otel::rpc::START_SANDBOX, + Some(&sandbox_id), + |driver| { + let sandbox_id = sandbox_id.clone(); + let sandbox_name = sandbox_name.clone(); + async move { + driver + .start_sandbox(Request::new(StartSandboxRequest { + sandbox_id, + sandbox_name, + launch_authentication, + generation_id, + })) + .await + } + }, + ), ) .await; + if provisioning_deadline::timed_out(&previous) + && matches!(&result, Err(error) if error.code() == Code::NotFound) + { + // A partial provisioning attempt may have been canceled before a + // restartable backend object existed. Keep the API identity/spec. + let mut driver_sandbox = driver_sandbox_from_public(&starting, &self.driver_info.name) + .map_err(|status| *status)?; + if let Some(spec) = driver_sandbox.spec.as_mut() { + spec.launch_authentication = authentication_for_recreate; + } + result = self + .await_provisioning_operation( + &starting, + self.driver.call( + openshell_otel::rpc::CREATE_SANDBOX, + Some(&sandbox_id), + |driver| async move { + driver + .create_sandbox(Request::new(CreateSandboxRequest { + sandbox: Some(driver_sandbox), + })) + .await + .map(|_| { + tonic::Response::new( + openshell_core::proto::compute::v1::StartSandboxResponse {}, + ) + }) + }, + ), + ) + .await; + } + match result { Ok(_) => { let _global_guard = self.lock_global_for_lifecycle(&lifecycle_guard).await; @@ -1423,7 +1522,12 @@ impl ComputeRuntime { ) { let sandbox_id = transition.object_id(); let sandbox_name = transition.object_name(); - let observed = self.get_driver_sandbox(sandbox_id, sandbox_name).await; + let observed = tokio::time::timeout( + Duration::from_secs(10), + self.get_driver_sandbox(sandbox_id, sandbox_name), + ) + .await + .unwrap_or_else(|_| Err("compute lifecycle reconciliation timed out".into())); let _global_guard = self.lock_global_for_lifecycle(lifecycle_guard).await; match observed { @@ -1533,6 +1637,20 @@ impl ComputeRuntime { // Retain the previous instance id as a tombstone until // the restarted supervisor registers its new id. status.exit_code = None; + if phase == SandboxPhase::Starting { + status.provisioning = Some(provisioning_deadline::new_record( + openshell_core::time::now_ms(), + )); + status.configuration_admission = + Some(openshell_core::proto::SandboxConfigurationAdmission { + // Fence delayed registrations from the previous runtime. + instance_id: uuid::Uuid::new_v4().to_string(), + state: + openshell_core::proto::ConfigurationAdmissionState::Pending + .into(), + ..Default::default() + }); + } } upsert_ready_condition( &mut sandbox.status, @@ -1621,9 +1739,7 @@ impl ComputeRuntime { let request_span = tracing::Span::current(); tokio::spawn( async move { - runtime - .delete_sandbox_inner(target, delete_guard, global_guard) - .await + Box::pin(runtime.delete_sandbox_inner(target, delete_guard, global_guard)).await } .instrument(request_span), ) @@ -2179,20 +2295,36 @@ impl ComputeRuntime { Ok(sandbox) } - pub fn spawn_watchers(&self, shutdown_rx: watch::Receiver) { + pub fn spawn_watchers( + &self, + shutdown_rx: watch::Receiver, + startup_rx: watch::Receiver, + ) { let runtime = Arc::new(self.clone()); if self.store.is_single_replica() { + let deadline_runtime = runtime.clone(); + let deadline_shutdown = shutdown_rx.clone(); + tokio::spawn(async move { + deadline_runtime.provisioning_loop(deadline_shutdown).await; + }); let watch_runtime = runtime.clone(); let watch_shutdown = shutdown_rx.clone(); + let watch_startup = startup_rx.clone(); tokio::spawn(async move { + if !wait_for_startup(watch_startup, watch_shutdown.clone()).await { + return; + } Box::pin(watch_runtime.watch_loop(watch_shutdown)).await; }); tokio::spawn(async move { + if !wait_for_startup(startup_rx, shutdown_rx.clone()).await { + return; + } runtime.reconcile_loop(shutdown_rx).await; }); } else { tokio::spawn(async move { - runtime.lease_coordinator(shutdown_rx).await; + runtime.lease_coordinator(shutdown_rx, startup_rx).await; }); } } @@ -2429,25 +2561,27 @@ impl ComputeRuntime { } }; match self - .driver - .call( - openshell_otel::rpc::START_SANDBOX, - Some(&sandbox_id), - |driver| { - let sandbox_id = sandbox_id.clone(); - let sandbox_name = sandbox_name.clone(); - let launch_authentication = launch_authentication.clone(); - async move { - driver - .start_sandbox(Request::new(StartSandboxRequest { - sandbox_id, - sandbox_name, - launch_authentication, - generation_id, - })) - .await - } - }, + .await_provisioning_operation( + &sandbox, + self.driver.call( + openshell_otel::rpc::START_SANDBOX, + Some(&sandbox_id), + |driver| { + let sandbox_id = sandbox_id.clone(); + let sandbox_name = sandbox_name.clone(); + let launch_authentication = launch_authentication.clone(); + async move { + driver + .start_sandbox(Request::new(StartSandboxRequest { + sandbox_id, + sandbox_name, + launch_authentication, + generation_id, + })) + .await + } + }, + ), ) .await { @@ -2665,6 +2799,9 @@ impl ComputeRuntime { match self .store .update_message_cas::(&sandbox_id, 0, |s| { + if provisioning_deadline::timed_out(s) { + return; + } s.set_phase(SandboxPhase::Error as i32); let name = s.object_name().to_string(); upsert_ready_condition( @@ -2737,7 +2874,11 @@ impl ComputeRuntime { } } - async fn lease_coordinator(self: Arc, mut shutdown_rx: watch::Receiver) { + async fn lease_coordinator( + self: Arc, + mut shutdown_rx: watch::Receiver, + startup_rx: watch::Receiver, + ) { use lease::{LEASE_ACQUIRE_INTERVAL, LEASE_TTL, ReconcilerLease}; let lease = ReconcilerLease::new(self.store.clone(), self.replica_id.clone(), LEASE_TTL); @@ -2751,7 +2892,8 @@ impl ComputeRuntime { match lease.acquire_or_steal().await { Ok(guard) => { info!(replica = %lease.replica_id(), "acquired reconciler lease"); - self.run_as_holder(&lease, guard, &mut shutdown_rx).await; + self.run_as_holder(&lease, guard, &mut shutdown_rx, startup_rx.clone()) + .await; } Err(e) => { debug!( @@ -2779,6 +2921,7 @@ impl ComputeRuntime { lease: &lease::ReconcilerLease, mut guard: lease::LeaseGuard, shutdown_rx: &mut watch::Receiver, + startup_rx: watch::Receiver, ) { use lease::LEASE_RENEWAL_INTERVAL; @@ -2786,12 +2929,24 @@ impl ComputeRuntime { let runtime = self.clone(); let watch_cancel = cancel_rx.clone(); + let watch_startup = startup_rx.clone(); let watch_handle = tokio::spawn(async move { + if !wait_for_startup(watch_startup, watch_cancel.clone()).await { + return; + } Box::pin(runtime.watch_loop(watch_cancel)).await; }); + let runtime = self.clone(); + let deadline_cancel = cancel_rx.clone(); + let deadline_handle = tokio::spawn(async move { + runtime.provisioning_loop(deadline_cancel).await; + }); let runtime = self.clone(); let reconcile_handle = tokio::spawn(async move { + if !wait_for_startup(startup_rx, cancel_rx.clone()).await { + return; + } runtime.reconcile_loop(cancel_rx).await; }); @@ -2821,6 +2976,7 @@ impl ComputeRuntime { let _ = cancel_tx.send(true); let _ = watch_handle.await; let _ = reconcile_handle.await; + let _ = deadline_handle.await; return; } } @@ -2830,6 +2986,7 @@ impl ComputeRuntime { let _ = cancel_tx.send(true); let _ = watch_handle.await; let _ = reconcile_handle.await; + let _ = deadline_handle.await; info!(replica = %lease.replica_id(), "reconciler lease lost — returning to standby"); } @@ -3229,10 +3386,11 @@ impl ComputeRuntime { let current_phase = SandboxPhase::try_from(current.phase()).unwrap_or(SandboxPhase::Unknown); if connected - && matches!( - current_phase, - SandboxPhase::Deleting | SandboxPhase::Stopping | SandboxPhase::Stopped - ) + && (provisioning_deadline::timed_out(¤t) + || matches!( + current_phase, + SandboxPhase::Deleting | SandboxPhase::Stopping | SandboxPhase::Stopped + )) { return Err(format!( "sandbox is not accepting supervisor sessions while {current_phase:?}" @@ -3277,6 +3435,7 @@ impl ComputeRuntime { ensure_supervisor_not_ready_status(&mut sandbox.status, &sandbox_name); sandbox.set_phase(SandboxPhase::Provisioning as i32); } + apply_configuration_readiness(sandbox); }, ) .await; @@ -3350,6 +3509,9 @@ impl ComputeRuntime { else { return Ok(()); }; + if provisioning_deadline::timed_out(&existing) { + return Ok(()); + } let phase = SandboxPhase::try_from(existing.phase()).unwrap_or(SandboxPhase::Unknown); if matches!( phase, @@ -3450,6 +3612,9 @@ impl ComputeRuntime { } fn schedule_ephemeral_sandbox_delete(&self, sandbox: &Sandbox) { + if provisioning_deadline::timed_out(sandbox) { + return; + } let ephemeral = sandbox.metadata.as_ref().is_some_and(|metadata| { metadata .annotations @@ -3486,6 +3651,11 @@ impl ComputeRuntime { .await .map_err(|e| e.to_string())?; if let Some(sandbox) = sandbox.as_ref() { + if provisioning_deadline::timed_out(sandbox) + && sandbox.phase() == i32::from(SandboxPhase::Error) + { + return Ok(()); + } // The watcher told us this sandbox's compute resource is gone, so // no request-side DeleteSandbox call is coming — release // driver-owned resources in the background. Watch events are @@ -3863,7 +4033,10 @@ impl ComputeRuntime { let sandbox = decode_sandbox_record(¤t_record)?; let phase = SandboxPhase::try_from(sandbox.phase()).unwrap_or(SandboxPhase::Unknown); - if phase == SandboxPhase::Completed || is_failed_main_process_result(&sandbox) { + if phase == SandboxPhase::Completed + || is_failed_main_process_result(&sandbox) + || provisioning_deadline::timed_out(&sandbox) + { // A terminal canonical process may legitimately have removed its // transient compute object. Keep the durable command result. return Ok(()); @@ -4525,6 +4698,9 @@ fn public_status_from_driver( main_process_instance_id: String::new(), exit_code: None, endpoint_statuses: Vec::new(), + configuration_admission: None, + configuration_activated: None, + provisioning: None, } } @@ -4615,6 +4791,21 @@ fn apply_driver_snapshot( SandboxPhase::Stopped if driver_snapshot_confirms_starting(incoming) => phase, SandboxPhase::Stopped => SandboxPhase::Stopped, SandboxPhase::Completed => SandboxPhase::Completed, + SandboxPhase::Starting + if phase != SandboxPhase::Error + && sandbox + .status + .as_ref() + .and_then(|status| status.configuration_admission.as_ref()) + .is_some_and(|admission| { + admission.state + != i32::from( + openshell_core::proto::ConfigurationAdmissionState::Accepted, + ) + }) => + { + SandboxPhase::Starting + } SandboxPhase::Starting if !matches!(phase, SandboxPhase::Ready | SandboxPhase::Error) => { SandboxPhase::Starting } @@ -4636,6 +4827,11 @@ fn apply_driver_snapshot( .main_process_instance_id .clone_from(¤t_status.main_process_instance_id); status.exit_code = current_status.exit_code; + status + .configuration_admission + .clone_from(¤t_status.configuration_admission); + status.configuration_activated = current_status.configuration_activated; + status.provisioning.clone_from(¤t_status.provisioning); } if old_phase != phase { info!( @@ -4672,6 +4868,73 @@ fn apply_driver_snapshot( sandbox.status = status; sandbox.set_phase(phase as i32); sandbox.set_current_policy_version(cpv); + apply_configuration_readiness(sandbox); +} + +/// Configuration readiness is independent of compute/container readiness. +pub fn apply_configuration_readiness(sandbox: &mut Sandbox) { + use openshell_core::proto::ConfigurationAdmissionState; + let Some(status) = sandbox.status.as_mut() else { + return; + }; + let Some(admission) = status.configuration_admission.as_ref() else { + provisioning_deadline::reconcile_readiness(sandbox, openshell_core::time::now_ms()); + return; + }; + let accepted = admission.state == i32::from(ConfigurationAdmissionState::Accepted); + let reason = if accepted { + "ConfigurationAccepted" + } else if admission.state == i32::from(ConfigurationAdmissionState::Rejected) { + "ConfigurationInvalid" + } else { + "ConfigurationPending" + }; + let desired_error = admission.error.clone(); + let message = if accepted { + String::new() + } else if admission.error.is_empty() { + "Waiting for effective configuration validation before workload activation".to_string() + } else { + admission.error.clone() + }; + status.conditions.retain(|condition| { + condition.r#type != "ConfigurationReady" && condition.r#type != "DesiredConfigurationReady" + }); + status.conditions.push(SandboxCondition { + r#type: "ConfigurationReady".to_string(), + status: if accepted { "True" } else { "False" }.to_string(), + reason: reason.to_string(), + message: message.clone(), + ..Default::default() + }); + if accepted && !desired_error.is_empty() { + status.conditions.push(SandboxCondition { + r#type: "DesiredConfigurationReady".to_string(), + status: "False".to_string(), + reason: "ConfigurationInvalid".to_string(), + message: desired_error, + ..Default::default() + }); + } + if !accepted + && matches!( + SandboxPhase::try_from(status.phase), + Ok(SandboxPhase::Ready | SandboxPhase::Provisioning) + ) + { + status.phase = SandboxPhase::Provisioning as i32; + status + .conditions + .retain(|condition| condition.r#type != "Ready"); + status.conditions.push(SandboxCondition { + r#type: "Ready".to_string(), + status: "False".to_string(), + reason: reason.to_string(), + message, + ..Default::default() + }); + } + provisioning_deadline::reconcile_readiness(sandbox, openshell_core::time::now_ms()); } fn driver_snapshot_confirms_stopped(incoming: &DriverSandbox) -> bool { @@ -5241,6 +5504,82 @@ mod tests { use tokio::sync::{Notify, Semaphore, mpsc, oneshot}; use tokio_stream::wrappers::UnboundedReceiverStream; + #[test] + fn configuration_admission_survives_driver_ready_observations() { + use openshell_core::proto::{ + ConfigurationAdmissionState as Admission, SandboxConfigurationAdmission, + }; + let mut sandbox = Sandbox::default(); + sandbox.set_phase(SandboxPhase::Provisioning as i32); + sandbox.status.as_mut().unwrap().configuration_admission = + Some(SandboxConfigurationAdmission { + instance_id: "instance".to_string(), + state: Admission::Rejected.into(), + error: "Invalid credentialed endpoint in rule image".to_string(), + ..Default::default() + }); + let incoming = ready_driver_sandbox("sandbox", "sandbox"); + apply_driver_snapshot(&mut sandbox, &incoming, true, true); + assert_eq!(sandbox.phase(), SandboxPhase::Provisioning as i32); + assert!( + sandbox + .status + .as_ref() + .unwrap() + .conditions + .iter() + .any(|condition| condition.reason == "ConfigurationInvalid" + && condition.status == "False") + ); + sandbox + .status + .as_mut() + .unwrap() + .configuration_admission + .as_mut() + .unwrap() + .state = Admission::Accepted.into(); + apply_driver_snapshot(&mut sandbox, &incoming, true, true); + assert_eq!(sandbox.phase(), SandboxPhase::Ready as i32); + assert!( + sandbox + .status + .as_ref() + .unwrap() + .conditions + .iter() + .any(|condition| condition.reason == "ConfigurationAccepted" + && condition.status == "True") + ); + } + + #[test] + fn configuration_admission_preserves_starting_for_early_exit_reports() { + use openshell_core::proto::{ + ConfigurationAdmissionState as Admission, SandboxConfigurationAdmission, + }; + let mut sandbox = Sandbox::default(); + sandbox.set_phase(SandboxPhase::Starting as i32); + let status = sandbox.status.as_mut().unwrap(); + status.main_process_instance_id = "previous-instance".to_string(); + status.configuration_admission = Some(SandboxConfigurationAdmission { + state: Admission::Pending.into(), + ..Default::default() + }); + apply_configuration_readiness(&mut sandbox); + apply_driver_snapshot( + &mut sandbox, + &ready_driver_sandbox("sandbox", "sandbox"), + false, + true, + ); + assert_eq!(sandbox.phase(), SandboxPhase::Starting as i32); + assert_eq!( + sandbox.status.as_ref().unwrap().main_process_instance_id, + "previous-instance" + ); + } + fn string_value(value: &str) -> prost_types::Value { prost_types::Value { kind: Some(prost_types::value::Kind::StringValue(value.to_string())), @@ -7442,7 +7781,8 @@ mod tests { async fn stop_and_start_follow_durable_state_machine() { let driver = ControlledDriver::new(); let runtime = test_runtime(driver.clone()).await; - let sandbox = sandbox_record("sb-lifecycle", "sandbox-lifecycle", SandboxPhase::Ready); + let mut sandbox = sandbox_record("sb-lifecycle", "sandbox-lifecycle", SandboxPhase::Ready); + sandbox.status.as_mut().unwrap().configuration_activated = Some(true); runtime.store.put_message(&sandbox).await.unwrap(); let session = ssh_session_record("lifecycle-session", sandbox.object_id()); runtime.store.put_message(&session).await.unwrap(); @@ -7494,6 +7834,46 @@ mod tests { driver.set_get_outcome(ControlledGetOutcome::Sandbox(Box::new( ready_driver_sandbox(sandbox.object_id(), sandbox.object_name()), ))); + runtime + .apply_sandbox_update(ready_driver_sandbox( + sandbox.object_id(), + sandbox.object_name(), + )) + .await + .unwrap(); + let blocked = runtime + .store + .get_message::(sandbox.object_id()) + .await + .unwrap() + .unwrap(); + assert_eq!( + blocked.phase(), + SandboxPhase::Starting as i32, + "driver/session readiness cannot bypass restart configuration admission" + ); + assert_eq!( + blocked.status.as_ref().unwrap().configuration_activated, + Some(true) + ); + assert!(!crate::policy_store::permits_initial_static_policy_repair( + &blocked + )); + // Simulate the supervisor's successful exact-generation admission report. + runtime + .store + .update_message_cas::(sandbox.object_id(), 0, |sandbox| { + sandbox + .status + .as_mut() + .unwrap() + .configuration_admission + .as_mut() + .unwrap() + .state = openshell_core::proto::ConfigurationAdmissionState::Accepted.into(); + }) + .await + .unwrap(); runtime .apply_sandbox_update(ready_driver_sandbox( sandbox.object_id(), @@ -12046,4 +12426,412 @@ mod tests { .unwrap(); assert_eq!(stored.object_workspace(), "alpha"); } + async fn seed_provisioning_attempt(runtime: &ComputeRuntime) -> Sandbox { + let mut sandbox = sandbox_record("sb-ttl", "sandbox-ttl", SandboxPhase::Provisioning); + let status = sandbox.status.as_mut().unwrap(); + status.provisioning = Some(provisioning_deadline::new_record(0)); + status.configuration_activated = Some(false); + status.configuration_admission = + Some(openshell_core::proto::SandboxConfigurationAdmission { + instance_id: uuid::Uuid::new_v4().to_string(), + state: openshell_core::proto::ConfigurationAdmissionState::Rejected.into(), + error: "Provider requires an inspected endpoint".into(), + ..Default::default() + }); + runtime.store.put_message(&sandbox).await.unwrap(); + runtime + .store + .get_message::("sb-ttl") + .await + .unwrap() + .unwrap() + } + + #[tokio::test] + async fn provisioning_timeout_persists_error_before_cleanup_and_preserves_record() { + let driver = ControlledDriver::new(); + let runtime = test_runtime(driver.clone()).await; + let sandbox = seed_provisioning_attempt(&runtime).await; + let gate = runtime.lifecycle_gates.lock_for("sb-ttl").await; + let global = runtime.lock_global_for_lifecycle(&gate).await; + assert!( + runtime + .claim_provisioning_timeout(&sandbox, 299_999) + .await + .unwrap() + .is_none() + ); + let expired = runtime + .claim_provisioning_timeout(&sandbox, 300_000) + .await + .unwrap() + .unwrap(); + drop(global); + assert_eq!(expired.phase(), i32::from(SandboxPhase::Error)); + assert!( + ready_condition(&expired) + .unwrap() + .message + .contains("Provider requires an inspected endpoint") + ); + assert_eq!(driver.stop_calls(), 0); + runtime + .report_main_process_exit("sb-ttl", "late-instance", 0) + .await + .unwrap(); + runtime + .reclaim_provisioning_timeout(&expired, &gate) + .await + .unwrap(); + assert_eq!(driver.stop_calls(), 1); + let cleaned = runtime + .store + .get_message::("sb-ttl") + .await + .unwrap() + .unwrap(); + assert!( + cleaned + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap() + .cleanup_completed_time + .is_some() + ); + assert_eq!(cleaned.phase(), i32::from(SandboxPhase::Error)); + runtime.apply_deleted("sb-ttl").await.unwrap(); + assert!( + runtime + .store + .get_message::("sb-ttl") + .await + .unwrap() + .is_some() + ); + drop(gate); + let starting = runtime + .start_sandbox("default", "sandbox-ttl") + .await + .unwrap(); + assert_eq!(starting.phase(), i32::from(SandboxPhase::Starting)); + let retry = starting + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap(); + assert!(retry.deadline.is_some()); + assert!(retry.timeout_time.is_none()); + assert_ne!( + retry.attempt_id, + expired + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap() + .attempt_id + ); + assert_eq!( + starting.status.as_ref().unwrap().configuration_activated, + Some(false) + ); + let gate = runtime.lifecycle_gates.lock_for("sb-ttl").await; + runtime + .reclaim_provisioning_timeout(&expired, &gate) + .await + .unwrap(); + assert_eq!( + driver.stop_calls(), + 1, + "stale cleanup must not stop a new attempt" + ); + } + + #[tokio::test] + async fn provisioning_timeout_cleanup_failure_is_durable_and_blocks_start() { + let driver = ControlledDriver::new(); + driver.set_stop_outcome(ControlledLifecycleOutcome::Error("private driver payload")); + let runtime = test_runtime(driver.clone()).await; + let sandbox = seed_provisioning_attempt(&runtime).await; + let gate = runtime.lifecycle_gates.lock_for("sb-ttl").await; + let global = runtime.lock_global_for_lifecycle(&gate).await; + let expired = runtime + .claim_provisioning_timeout(&sandbox, 300_000) + .await + .unwrap() + .unwrap(); + drop(global); + runtime + .reclaim_provisioning_timeout(&expired, &gate) + .await + .unwrap(); + drop(gate); + let failed = runtime + .store + .get_message::("sb-ttl") + .await + .unwrap() + .unwrap(); + let record = failed + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap(); + assert!(record.cleanup_completed_time.is_none()); + assert!(record.cleanup_retry_time.is_some()); + assert!(!record.cleanup_error.contains("private driver payload")); + let error = runtime + .start_sandbox("default", "sandbox-ttl") + .await + .unwrap_err(); + assert_eq!(error.code(), Code::FailedPrecondition); + assert_eq!(driver.start_calls(), 0); + let gate = runtime.lifecycle_gates.lock_for("sb-ttl").await; + runtime + .reclaim_provisioning_timeout(&failed, &gate) + .await + .unwrap(); + assert_eq!( + driver.stop_calls(), + 1, + "durable backoff must suppress immediate retries" + ); + } + #[tokio::test] + async fn provisioning_worker_adopts_legacy_once_and_reclaims_without_inventory() { + let driver = ControlledDriver::new(); + let runtime = test_runtime(driver.clone()).await; + let sandbox = sandbox_record("sb-adopt", "adopt", SandboxPhase::Provisioning); + runtime.store.put_message(&sandbox).await.unwrap(); + let now = openshell_core::time::now_ms(); + runtime.reconcile_provisioning_deadlines(now).await.unwrap(); + let first = runtime + .store + .get_message::("sb-adopt") + .await + .unwrap() + .unwrap(); + let record = first + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap(); + assert_eq!( + openshell_core::time::timestamp_to_millis(record.deadline.as_ref().unwrap()).unwrap(), + now + 300_000 + ); + runtime + .reconcile_provisioning_deadlines(now + 100_000) + .await + .unwrap(); + let second = runtime + .store + .get_message::("sb-adopt") + .await + .unwrap() + .unwrap(); + assert_eq!( + second.status.as_ref().unwrap().provisioning, + first.status.as_ref().unwrap().provisioning + ); + runtime + .reconcile_provisioning_deadlines(now + 300_000) + .await + .unwrap(); + tokio::time::timeout(Duration::from_secs(2), async { + loop { + let current = runtime + .store + .get_message::("sb-adopt") + .await + .unwrap() + .unwrap(); + if current + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap() + .cleanup_completed_time + .is_some() + { + assert_eq!(current.phase(), i32::from(SandboxPhase::Error)); + break; + } + tokio::task::yield_now().await; + } + }) + .await + .unwrap(); + assert_eq!(driver.stop_calls(), 1); + } + + #[tokio::test] + async fn provisioning_worker_uses_policy_commit_time_not_scan_time() { + use crate::policy_store::PolicyStoreExt; + let driver = ControlledDriver::new(); + let runtime = test_runtime(driver).await; + let now = openshell_core::time::now_ms(); + let mut sandbox = sandbox_record("sb-reset", "reset", SandboxPhase::Provisioning); + sandbox.status.as_mut().unwrap().provisioning = + Some(provisioning_deadline::new_record(now - 100_000)); + provisioning_deadline::refresh_configuration(&runtime.store, &mut sandbox, now - 100_000) + .await + .unwrap(); + runtime.store.put_message(&sandbox).await.unwrap(); + let policy = openshell_policy::restrictive_default_policy(); + let hash = openshell_core::policy_identity::deterministic_policy_hash(&policy); + runtime + .store + .put_policy_revision( + "new-policy", + "sb-reset", + "default", + 2, + &policy.encode_to_vec(), + &hash, + ) + .await + .unwrap(); + let committed = runtime + .store + .get_latest_policy("sb-reset") + .await + .unwrap() + .unwrap() + .created_at_ms; + runtime + .reconcile_provisioning_deadlines(committed + 60_000) + .await + .unwrap(); + let updated = runtime + .store + .get_message::("sb-reset") + .await + .unwrap() + .unwrap(); + let record = updated + .status + .as_ref() + .unwrap() + .provisioning + .as_ref() + .unwrap(); + assert_eq!( + openshell_core::time::timestamp_to_millis(record.deadline.as_ref().unwrap()).unwrap(), + committed + 300_000 + ); + assert_eq!(updated.phase(), i32::from(SandboxPhase::Provisioning)); + } + #[tokio::test] + async fn provisioning_expiry_does_not_wait_for_busy_lifecycle_driver() { + let driver = ControlledDriver::new(); + let runtime = test_runtime(driver.clone()).await; + let now = openshell_core::time::now_ms(); + let mut sandbox = sandbox_record("sb-busy-ttl", "busy-ttl", SandboxPhase::Starting); + sandbox.status.as_mut().unwrap().provisioning = + Some(provisioning_deadline::new_record(now)); + runtime.store.put_message(&sandbox).await.unwrap(); + let gate = runtime.lifecycle_gates.lock_for("sb-busy-ttl").await; + runtime + .reconcile_provisioning_deadlines(now + 300_000) + .await + .unwrap(); + let expired = runtime + .store + .get_message::("sb-busy-ttl") + .await + .unwrap() + .unwrap(); + assert_eq!(expired.phase(), i32::from(SandboxPhase::Error)); + let interrupted = tokio::time::timeout( + Duration::from_secs(3), + runtime.await_provisioning_operation( + &sandbox, + std::future::pending::>(), + ), + ) + .await + .expect("expired startup releases its lifecycle gate") + .unwrap_err(); + assert_eq!(interrupted.code(), Code::DeadlineExceeded); + runtime + .mark_sandbox_error(&sandbox, "StartFailed", "late startup failure") + .await; + let retained = runtime + .store + .get_message::("sb-busy-ttl") + .await + .unwrap() + .unwrap(); + assert!(provisioning_deadline::timed_out(&retained)); + assert!( + retained + .status + .as_ref() + .unwrap() + .conditions + .iter() + .any(|condition| condition.reason == "ProvisioningTimedOut") + ); + assert_eq!( + driver.stop_calls(), + 0, + "cleanup waits for the in-flight lifecycle operation" + ); + assert_eq!( + runtime + .start_sandbox("default", "busy-ttl") + .await + .unwrap_err() + .code(), + Code::FailedPrecondition + ); + drop(gate); + runtime + .reconcile_provisioning_deadlines(now + 300_001) + .await + .unwrap(); + tokio::time::timeout(Duration::from_secs(1), driver.stop_finished.notified()) + .await + .unwrap(); + } + + #[tokio::test] + async fn provisioning_retry_recreates_missing_partial_compute() { + let driver = ControlledDriver::new(); + let runtime = test_runtime(driver.clone()).await; + let sandbox = seed_provisioning_attempt(&runtime).await; + let gate = runtime.lifecycle_gates.lock_for("sb-ttl").await; + let global = runtime.lock_global_for_lifecycle(&gate).await; + let expired = runtime + .claim_provisioning_timeout(&sandbox, 300_000) + .await + .unwrap() + .unwrap(); + drop(global); + runtime + .reclaim_provisioning_timeout(&expired, &gate) + .await + .unwrap(); + drop(gate); + driver.set_start_outcome(ControlledLifecycleOutcome::NotFound); + let starting = runtime + .start_sandbox("default", "sandbox-ttl") + .await + .unwrap(); + assert_eq!(starting.object_id(), "sb-ttl"); + assert_eq!(starting.phase(), i32::from(SandboxPhase::Starting)); + } } diff --git a/crates/openshell-server/src/compute/provisioning_deadline.rs b/crates/openshell-server/src/compute/provisioning_deadline.rs new file mode 100644 index 0000000000..1b0bf3b296 --- /dev/null +++ b/crates/openshell-server/src/compute/provisioning_deadline.rs @@ -0,0 +1,799 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +//! Gateway-owned provisioning repair-window transitions. +//! +//! Callers must persist each transition under the sandbox lifecycle fence. Times +//! are gateway-assigned Unix milliseconds, never supervisor-supplied values. +//! The timer remains armed after admission acceptance until compute becomes Ready. + +use openshell_core::proto::SandboxProvisioning; +use openshell_core::time::{timestamp_from_millis, timestamp_to_millis}; +use serde::{Deserialize, Serialize}; + +const REPAIR_WINDOW_MS: i64 = 300_000; + +/// Opaque identity of a committed effective configuration change. A -> B -> A +/// must use three different IDs even if the first and last content hashes match. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct ConfigurationChange { + pub id: String, + pub committed_at_ms: i64, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub(super) struct ProvisioningDeadline { + attempt_id: String, + change: ConfigurationChange, + first_rejection_at_ms: Option, + state: DeadlineState, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +enum DeadlineState { + Armed { deadline_at_ms: i64 }, + Expired { expired_at_ms: i64 }, + Ready, +} + +impl ProvisioningDeadline { + /// Decode persisted timing strictly. Invalid timing must not silently grant + /// another repair window on every gateway restart. + pub fn from_record(record: &SandboxProvisioning) -> Result { + fn millis(value: Option<&prost_types::Timestamp>, field: &str) -> Result { + let value = value.ok_or_else(|| format!("missing provisioning {field}"))?; + timestamp_to_millis(value).map_err(|_| format!("invalid provisioning {field}")) + } + if record.attempt_id.is_empty() || record.configuration_change_id.is_empty() { + return Err("missing provisioning identity".into()); + } + if record.deadline.is_some() && record.timeout_time.is_some() { + return Err("provisioning cannot be armed and expired".into()); + } + let state = if record.timeout_time.is_some() { + DeadlineState::Expired { + expired_at_ms: millis(record.timeout_time.as_ref(), "timeout time")?, + } + } else if record.deadline.is_some() { + DeadlineState::Armed { + deadline_at_ms: millis(record.deadline.as_ref(), "deadline")?, + } + } else { + DeadlineState::Ready + }; + Ok(Self { + attempt_id: record.attempt_id.clone(), + change: ConfigurationChange { + id: record.configuration_change_id.clone(), + committed_at_ms: millis(record.configuration_change_time.as_ref(), "change time")?, + }, + first_rejection_at_ms: record + .first_rejection_time + .as_ref() + .map(|value| millis(Some(value), "rejection time")) + .transpose()?, + state, + }) + } + + /// Replace timing only, preserving cleanup progress written by the worker. + pub fn write_record(&self, record: &mut SandboxProvisioning) { + record.attempt_id.clone_from(&self.attempt_id); + record.configuration_change_id.clone_from(&self.change.id); + record.configuration_change_time = timestamp_from_millis(self.change.committed_at_ms).ok(); + record.first_rejection_time = self + .first_rejection_at_ms + .and_then(|value| timestamp_from_millis(value).ok()); + record.deadline = self + .deadline_at_ms() + .and_then(|value| timestamp_from_millis(value).ok()); + record.timeout_time = match self.state { + DeadlineState::Expired { expired_at_ms } => timestamp_from_millis(expired_at_ms).ok(), + _ => None, + }; + } + + pub fn new(attempt_id: String, change: ConfigurationChange, now_ms: i64) -> Self { + Self { + attempt_id, + change, + first_rejection_at_ms: None, + state: DeadlineState::Armed { + deadline_at_ms: now_ms.saturating_add(REPAIR_WINDOW_MS), + }, + } + } + + pub fn deadline_at_ms(&self) -> Option { + match self.state { + DeadlineState::Armed { deadline_at_ms } => Some(deadline_at_ms), + DeadlineState::Expired { .. } | DeadlineState::Ready => None, + } + } + + /// Apply a newer, committed change to an active attempt. Delayed observation + /// uses commit time, not poll time. A change after expiry cannot revive it. + pub fn configuration_changed(&mut self, attempt_id: &str, change: ConfigurationChange) -> bool { + let Some(deadline_at_ms) = self.deadline_at_ms() else { + return false; + }; + if attempt_id != self.attempt_id + || change.id == self.change.id + || change.committed_at_ms < self.change.committed_at_ms + || change.committed_at_ms >= deadline_at_ms + { + return false; + } + self.state = DeadlineState::Armed { + deadline_at_ms: deadline_at_ms + .max(change.committed_at_ms.saturating_add(REPAIR_WINDOW_MS)), + }; + self.change = change; + self.first_rejection_at_ms = None; + true + } + + /// Only the first accepted rejection for the current change grants a repair + /// window. Retrying, reconnecting, or changing diagnostic text does not. + pub fn rejected(&mut self, attempt_id: &str, change_id: &str, now_ms: i64) -> bool { + let Some(deadline_at_ms) = self.deadline_at_ms() else { + return false; + }; + if !self.matches(attempt_id, change_id) + || self.first_rejection_at_ms.is_some() + || now_ms < self.change.committed_at_ms + || now_ms >= deadline_at_ms + { + return false; + } + self.first_rejection_at_ms = Some(now_ms); + self.state = DeadlineState::Armed { + deadline_at_ms: deadline_at_ms.max(now_ms.saturating_add(REPAIR_WINDOW_MS)), + }; + true + } + + /// Claim expiry after rechecking authoritative configuration under the same + /// lifecycle transaction. The caller must persist cleanup intent atomically. + pub fn expire(&mut self, attempt_id: &str, change_id: &str, now_ms: i64) -> bool { + if !self.matches(attempt_id, change_id) + || self + .deadline_at_ms() + .is_none_or(|deadline| now_ms < deadline) + { + return false; + } + self.state = DeadlineState::Expired { + expired_at_ms: now_ms, + }; + true + } + + /// Ready is the successful end of provisioning; admission acceptance alone + /// must not call this method. Late readiness requires an explicit retry. + pub fn ready(&mut self, attempt_id: &str, change_id: &str, now_ms: i64) -> bool { + if !self.matches(attempt_id, change_id) + || self + .deadline_at_ms() + .is_none_or(|deadline| now_ms >= deadline) + { + return false; + } + self.state = DeadlineState::Ready; + true + } + + fn matches(&self, attempt_id: &str, change_id: &str) -> bool { + self.attempt_id == attempt_id && self.change.id == change_id + } +} + +/// Whether compute reclamation belongs to a timed-out provisioning attempt. +pub fn timed_out(sandbox: &openshell_core::proto::Sandbox) -> bool { + sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| record.timeout_time.is_some()) +} + +/// Create an independent attempt. Supervisor reconnects must never call this. +pub fn new_record(now_ms: i64) -> SandboxProvisioning { + let mut record = SandboxProvisioning::default(); + ProvisioningDeadline::new( + uuid::Uuid::new_v4().to_string(), + ConfigurationChange { + id: format!("initial:{}", uuid::Uuid::new_v4()), + committed_at_ms: now_ms, + }, + now_ms, + ) + .write_record(&mut record); + record +} + +/// Apply the first accepted rejection under the same CAS as admission evidence. +/// The report's generation and supervisor instance must already be validated. +pub fn record_rejection(record: &mut SandboxProvisioning, now_ms: i64) -> Result<(), String> { + let mut deadline = ProvisioningDeadline::from_record(record)?; + deadline.rejected(&record.attempt_id, &record.configuration_change_id, now_ms); + deadline.write_record(record); + Ok(()) +} + +pub fn allows_admission(record: &SandboxProvisioning, now_ms: i64) -> bool { + ProvisioningDeadline::from_record(record).is_ok_and(|deadline| { + !matches!(deadline.state, DeadlineState::Expired { .. }) + && deadline.deadline_at_ms().is_none_or(|value| now_ms < value) + }) +} + +/// Readiness, not admission acceptance, ends the repair window. A late Ready +/// observation cannot win merely because the deadline scanner has not run yet. +pub(super) fn reconcile_readiness(sandbox: &mut openshell_core::proto::Sandbox, now_ms: i64) { + use openshell_core::proto::{SandboxCondition, SandboxPhase}; + let Some(status) = sandbox.status.as_mut() else { + return; + }; + if status.phase != i32::from(SandboxPhase::Ready) { + return; + } + let Some(record) = status.provisioning.as_mut() else { + return; + }; + let Ok(mut deadline) = ProvisioningDeadline::from_record(record) else { + return; + }; + if deadline.deadline_at_ms().is_none() { + return; + } + if deadline.ready(&record.attempt_id, &record.configuration_change_id, now_ms) { + deadline.write_record(record); + } else { + status.phase = SandboxPhase::Provisioning.into(); + status + .conditions + .retain(|condition| condition.r#type != "Ready"); + status.conditions.push(SandboxCondition { + r#type: "Ready".into(), + status: "False".into(), + reason: "ProvisioningDeadlineElapsed".into(), + message: "Provisioning deadline elapsed; awaiting compute reclamation".into(), + ..Default::default() + }); + } +} + +/// Attachment edits are stamped in the same sandbox CAS as the spec change. +pub fn attachments_changed(sandbox: &mut openshell_core::proto::Sandbox, now_ms: i64) { + if let Some(record) = sandbox + .status + .as_mut() + .and_then(|status| status.provisioning.as_mut()) + && record.deadline.is_some() + { + record.attachment_change_id = uuid::Uuid::new_v4().to_string(); + record.attachment_change_time = timestamp_from_millis(now_ms).ok(); + } +} + +/// Adopt legacy attempts once and reconcile committed source clocks before any +/// rejection/expiry decision. Persist the returned record with the owning CAS. +pub async fn refresh_configuration( + store: &crate::persistence::Store, + sandbox: &mut openshell_core::proto::Sandbox, + now_ms: i64, +) -> Result<(), String> { + use openshell_core::proto::SandboxPhase; + if !matches!( + SandboxPhase::try_from(sandbox.phase()), + Ok(SandboxPhase::Provisioning | SandboxPhase::Starting) + ) { + return Ok(()); + } + let status = sandbox.status.get_or_insert_with(Default::default); + let record = status + .provisioning + .get_or_insert_with(|| new_record(now_ms)); + if record.deadline.is_none() { + return Ok(()); + } + let change = crate::grpc::policy::configuration_change(store, sandbox).await?; + let record = sandbox + .status + .as_mut() + .and_then(|status| status.provisioning.as_mut()) + .expect("record initialized"); + let mut deadline = ProvisioningDeadline::from_record(record)?; + if record.configuration_change_id.starts_with("initial:") { + // Taking the first source snapshot does not grant a second initial window. + deadline.change.id = change.id; + } else { + deadline.configuration_changed(&record.attempt_id, change); + } + deadline.write_record(record); + Ok(()) +} + +impl super::ComputeRuntime { + pub(super) async fn provisioning_loop( + self: std::sync::Arc, + mut cancel: tokio::sync::watch::Receiver, + ) { + loop { + tokio::select! { + _ = cancel.changed() => return, + result = self.reconcile_provisioning_deadlines(openshell_core::time::now_ms()) => { + if let Err(error) = result { + tracing::warn!(%error, "Provisioning deadline reconciliation failed"); + } + } + } + tokio::select! { + _ = cancel.changed() => return, + () = tokio::time::sleep(std::time::Duration::from_secs(1)) => {} + } + } + } + + pub(super) async fn reconcile_provisioning_deadlines(&self, now_ms: i64) -> Result<(), String> { + use crate::persistence::{ObjectListQuery, ObjectType}; + use openshell_core::{ + ObjectId, + proto::{Sandbox, SandboxPhase}, + }; + use prost::Message; + let records = self + .store + .collect_records(Sandbox::object_type(), ObjectListQuery::AllWorkspaces) + .await + .map_err(|error| error.to_string())?; + for record in records { + let candidate = + Sandbox::decode(record.payload.as_slice()).map_err(|error| error.to_string())?; + if !matches!( + SandboxPhase::try_from(candidate.phase()), + Ok(SandboxPhase::Provisioning | SandboxPhase::Starting) + ) && !timed_out(&candidate) + { + continue; + } + // Expiration can fence Starting while its driver RPC owns the + // lifecycle gate. Cleanup waits for that gate; Error never waits + // for compute I/O, matching the existing driver-observation fence. + let global = self.sync_lock.clone().lock_owned().await; + let Some(mut current) = self + .store + .get_message::(&record.id) + .await + .map_err(|e| e.to_string())? + else { + continue; + }; + let previous = current.clone(); + refresh_configuration(&self.store, &mut current, now_ms).await?; + if current != previous { + current = self + .store + .update_message_cas::( + &record.id, + super::sandbox_resource_version(&previous), + |sandbox| sandbox.status.clone_from(¤t.status), + ) + .await + .map_err(|e| e.to_string())?; + self.sandbox_watch_bus.notify(&record.id); + } + if let Some(expired) = self.claim_provisioning_timeout(¤t, now_ms).await? { + current = expired; + } + drop(global); + if timed_out(¤t) + && current + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|record| { + record.cleanup_completed_time.is_none() + && record + .cleanup_retry_time + .as_ref() + .and_then(|t| timestamp_to_millis(t).ok()) + .is_none_or(|t| t <= now_ms) + }) + { + let Ok(guard) = self.lifecycle_gates.gate_for(&record.id).try_lock_owned() else { + continue; + }; + let gate = super::SandboxLifecycleGuard { _guard: guard }; + let runtime = self.clone(); + tokio::spawn(async move { + if let Err(error) = runtime.reclaim_provisioning_timeout(¤t, &gate).await + { + tracing::warn!(sandbox_id = current.object_id(), %error, "Provisioning cleanup will retry"); + } + }); + } + } + Ok(()) + } + + /// Claim expiration durably before touching the backend. The caller owns the + /// global configuration guard; CAS fences concurrent lifecycle operations. + /// The separate cleanup step also requires the per-sandbox lifecycle gate. + pub(crate) async fn claim_provisioning_timeout( + &self, + current: &openshell_core::proto::Sandbox, + now_ms: i64, + ) -> Result, String> { + use openshell_core::ObjectId; + use openshell_core::proto::{Sandbox, SandboxCondition, SandboxPhase}; + if !matches!( + SandboxPhase::try_from(current.phase()), + Ok(SandboxPhase::Provisioning | SandboxPhase::Starting) + ) { + return Ok(None); + } + let Some(record) = current + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + else { + return Ok(None); + }; + let mut deadline = ProvisioningDeadline::from_record(record)?; + if !deadline.expire(&record.attempt_id, &record.configuration_change_id, now_ms) { + return Ok(None); + } + let updated = self + .store + .update_message_cas::( + current.object_id(), + super::sandbox_resource_version(current), + |sandbox| { + let status = sandbox.status.as_mut().expect("provisioning status exists"); + deadline.write_record( + status + .provisioning + .as_mut() + .expect("provisioning record exists"), + ); + status.phase = SandboxPhase::Error.into(); + let diagnostic = status + .configuration_admission + .as_ref() + .map_or("", |admission| admission.error.as_str()); + let message = if diagnostic.is_empty() { + "Provisioning repair window expired after 300 seconds".to_string() + } else { + format!( + "Provisioning repair window expired after 300 seconds: {diagnostic}" + ) + }; + status + .conditions + .retain(|condition| condition.r#type != "Ready"); + status.conditions.push(SandboxCondition { + r#type: "Ready".into(), + status: "False".into(), + reason: "ProvisioningTimedOut".into(), + message, + transition_time: timestamp_from_millis(now_ms).ok(), + }); + }, + ) + .await + .map_err(|error| error.to_string())?; + self.sandbox_index.update_from_sandbox(&updated); + self.sandbox_watch_bus.notify(current.object_id()); + tracing::warn!( + sandbox_id = current.object_id(), + "Sandbox provisioning repair window expired" + ); + Ok(Some(updated)) + } + + /// The lifecycle gate remains owned across the bounded driver call, so an + /// explicit start cannot race an old cleanup worker. Retry intent survives + /// cancellation, gateway restart, and a lost leader lease. + pub(super) async fn reclaim_provisioning_timeout( + &self, + expired: &openshell_core::proto::Sandbox, + lifecycle_guard: &super::SandboxLifecycleGuard, + ) -> Result<(), String> { + use openshell_core::proto::Sandbox; + use openshell_core::proto::compute::v1::StopSandboxRequest; + use openshell_core::{ObjectId, ObjectName}; + let current = { + let _global_guard = self.lock_global_for_lifecycle(lifecycle_guard).await; + self.store + .get_message::(expired.object_id()) + .await + .map_err(|error| error.to_string())? + }; + let Some(current) = current else { + return Ok(()); + }; + let expected_attempt = expired + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .map(|record| record.attempt_id.as_str()); + if current.phase() != i32::from(openshell_core::proto::SandboxPhase::Error) + || current + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .map(|record| record.attempt_id.as_str()) + != expected_attempt + { + return Ok(()); + } + let expired = ¤t; + let Some(record) = expired + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + else { + return Ok(()); + }; + if record.timeout_time.is_none() || record.cleanup_completed_time.is_some() { + return Ok(()); + } + let now_ms = openshell_core::time::now_ms(); + if record + .cleanup_retry_time + .as_ref() + .map(timestamp_to_millis) + .transpose() + .map_err(|error| error.to_string())? + .is_some_and(|retry| retry > now_ms) + { + return Ok(()); + } + // Cross-replica cleanup claim. A replacement leader waits longer than + // the bounded driver call before retrying an interrupted reclamation. + { + let _global_guard = self.lock_global_for_lifecycle(lifecycle_guard).await; + self.store + .update_message_cas::( + expired.object_id(), + super::sandbox_resource_version(expired), + |sandbox| { + sandbox + .status + .as_mut() + .and_then(|status| status.provisioning.as_mut()) + .expect("timeout record exists") + .cleanup_retry_time = + timestamp_from_millis(now_ms.saturating_add(35_000)).ok(); + }, + ) + .await + .map_err(|error| error.to_string())?; + } + let sandbox_id = expired.object_id().to_string(); + let sandbox_name = expired.object_name().to_string(); + let result = tokio::time::timeout( + std::time::Duration::from_secs(30), + self.driver.call( + openshell_otel::rpc::STOP_SANDBOX, + Some(&sandbox_id), + |driver| { + let sandbox_id = sandbox_id.clone(); + async move { + driver + .stop_sandbox(tonic::Request::new(StopSandboxRequest { + sandbox_id, + sandbox_name, + })) + .await + } + }, + ), + ) + .await; + let reclaimed = matches!(&result, Ok(Ok(_))) + || matches!(&result, Ok(Err(error)) if error.code() == tonic::Code::NotFound); + let _global_guard = self.lock_global_for_lifecycle(lifecycle_guard).await; + let Some(current) = self + .store + .get_message::(&sandbox_id) + .await + .map_err(|error| error.to_string())? + else { + return Ok(()); + }; + if !current + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + .is_some_and(|latest| { + latest.attempt_id == record.attempt_id && latest.timeout_time.is_some() + }) + { + return Ok(()); + } + let completed_at_ms = openshell_core::time::now_ms(); + let updated = self + .store + .update_message_cas::( + &sandbox_id, + super::sandbox_resource_version(¤t), + |sandbox| { + let record = sandbox + .status + .as_mut() + .and_then(|status| status.provisioning.as_mut()) + .expect("timeout attempt was checked under the lifecycle gate"); + if reclaimed { + record.cleanup_completed_time = timestamp_from_millis(completed_at_ms).ok(); + record.cleanup_error.clear(); + record.cleanup_retry_time = None; + } else { + record.cleanup_error = + "Compute reclamation is pending; the gateway will retry".into(); + record.cleanup_retry_time = + timestamp_from_millis(completed_at_ms.saturating_add(5_000)).ok(); + } + }, + ) + .await + .map_err(|error| error.to_string())?; + if reclaimed { + self.cleanup_stopped_sandbox_sessions(&updated).await?; + tracing::info!(sandbox_id, "Reclaimed timed-out provisioning compute"); + } + self.sandbox_index.update_from_sandbox(&updated); + self.sandbox_watch_bus.notify(&sandbox_id); + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn protobuf_roundtrip_retains_deadline_and_cleanup_progress() { + use prost::Message; + let mut deadline = ProvisioningDeadline::new("attempt".into(), change("change", 0), 0); + assert!(deadline.rejected("attempt", "change", 1_000)); + let mut record = SandboxProvisioning::default(); + deadline.write_record(&mut record); + let bytes = record.encode_to_vec(); + let mut restored = SandboxProvisioning::decode(bytes.as_slice()).unwrap(); + assert_eq!( + ProvisioningDeadline::from_record(&restored).unwrap(), + deadline + ); + assert!(deadline.expire("attempt", "change", 301_000)); + deadline.write_record(&mut restored); + restored.cleanup_error = "retry pending".into(); + restored.cleanup_retry_time = timestamp_from_millis(306_000).ok(); + let restored_deadline = ProvisioningDeadline::from_record(&restored).unwrap(); + restored_deadline.write_record(&mut restored); + assert_eq!(restored.cleanup_error, "retry pending"); + assert!(restored.cleanup_retry_time.is_some()); + assert!(restored.deadline.is_none()); + assert_eq!(restored_deadline, deadline); + } + + #[test] + fn malformed_persisted_timing_cannot_grant_another_window() { + assert!(ProvisioningDeadline::from_record(&SandboxProvisioning::default()).is_err()); + let mut record = new_record(0); + record.timeout_time = timestamp_from_millis(300_000).ok(); + assert!(ProvisioningDeadline::from_record(&record).is_err()); + record.timeout_time = None; + record.configuration_change_time = None; + assert!(ProvisioningDeadline::from_record(&record).is_err()); + } + + fn change(id: &str, committed_at_ms: i64) -> ConfigurationChange { + ConfigurationChange { + id: id.into(), + committed_at_ms, + } + } + + fn initial() -> ProvisioningDeadline { + ProvisioningDeadline::new("attempt-1".into(), change("change-1", 0), 0) + } + + #[test] + fn expires_at_exactly_300_seconds_without_a_report() { + let mut timer = initial(); + assert!(!timer.expire("attempt-1", "change-1", 299_999)); + assert!(timer.expire("attempt-1", "change-1", 300_000)); + assert!(!timer.expire("attempt-1", "change-1", 300_001)); + } + + #[test] + fn repeated_failures_do_not_extend_the_repair_window() { + let mut timer = initial(); + assert!(timer.rejected("attempt-1", "change-1", 5_000)); + for now in (7_000..305_000).step_by(2_000) { + assert!(!timer.rejected("attempt-1", "change-1", now)); + } + assert_eq!(timer.deadline_at_ms(), Some(305_000)); + assert!(timer.expire("attempt-1", "change-1", 305_000)); + } + + #[test] + fn change_and_first_failed_load_each_reset_once() { + let mut timer = initial(); + assert!(timer.configuration_changed("attempt-1", change("change-2", 100_000))); + assert_eq!(timer.deadline_at_ms(), Some(400_000)); + assert!(timer.rejected("attempt-1", "change-2", 105_000)); + assert_eq!(timer.deadline_at_ms(), Some(405_000)); + assert!(!timer.configuration_changed("attempt-1", change("change-2", 110_000))); + assert!(!timer.rejected("attempt-1", "change-2", 110_000)); + assert_eq!(timer.deadline_at_ms(), Some(405_000)); + } + + #[test] + fn delayed_observation_uses_commit_time() { + let mut timer = initial(); + // Caller can observe this later, but it committed before the deadline. + assert!(timer.configuration_changed("attempt-1", change("change-2", 100_000))); + assert_eq!(timer.deadline_at_ms(), Some(400_000)); + assert!(!timer.configuration_changed("attempt-1", change("older", 50_000))); + } + + #[test] + fn stale_attempts_and_changes_cannot_extend_or_expire() { + let mut timer = initial(); + assert!(!timer.rejected("old-attempt", "change-1", 1_000)); + assert!(!timer.rejected("attempt-1", "old-change", 1_000)); + assert!(!timer.configuration_changed("old-attempt", change("change-2", 1_000))); + assert!(!timer.expire("old-attempt", "change-1", 400_000)); + assert!(!timer.expire("attempt-1", "old-change", 400_000)); + assert_eq!(timer.deadline_at_ms(), Some(300_000)); + } + + #[test] + fn late_change_failure_or_ready_cannot_escape_expiry() { + let mut timer = initial(); + assert!(!timer.configuration_changed("attempt-1", change("change-2", 300_000))); + assert!(!timer.rejected("attempt-1", "change-1", 300_000)); + assert!(!timer.ready("attempt-1", "change-1", 300_000)); + assert!(timer.expire("attempt-1", "change-1", 300_000)); + assert!(!timer.ready("attempt-1", "change-1", 300_001)); + assert!(!timer.configuration_changed("attempt-1", change("change-2", 100_000))); + } + + #[test] + fn ready_disarms_and_cannot_rearm_for_a_failed_live_update() { + let mut timer = initial(); + assert!(timer.ready("attempt-1", "change-1", 50_000)); + assert!(!timer.rejected("attempt-1", "change-1", 60_000)); + assert!(!timer.configuration_changed("attempt-1", change("change-2", 60_000))); + assert!(!timer.expire("attempt-1", "change-1", 400_000)); + } + + #[test] + fn restart_roundtrip_preserves_first_failure_and_deadline() { + let mut timer = initial(); + assert!(timer.rejected("attempt-1", "change-1", 5_000)); + let encoded = serde_json::to_vec(&timer).unwrap(); + let mut restored: ProvisioningDeadline = serde_json::from_slice(&encoded).unwrap(); + assert_eq!(restored, timer); + assert!(!restored.rejected("attempt-1", "change-1", 100_000)); + assert_eq!(restored.deadline_at_ms(), Some(305_000)); + } + + #[test] + fn explicit_retry_is_a_new_attempt_and_old_cleanup_cannot_expire_it() { + let mut timer = + ProvisioningDeadline::new("attempt-2".into(), change("change-2", 350_000), 400_000); + assert_eq!(timer.deadline_at_ms(), Some(700_000)); + assert!(!timer.expire("attempt-1", "change-2", 800_000)); + } + + #[test] + fn legacy_initialization_grants_one_window_from_adoption() { + let timer = ProvisioningDeadline::new("adopted".into(), change("legacy", 0), 1_000_000); + assert_eq!(timer.deadline_at_ms(), Some(1_300_000)); + } +} diff --git a/crates/openshell-server/src/grpc/mod.rs b/crates/openshell-server/src/grpc/mod.rs index ac87ebcddf..9994208c3e 100644 --- a/crates/openshell-server/src/grpc/mod.rs +++ b/crates/openshell-server/src/grpc/mod.rs @@ -173,12 +173,22 @@ const MAX_LABEL_SELECTOR_PAIRS: usize = 64; struct StoredSettings { revision: u64, settings: BTreeMap, + /// Per-key commit clocks, including deletion tombstones. Persisted in the + /// same CAS payload as values so polling and restart cannot refresh them. + #[serde(default)] + change_clocks: BTreeMap, /// Database `resource_version` for CAS. Not persisted in the JSON payload; /// loaded from `ObjectRecord` and used for optimistic concurrency control. #[serde(skip)] resource_version: u64, } +#[derive(Debug, Clone, Serialize, Deserialize)] +struct SettingChangeClock { + id: String, + committed_at_ms: i64, +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(tag = "type", content = "value")] enum StoredSettingValue { @@ -633,6 +643,13 @@ impl OpenShell for OpenShellService { policy::handle_report_endpoint_status(&self.state, request).await } + async fn report_sandbox_configuration( + &self, + request: Request, + ) -> Result, Status> { + policy::handle_report_sandbox_configuration(&self.state, request).await + } + // --- Sandbox logs --- async fn get_sandbox_logs( diff --git a/crates/openshell-server/src/grpc/policy.rs b/crates/openshell-server/src/grpc/policy.rs index 8434377c1d..a3a9b5cc3b 100644 --- a/crates/openshell-server/src/grpc/policy.rs +++ b/crates/openshell-server/src/grpc/policy.rs @@ -11,6 +11,8 @@ #![allow(clippy::items_after_statements)] // DB_PORTS const inside function mod endpoint_status; +mod provisioning_clock; +pub use provisioning_clock::configuration_change; pub(super) use endpoint_status::handle_report_endpoint_status; pub use endpoint_status::{ @@ -1755,20 +1757,32 @@ async fn current_effective_policy_for_sandbox( .as_ref() .map(|spec| spec.providers.clone()) .unwrap_or_default(); + let records = super::provider::load_provider_environment_records( + state.store.as_ref(), + workspace, + &provider_names, + ) + .await?; + current_effective_policy_from_records(state, catalog, sandbox, sandbox_id, &records).await +} + +async fn current_effective_policy_from_records( + state: &ServerState, + catalog: &EffectiveProviderProfileCatalog, + sandbox: &Sandbox, + sandbox_id: &str, + records: &[super::provider::ProviderEnvironmentRecord], +) -> Result { let global_settings = load_global_settings(state.store.as_ref()).await?; if let Some(global_policy) = decode_policy_from_global_settings(&global_settings)? { // A global policy is the complete effective policy. Dormant sandbox // history and specs may predate the current schema, but they must not // prevent the valid global policy from being served. - return apply_effective_policy_context( - state, - catalog, - workspace, - &provider_names, + return apply_captured_policy_context( + provider_policy_context_from_records(catalog, records), global_policy, PolicySource::Global, - ) - .await; + ); } let policy = if let Some(record) = state @@ -1787,15 +1801,11 @@ async fn current_effective_policy_for_sandbox( } }; - apply_effective_policy_context( - state, - catalog, - workspace, - &provider_names, + apply_captured_policy_context( + provider_policy_context_from_records(catalog, records), policy, PolicySource::Sandbox, ) - .await } async fn effective_policy_for_source( @@ -1830,17 +1840,25 @@ async fn apply_effective_policy_context( catalog: &EffectiveProviderProfileCatalog, workspace: &str, provider_names: &[String], - mut policy: ProtoSandboxPolicy, + policy: ProtoSandboxPolicy, policy_source: PolicySource, ) -> Result { - clear_provider_credentialed_markers(&mut policy); - let mut provider_context = provider_policy_context_with_catalog( + let provider_context = provider_policy_context_with_catalog( state.store.as_ref(), catalog, workspace, provider_names, ) .await?; + apply_captured_policy_context(provider_context, policy, policy_source) +} + +fn apply_captured_policy_context( + mut provider_context: ProviderPolicyContext, + mut policy: ProtoSandboxPolicy, + policy_source: PolicySource, +) -> Result { + clear_provider_credentialed_markers(&mut policy); if !matches!(policy_source, PolicySource::Global) && !provider_context.layers.is_empty() { policy = compose_effective_policy(&policy, &provider_context.layers); } @@ -2455,9 +2473,11 @@ async fn persist_existing_policy_projection( let updated = state .store .update_message_cas::(sandbox_id, expected_resource_version, |sandbox| { + let startup_blocked = + crate::policy_store::permits_initial_static_policy_repair(sandbox); if let Some(policy) = backfill_policy.as_ref() && let Some(spec) = sandbox.spec.as_mut() - && spec.policy.is_none() + && (spec.policy.is_none() || startup_blocked) { spec.policy = Some(policy.clone()); } @@ -2514,6 +2534,42 @@ async fn resolve_sandbox_by_name_for_principal( pub(super) async fn handle_get_sandbox_config( state: &Arc, request: Request, +) -> Result, Status> { + let principal = super::extract_principal(&request)?; + let sandbox_id = request.get_ref().sandbox_id.clone(); + let result = handle_get_sandbox_config_inner(state, request).await; + match result { + Err(error) + if matches!(principal, Principal::Sandbox(_)) + && matches!( + error.code(), + tonic::Code::FailedPrecondition | tonic::Code::InvalidArgument + ) => + { + // A malformed stored candidate must not prevent a supervisor + // from registering its startup fence and waiting for repair. + // Do not expose parser payloads or copy malformed policy history. + let sandbox = + super::sandbox::fetch_and_authorize_sandbox(state, &principal, &sandbox_id).await?; + Ok(Response::new(GetSandboxConfigResponse { + configuration_admitted: false, + configuration_error: configuration_failure_diagnostic(&error).to_string(), + configuration_instance_id: sandbox + .status + .as_ref() + .and_then(|status| status.configuration_admission.as_ref()) + .map_or_else(String::new, |admission| admission.instance_id.clone()), + workspace: sandbox.object_workspace().to_string(), + ..Default::default() + })) + } + result => result, + } +} + +async fn handle_get_sandbox_config_inner( + state: &Arc, + request: Request, ) -> Result, Status> { let principal = super::extract_principal(&request)?; let sandbox_id = request.get_ref().sandbox_id.clone(); @@ -2641,13 +2697,14 @@ pub(super) async fn load_sandbox_config( let global_settings = load_global_settings(state.store.as_ref()).await?; let sandbox_settings = load_sandbox_settings(state.store.as_ref(), &workspace, sandbox.object_name()).await?; - let mut provider_policy_context = provider_policy_context_with_catalog( + let provider_records = super::provider::load_provider_environment_records( state.store.as_ref(), - &provider_profile_catalog, &workspace, &sandbox_provider_names, ) .await?; + let mut provider_policy_context = + provider_policy_context_from_records(&provider_profile_catalog, &provider_records); if matches!(policy_source, PolicySource::Global) && let Ok(Some(global_rev)) = state @@ -2693,12 +2750,15 @@ pub(super) async fn load_sandbox_config( &policy_credential_bindings, &provider_policy_context.endpointless_provider_names, ); + let mut configuration_error = String::new(); if let Some(effective_policy) = policy.as_mut() { stamp_provider_credentialed_endpoints( effective_policy, &provider_policy_context.credentialed_scopes, ); - report_uninspected_credentialed_endpoints(effective_policy, &sandbox_id); + if let Err(error) = validate_uninspected_credentialed_endpoints(effective_policy) { + configuration_error = bounded_configuration_diagnostic(error.message()); + } policy_hash = deterministic_policy_hash(effective_policy); } @@ -2725,25 +2785,27 @@ pub(super) async fn load_sandbox_config( state.sandbox_jwt_issuer.is_some(), ); if let Some(policy) = policy.as_ref() { - validate_policy_credential_bindings_for_sandbox( - state.as_ref(), + validate_policy_credential_binding_context( &provider_profile_catalog, - &workspace, - &sandbox_provider_names, + &provider_records, policy, - ) - .await?; + &policy_credential_bindings, + )?; } - let provider_env_revision = compute_provider_env_revision_with_catalog_and_policy_bindings( - state.store.as_ref(), + let provider_env_revision = compute_provider_env_revision_from_records_and_policy_bindings( &provider_profile_catalog, - &workspace, - &sandbox_provider_names, + &provider_records, &policy_credential_bindings, - ) - .await?; + )?; Ok(GetSandboxConfigResponse { + configuration_instance_id: sandbox + .status + .as_ref() + .and_then(|status| status.configuration_admission.as_ref()) + .map_or_else(String::new, |admission| admission.instance_id.clone()), + configuration_admitted: policy.is_some() && configuration_error.is_empty(), + configuration_error, policy, version, policy_hash, @@ -3029,16 +3091,23 @@ async fn provider_policy_context_with_catalog( workspace: &str, provider_names: &[String], ) -> Result { + let records = + super::provider::load_provider_environment_records(store, workspace, provider_names) + .await?; + Ok(provider_policy_context_from_records(catalog, &records)) +} + +fn provider_policy_context_from_records( + catalog: &EffectiveProviderProfileCatalog, + records: &[super::provider::ProviderEnvironmentRecord], +) -> ProviderPolicyContext { let mut layers = Vec::new(); let mut credentialed_scopes = Vec::new(); let mut endpointless_provider_names = HashSet::new(); - for name in provider_names { - let provider = store - .get_message_by_name::(workspace, name) - .await - .map_err(|e| Status::internal(format!("failed to fetch provider '{name}': {e}")))? - .ok_or_else(|| Status::failed_precondition(format!("provider '{name}' not found")))?; + for record in records { + let name = &record.name; + let provider = &record.provider; let provider_type = provider.r#type.trim(); let Some(profile) = super::provider::get_provider_type_profile_for_scope( @@ -3054,7 +3123,7 @@ async fn provider_policy_context_with_catalog( continue; }; - if !super::provider::provider_profile_endpoints_are_active(&profile, &provider) { + if !super::provider::provider_profile_endpoints_are_active(&profile, provider) { endpointless_provider_names.insert(name.clone()); continue; } @@ -3083,11 +3152,11 @@ async fn provider_policy_context_with_catalog( }); } - Ok(ProviderPolicyContext { + ProviderPolicyContext { layers, credentialed_scopes, endpointless_provider_names, - }) + } } fn endpoint_ports(endpoint: &NetworkEndpoint) -> Vec { @@ -3240,22 +3309,6 @@ fn validate_uninspected_credentialed_endpoints(policy: &ProtoSandboxPolicy) -> R ))) } -/// Delivery-path reporting for an already-persisted policy. Sandbox config -/// delivery must not fail closed here: refusing the config would crash-loop a -/// running supervisor. The runtime backstop denies the traffic instead. -fn report_uninspected_credentialed_endpoints(policy: &ProtoSandboxPolicy, sandbox_id: &str) { - if let Some(violation) = find_uninspected_credentialed_endpoint(policy) { - warn!( - sandbox_id, - rule_name = %violation.rule_name, - host = %violation.host, - port = violation.port, - mode = violation.mode, - "delivering credentialed endpoint without L7 inspection; the sandbox proxy will deny this traffic unless allow_uninspected_credentials is set" - ); - } -} - pub(super) async fn handle_get_gateway_config( state: &Arc, _request: Request, @@ -3315,12 +3368,12 @@ pub(super) async fn load_sandbox_provider_environment( &provider_names, ) .await?; - let effective_policy = current_effective_policy_for_sandbox( + let effective_policy = current_effective_policy_from_records( state.as_ref(), &provider_profile_catalog, - &workspace, sandbox, &sandbox_id, + &provider_records, ) .await?; let policy_credential_bindings = @@ -3523,6 +3576,7 @@ async fn handle_update_config_inner( )); } let _settings_guard = state.settings_mutex.lock().await; + let _sandbox_sync_guard = state.compute.sandbox_sync_guard().await; if has_merge_ops { return Err(Status::invalid_argument( @@ -3558,7 +3612,6 @@ async fn handle_update_config_inner( // Global policy determines the report's effective configuration. // Serialize its writes after validation so a report cannot commit // evidence derived from the policy this update has replaced. - let _sandbox_sync_guard = state.compute.sandbox_sync_guard().await; let latest = state .store .get_latest_policy(GLOBAL_POLICY_SANDBOX_ID) @@ -3658,11 +3711,6 @@ async fn handle_update_config_inner( // Deleting global policy changes the report's effective configuration. // Keep settings -> sandbox lock order for all global policy mutations. - let _sandbox_sync_guard = if key == POLICY_SETTING_KEY && req.delete_setting { - Some(state.compute.sandbox_sync_guard().await) - } else { - None - }; let mut global_settings = load_global_settings(state.store.as_ref()).await?; let provider_composition_was_enabled = provider_policy_composition_enabled_in(&global_settings)?; @@ -3729,6 +3777,7 @@ async fn handle_update_config_inner( if has_setting { let _settings_guard = state.settings_mutex.lock().await; + let _sandbox_sync_guard = state.compute.sandbox_sync_guard().await; if key == POLICY_SETTING_KEY { return Err(Status::invalid_argument( @@ -3823,6 +3872,7 @@ async fn handle_update_config_inner( )); } + let _sandbox_sync_guard = state.compute.sandbox_sync_guard().await; if has_merge_ops { let global_settings = load_global_settings(state.store.as_ref()).await?; if global_settings.settings.contains_key(POLICY_SETTING_KEY) { @@ -3946,7 +3996,12 @@ async fn handle_update_config_inner( validate_no_reserved_provider_policy_keys(&new_policy)?; } - let should_backfill_policy = if let Some(baseline_policy) = spec.policy.as_ref() { + let startup_blocked = crate::policy_store::permits_initial_static_policy_repair(&sandbox); + let should_backfill_policy = if startup_blocked && !sandbox_caller { + // No child has consumed static restrictions yet. A complete replacement + // must be able to repair every field before the first activation. + true + } else if let Some(baseline_policy) = spec.policy.as_ref() { let comparable_baseline = baseline_policy.clone(); validate_static_fields_unchanged(&comparable_baseline, &new_policy)?; false @@ -3978,9 +4033,9 @@ async fn handle_update_config_inner( &effective_policy, ) .await?; - // Sandbox-authored syncs replay a policy the supervisor already discovered - // on disk. Rejecting it here would crash-loop the sandbox instead of - // surfacing an operator decision, so only operator-authored updates gate. + // Image discovery persists the desired candidate for management repair. + // It never admits workload activation: GetSandboxConfig applies the complete + // composition gate and ReportSandboxConfiguration checks the exact result. if !sandbox_caller { validate_candidate_sandbox_credential_policy( state, @@ -3991,12 +4046,6 @@ async fn handle_update_config_inner( .await?; } - let _sandbox_sync_guard = if backfill_policy.is_some() { - Some(state.compute.sandbox_sync_guard().await) - } else { - None - }; - let payload = new_policy.encode_to_vec(); let hash = deterministic_policy_hash(&new_policy); let (_next_version, committed_annotations) = { @@ -4310,6 +4359,200 @@ pub(super) async fn handle_list_sandbox_policies( })) } +fn bounded_configuration_diagnostic(message: &str) -> String { + message + .chars() + .filter(|character| !character.is_control()) + .take(512) + .collect() +} + +fn configuration_failure_diagnostic(error: &Status) -> &'static str { + let message = error.message(); + if message.contains("middleware") { + "Effective middleware configuration is invalid; repair the policy middleware bindings or registered services" + } else if message.contains("credential") || message.contains("provider") { + "Effective provider configuration is invalid; repair credential bindings, attached providers, or their policy layers" + } else { + "Stored policy structure or safety validation failed; submit a complete valid replacement policy" + } +} + +fn configuration_generation_matches( + admission: &openshell_core::proto::SandboxConfigurationAdmission, + config: &GetSandboxConfigResponse, +) -> bool { + ( + admission.policy_version, + &admission.policy_hash, + admission.config_revision, + admission.provider_env_revision, + ) == ( + config.version, + &config.policy_hash, + config.config_revision, + config.provider_env_revision, + ) +} + +pub(super) async fn handle_report_sandbox_configuration( + state: &Arc, + request: Request, +) -> Result, Status> { + use openshell_core::proto::ConfigurationAdmissionState; + let principal = super::extract_principal(&request)?; + let sandbox_id = request.get_ref().sandbox_id.clone(); + crate::auth::guard::enforce_sandbox_scope(&request, &sandbox_id)?; + let mut admission = request + .get_ref() + .admission + .clone() + .ok_or_else(|| Status::invalid_argument("admission is required"))?; + if uuid::Uuid::parse_str(&admission.instance_id).is_err() { + return Err(Status::invalid_argument("instance_id must be a UUID")); + } + let reported = ConfigurationAdmissionState::try_from(admission.state) + .map_err(|_| Status::invalid_argument("invalid admission state"))?; + if reported == ConfigurationAdmissionState::Unspecified { + return Err(Status::invalid_argument("admission state is required")); + } + let _guard = state.compute.sandbox_sync_guard().await; + let mut sandbox = + super::sandbox::fetch_and_authorize_sandbox(state, &principal, &sandbox_id).await?; + crate::compute::provisioning_deadline::refresh_configuration( + &state.store, + &mut sandbox, + current_time_ms(), + ) + .await + .map_err(Status::internal)?; + if crate::compute::provisioning_deadline::timed_out(&sandbox) { + return Err(Status::failed_precondition( + "provisioning repair window expired; explicitly start the sandbox after cleanup", + )); + } + let current = sandbox + .status + .as_ref() + .and_then(|status| status.configuration_admission.as_ref()); + if reported == ConfigurationAdmissionState::Pending + && current.is_some_and(|current| current.instance_id != admission.instance_id) + && current.map_or("", |current| current.instance_id.as_str()) + != request.get_ref().expected_instance_id + { + return Err(Status::failed_precondition( + "supervisor registration fence has changed", + )); + } + if reported != ConfigurationAdmissionState::Pending + && current.is_none_or(|current| current.instance_id != admission.instance_id) + { + return Err(Status::failed_precondition( + "supervisor configuration instance has changed", + )); + } + if reported == ConfigurationAdmissionState::Accepted { + let mut config_request = Request::new(GetSandboxConfigRequest { + sandbox_id: sandbox_id.clone(), + }); + *config_request.extensions_mut() = request.extensions().clone(); + let config = handle_get_sandbox_config(state, config_request) + .await? + .into_inner(); + if !config.configuration_admitted || !configuration_generation_matches(&admission, &config) + { + return Err(Status::aborted( + "configuration changed or is not admitted; fetch and validate again", + )); + } + admission.error.clear(); + } else if reported == ConfigurationAdmissionState::Rejected { + // Runtime error strings may contain parser payloads. Only gateway-authored + // diagnostics may be exposed verbatim through public sandbox status. + let mut config_request = Request::new(GetSandboxConfigRequest { + sandbox_id: sandbox_id.clone(), + }); + *config_request.extensions_mut() = request.extensions().clone(); + admission.error = match handle_get_sandbox_config(state, config_request).await { + Ok(config) if !configuration_generation_matches(&admission, config.get_ref()) => { + return Err(Status::aborted("rejected configuration generation has changed")); + } + Ok(config) if !config.get_ref().configuration_error.is_empty() => config.into_inner().configuration_error, + _ => "Effective configuration could not be activated; replace the policy or repair attached providers".to_string(), + }; + if let Some(current) = current + && current.state == i32::from(ConfigurationAdmissionState::Accepted) + { + // A rejected desired update does not invalidate an accepted runtime. + let error = admission.error; + admission = current.clone(); + admission.error = error; + } + } else { + admission.error.clear(); + if let Some(current) = current + && current.instance_id == admission.instance_id + { + admission = current.clone(); + } + } + let expected_version = sandbox + .metadata + .as_ref() + .map_or(0, |metadata| metadata.resource_version); + let now_ms = current_time_ms(); + let mut provisioning = sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.clone()); + if let Some(record) = provisioning.as_mut() { + if !crate::compute::provisioning_deadline::allows_admission(record, now_ms) { + state + .compute + .claim_provisioning_timeout(&sandbox, now_ms) + .await + .map_err(Status::internal)?; + return Err(Status::failed_precondition( + "provisioning repair window expired", + )); + } + if reported == ConfigurationAdmissionState::Rejected { + crate::compute::provisioning_deadline::record_rejection(record, now_ms) + .map_err(Status::internal)?; + } + } + let updated = state + .store + .update_message_cas::(&sandbox_id, expected_version, |sandbox| { + sandbox + .status + .get_or_insert_with(Default::default) + .provisioning + .clone_from(&provisioning); + sandbox + .status + .get_or_insert_with(Default::default) + .configuration_admission = Some(admission.clone()); + if reported == ConfigurationAdmissionState::Accepted { + sandbox + .status + .as_mut() + .expect("status initialized") + .configuration_activated = Some(true); + } + crate::compute::apply_configuration_readiness(sandbox); + }) + .await + .map_err(|error| { + super::persistence_error_to_status(error, "report configuration admission") + })?; + state.sandbox_index.update_from_sandbox(&updated); + state.sandbox_watch_bus.notify(&sandbox_id); + Ok(Response::new( + openshell_core::proto::ReportSandboxConfigurationResponse {}, + )) +} + pub(super) async fn handle_report_policy_status( state: &Arc, request: Request, @@ -7153,6 +7396,15 @@ async fn load_settings_record( let mut settings = serde_json::from_slice::(&record.payload) .map_err(|e| Status::internal(format!("decode settings payload failed: {e}")))?; settings.resource_version = record.resource_version; + for key in settings.settings.keys() { + settings + .change_clocks + .entry(key.clone()) + .or_insert_with(|| super::SettingChangeClock { + id: format!("{}:{}:{key}", record.id, record.resource_version), + committed_at_ms: record.updated_at_ms, + }); + } Ok(settings) } else { Ok(StoredSettings::default()) @@ -7168,7 +7420,22 @@ async fn save_settings_record( ) -> Result<(), Status> { use crate::persistence::WriteCondition; - let payload = serde_json::to_vec(settings) + let previous = load_settings_record(store, object_type, workspace, name).await?; + let mut persisted = settings.clone(); + persisted.change_clocks = previous.change_clocks.clone(); + let now_ms = current_time_ms(); + for key in previous.settings.keys().chain(settings.settings.keys()) { + if previous.settings.get(key) != settings.settings.get(key) { + persisted.change_clocks.insert( + key.clone(), + super::SettingChangeClock { + id: uuid::Uuid::new_v4().to_string(), + committed_at_ms: now_ms, + }, + ); + } + } + let payload = serde_json::to_vec(&persisted) .map_err(|e| Status::internal(format!("encode settings payload failed: {e}")))?; let (id, condition) = if settings.resource_version == 0 { @@ -7554,6 +7821,312 @@ mod tests { request } + #[tokio::test] + async fn provisioning_timeout_rejects_supervisor_registration() { + use openshell_core::proto::{ + ConfigurationAdmissionState, ReportSandboxConfigurationRequest, + SandboxConfigurationAdmission, SandboxPhase, SandboxProvisioning, + }; + let state = test_server_state().await; + let sandbox_id = "sb-timeout-registration"; + let mut sandbox = test_sandbox( + sandbox_id, + "timeout-registration", + openshell_policy::restrictive_default_policy(), + Vec::new(), + ); + sandbox.set_phase(SandboxPhase::Error.into()); + sandbox.status.as_mut().unwrap().provisioning = Some(SandboxProvisioning { + timeout_time: openshell_core::time::timestamp_from_millis(300_000).ok(), + ..Default::default() + }); + state.store.put_message(&sandbox).await.unwrap(); + let error = handle_report_sandbox_configuration( + &state, + with_sandbox( + Request::new(ReportSandboxConfigurationRequest { + sandbox_id: sandbox_id.into(), + admission: Some(SandboxConfigurationAdmission { + instance_id: uuid::Uuid::new_v4().to_string(), + state: ConfigurationAdmissionState::Pending.into(), + ..Default::default() + }), + ..Default::default() + }), + sandbox_id, + ), + ) + .await + .unwrap_err(); + assert_eq!(error.code(), Code::FailedPrecondition); + assert!(error.message().contains("repair window expired")); + } + + #[tokio::test] + async fn configuration_admission_rejects_stale_generation_and_instance() { + use openshell_core::proto::{ + ConfigurationAdmissionState as Admission, ReportSandboxConfigurationRequest, + SandboxConfigurationAdmission, + }; + let state = test_server_state().await; + let sandbox_id = "sb-admission"; + state + .store + .put_message(&test_sandbox( + sandbox_id, + "admission", + openshell_policy::restrictive_default_policy(), + Vec::new(), + )) + .await + .unwrap(); + let instance_id = uuid::Uuid::new_v4().to_string(); + let report = |admission| { + with_sandbox( + Request::new(ReportSandboxConfigurationRequest { + sandbox_id: sandbox_id.to_string(), + admission: Some(admission), + expected_instance_id: String::new(), + }), + sandbox_id, + ) + }; + handle_report_sandbox_configuration( + &state, + report(SandboxConfigurationAdmission { + instance_id: instance_id.clone(), + state: Admission::Pending.into(), + ..Default::default() + }), + ) + .await + .unwrap(); + let config = handle_get_sandbox_config( + &state, + with_sandbox( + Request::new(GetSandboxConfigRequest { + sandbox_id: sandbox_id.to_string(), + }), + sandbox_id, + ), + ) + .await + .unwrap() + .into_inner(); + assert!(config.configuration_admitted); + let accepted = SandboxConfigurationAdmission { + instance_id: instance_id.clone(), + state: Admission::Accepted.into(), + policy_version: config.version, + policy_hash: config.policy_hash, + config_revision: config.config_revision, + provider_env_revision: config.provider_env_revision, + error: String::new(), + }; + let mut outdated_admission = accepted.clone(); + outdated_admission.provider_env_revision = + outdated_admission.provider_env_revision.wrapping_add(1); + assert_eq!( + handle_report_sandbox_configuration(&state, report(outdated_admission)) + .await + .unwrap_err() + .code(), + Code::Aborted + ); + handle_report_sandbox_configuration(&state, report(accepted.clone())) + .await + .unwrap(); + let mut stale_rejection = accepted.clone(); + stale_rejection.state = Admission::Rejected.into(); + stale_rejection.policy_version += 1; + assert_eq!( + handle_report_sandbox_configuration(&state, report(stale_rejection)) + .await + .unwrap_err() + .code(), + Code::Aborted, + "a delayed rejection must not mark the accepted current generation invalid" + ); + let restart_instance = uuid::Uuid::new_v4().to_string(); + let mut restart = report(SandboxConfigurationAdmission { + instance_id: restart_instance.clone(), + state: Admission::Pending.into(), + ..Default::default() + }); + restart.get_mut().expected_instance_id = instance_id.clone(); + handle_report_sandbox_configuration(&state, restart) + .await + .unwrap(); + assert_eq!( + handle_report_sandbox_configuration( + &state, + report(SandboxConfigurationAdmission { + instance_id, + state: Admission::Pending.into(), + ..Default::default() + }) + ) + .await + .unwrap_err() + .code(), + Code::FailedPrecondition, + "delayed old Pending must not reclaim registration" + ); + assert_eq!( + handle_report_sandbox_configuration(&state, report(accepted.clone())) + .await + .unwrap_err() + .code(), + Code::FailedPrecondition + ); + for admission_state in [Admission::Pending, Admission::Rejected] { + if admission_state == Admission::Rejected { + let mut rejected = accepted.clone(); + rejected.instance_id = restart_instance.clone(); + rejected.state = Admission::Rejected.into(); + handle_report_sandbox_configuration(&state, report(rejected)) + .await + .unwrap(); + } + let persisted = state + .store + .get_message::(sandbox_id) + .await + .unwrap() + .unwrap(); + assert_eq!( + persisted.status.as_ref().unwrap().configuration_activated, + Some(true) + ); + assert!(!crate::policy_store::permits_initial_static_policy_repair( + &persisted + )); + let mut replacement = persisted.spec.as_ref().unwrap().policy.clone().unwrap(); + replacement.filesystem.as_mut().unwrap().read_only.clear(); + let error = handle_update_config( + &state, + with_user(Request::new(UpdateConfigRequest { + name: "admission".to_string(), + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + policy: Some(replacement), + ..Default::default() + })), + ) + .await + .unwrap_err(); + assert_eq!(error.code(), Code::InvalidArgument); + assert!(error.message().contains("filesystem"), "{error}"); + } + } + + #[test] + fn configuration_diagnostic_is_bounded_and_removes_control_characters() { + let diagnostic = bounded_configuration_diagnostic(&format!("rule\n{}", "é".repeat(1000))); + assert_eq!(diagnostic.chars().count(), 512); + assert!(!diagnostic.contains('\n')); + } + + #[tokio::test] + async fn configuration_admission_retains_invalid_image_composition_for_repair() { + use openshell_core::proto::{ + ConfigurationAdmissionState as Admission, ReportSandboxConfigurationRequest, + SandboxConfigurationAdmission, + }; + let state = test_server_state().await; + let sandbox_id = "sb-image-admission"; + let mut sandbox = test_sandbox( + sandbox_id, + "image-admission", + ProtoSandboxPolicy::default(), + vec!["work-github".to_string()], + ); + sandbox.spec.as_mut().unwrap().policy = None; + sandbox.status.as_mut().unwrap().configuration_activated = Some(false); + state + .store + .put_message(&test_provider("work-github", "github")) + .await + .unwrap(); + state.store.put_message(&sandbox).await.unwrap(); + let instance_id = uuid::Uuid::new_v4().to_string(); + handle_report_sandbox_configuration( + &state, + with_sandbox( + Request::new(ReportSandboxConfigurationRequest { + sandbox_id: sandbox_id.to_string(), + expected_instance_id: String::new(), + admission: Some(SandboxConfigurationAdmission { + instance_id, + state: Admission::Pending.into(), + ..Default::default() + }), + }), + sandbox_id, + ), + ) + .await + .unwrap(); + let image = test_policy_with_rule("image_github", "api.github.com"); + handle_update_config( + &state, + with_sandbox( + Request::new(UpdateConfigRequest { + name: "image-admission".to_string(), + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + policy: Some(image), + ..Default::default() + }), + sandbox_id, + ), + ) + .await + .expect("image candidate remains available for repair"); + let rejected = handle_get_sandbox_config( + &state, + with_sandbox( + Request::new(GetSandboxConfigRequest { + sandbox_id: sandbox_id.to_string(), + }), + sandbox_id, + ), + ) + .await + .unwrap() + .into_inner(); + assert!(!rejected.configuration_admitted); + assert!(rejected.configuration_error.contains("image_github")); + assert!(!rejected.configuration_error.contains("ghp-test")); + assert!(rejected.policy.is_some()); + handle_update_config( + &state, + with_user(Request::new(UpdateConfigRequest { + name: "image-admission".to_string(), + workspace_scope: Some(openshell_core::proto::workspace_selector("default")), + policy: Some(openshell_policy::restrictive_default_policy()), + ..Default::default() + })), + ) + .await + .expect("operator can replace static sections before first launch"); + let repaired = handle_get_sandbox_config( + &state, + with_sandbox( + Request::new(GetSandboxConfigRequest { + sandbox_id: sandbox_id.to_string(), + }), + sandbox_id, + ), + ) + .await + .unwrap() + .into_inner(); + assert!( + repaired.configuration_admitted, + "{}", + repaired.configuration_error + ); + } + fn security_notes_for_host(host: &str) -> String { generate_security_notes(&NetworkPolicyRule { endpoints: vec![NetworkEndpoint { @@ -7785,7 +8358,7 @@ mod tests { .await .expect("store legacy sandbox spec"); - let error = handle_get_sandbox_config( + let error = handle_get_sandbox_config_inner( &state, with_sandbox( Request::new(GetSandboxConfigRequest { @@ -8032,7 +8605,7 @@ mod tests { .await .expect("store legacy invalid history"); - let error = handle_get_sandbox_config( + let rejected = handle_get_sandbox_config( &state, with_sandbox( Request::new(GetSandboxConfigRequest { @@ -8042,10 +8615,12 @@ mod tests { ), ) .await - .expect_err("invalid latest history must fail closed"); + .expect("invalid latest history must remain repairable") + .into_inner(); - assert_eq!(error.code(), Code::FailedPrecondition); - assert!(error.message().contains(STORED_POLICY_SOURCE_HISTORY)); + assert!(!rejected.configuration_admitted); + assert!(rejected.policy.is_none()); + assert!(!rejected.configuration_error.is_empty()); let record = state .store diff --git a/crates/openshell-server/src/grpc/policy/provisioning_clock.rs b/crates/openshell-server/src/grpc/policy/provisioning_clock.rs new file mode 100644 index 0000000000..2097bf37bd --- /dev/null +++ b/crates/openshell-server/src/grpc/policy/provisioning_clock.rs @@ -0,0 +1,271 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +//! Durable source clocks for the provisioning repair window. Status observations +//! never contribute. Source identities distinguish real A -> B -> A edits. + +use super::{POLICY_SETTING_KEY, load_global_settings, load_sandbox_settings}; +use crate::compute::provisioning_deadline::ConfigurationChange; +use crate::persistence::{ObjectId, ObjectName, ObjectType, ObjectWorkspace, Store}; +use crate::policy_store::PolicyStoreExt; +use crate::storage_proto::StoredProviderProfile; +use openshell_core::proto::{Provider, Sandbox}; +use openshell_core::time::timestamp_to_millis; +use prost::Message; +use sha2::{Digest, Sha256}; +use std::collections::BTreeSet; + +/// Read only committed configuration sources, never sandbox `updated_at`. +/// The caller serializes this read with configuration mutations and expiry. +pub async fn configuration_change( + store: &Store, + sandbox: &Sandbox, +) -> Result { + let global = load_global_settings(store) + .await + .map_err(|e| e.to_string())?; + let local = load_sandbox_settings(store, sandbox.object_workspace(), sandbox.object_name()) + .await + .map_err(|e| e.to_string())?; + let created = sandbox + .metadata + .as_ref() + .and_then(|meta| meta.created_time.as_ref()) + .and_then(|time| timestamp_to_millis(time).ok()) + .unwrap_or(0); + let mut committed_at_ms = created; + let mut sources = Vec::<(String, String)>::new(); + let keys: BTreeSet<_> = global + .change_clocks + .keys() + .chain(local.change_clocks.keys()) + .collect(); + for key in keys { + if key != POLICY_SETTING_KEY && openshell_core::settings::setting_for_key(key).is_none() { + continue; + } + // Global settings override sandbox values. Keep global deletion clocks + // because deleting an override reveals the sandbox value again. + if let Some(clock) = global.change_clocks.get(key) { + sources.push((format!("global:{key}"), clock.id.clone())); + committed_at_ms = committed_at_ms.max(clock.committed_at_ms); + } + if key != POLICY_SETTING_KEY + && !global.settings.contains_key(key) + && let Some(clock) = local.change_clocks.get(key) + { + sources.push((format!("sandbox:{key}"), clock.id.clone())); + committed_at_ms = committed_at_ms.max(clock.committed_at_ms); + } + } + if !global.settings.contains_key(POLICY_SETTING_KEY) { + if let Some(policy) = store + .get_latest_policy(sandbox.object_id()) + .await + .map_err(|e| e.to_string())? + { + sources.push(( + "policy".into(), + format!("{}:{}", policy.version, policy.policy_hash), + )); + // Lazy version-one backfill has the same source identity as the + // original spec, so its newer timestamp alone cannot reset the TTL. + committed_at_ms = committed_at_ms.max(policy.created_at_ms); + } else { + let hash = sandbox + .spec + .as_ref() + .and_then(|spec| spec.policy.as_ref()) + .map(openshell_core::policy_identity::deterministic_policy_hash) + .unwrap_or_default(); + sources.push(("policy".into(), format!("1:{hash}"))); + } + } + if let Some(record) = sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + { + sources.push(("attachments".into(), record.attachment_change_id.clone())); + if let Some(time) = &record.attachment_change_time { + committed_at_ms = + committed_at_ms.max(timestamp_to_millis(time).map_err(|e| e.to_string())?); + } + } + if let Some(spec) = &sandbox.spec { + for name in &spec.providers { + let Some(record) = store + .get_by_name(Provider::object_type(), sandbox.object_workspace(), name) + .await + .map_err(|e| e.to_string())? + else { + sources.push((format!("provider:{name}"), "missing".into())); + continue; + }; + sources.push(( + format!("provider:{name}"), + format!("{}:{}", record.id, record.resource_version), + )); + committed_at_ms = committed_at_ms.max(record.updated_at_ms); + let provider = + Provider::decode(record.payload.as_slice()).map_err(|e| e.to_string())?; + let mut profile = store + .get_by_name( + StoredProviderProfile::object_type(), + &provider.profile_workspace, + &provider.r#type, + ) + .await + .map_err(|e| e.to_string())?; + if profile.is_none() && !provider.profile_workspace.is_empty() { + profile = store + .get_by_name(StoredProviderProfile::object_type(), "", &provider.r#type) + .await + .map_err(|e| e.to_string())?; + } + if let Some(profile) = profile { + sources.push(( + format!("profile:{}:{}", provider.profile_workspace, provider.r#type), + format!("{}:{}", profile.id, profile.resource_version), + )); + committed_at_ms = committed_at_ms.max(profile.updated_at_ms); + } + } + } + sources.sort(); + let encoded = serde_json::to_vec(&sources).map_err(|e| e.to_string())?; + Ok(ConfigurationChange { + id: format!("{:x}", Sha256::digest(encoded)), + committed_at_ms, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::grpc::StoredSettingValue; + use crate::grpc::policy::{save_global_settings, save_sandbox_settings}; + use openshell_core::proto::ObjectMeta; + + fn sandbox() -> Sandbox { + Sandbox { + metadata: Some(ObjectMeta { + id: "sb-clock".into(), + name: "clock".into(), + workspace: "default".into(), + ..Default::default() + }), + ..Default::default() + } + } + + #[tokio::test] + async fn provisioning_settings_clock_survives_noop_and_a_b_a() { + let store = Store::connect("sqlite::memory:").await.unwrap(); + let sandbox = sandbox(); + let mut settings = load_global_settings(&store).await.unwrap(); + settings + .settings + .insert("ocsf_json_enabled".into(), StoredSettingValue::Bool(false)); + save_global_settings(&store, &settings).await.unwrap(); + let first = configuration_change(&store, &sandbox).await.unwrap(); + let settings = load_global_settings(&store).await.unwrap(); + save_global_settings(&store, &settings).await.unwrap(); + assert_eq!(configuration_change(&store, &sandbox).await.unwrap(), first); + let mut settings = load_global_settings(&store).await.unwrap(); + settings + .settings + .insert("ocsf_json_enabled".into(), StoredSettingValue::Bool(true)); + save_global_settings(&store, &settings).await.unwrap(); + let mut settings = load_global_settings(&store).await.unwrap(); + settings + .settings + .insert("ocsf_json_enabled".into(), StoredSettingValue::Bool(false)); + save_global_settings(&store, &settings).await.unwrap(); + let last = configuration_change(&store, &sandbox).await.unwrap(); + assert_ne!( + last.id, first.id, + "a missed intermediate generation is still a real edit" + ); + assert!(last.committed_at_ms >= first.committed_at_ms); + assert_eq!( + configuration_change(&store, &sandbox).await.unwrap(), + last, + "reads cannot refresh commit time" + ); + } + + #[tokio::test] + async fn provisioning_global_override_ignores_shadowed_changes_and_tracks_deletion() { + let store = Store::connect("sqlite::memory:").await.unwrap(); + let sandbox = sandbox(); + let mut global = load_global_settings(&store).await.unwrap(); + global + .settings + .insert("ocsf_json_enabled".into(), StoredSettingValue::Bool(false)); + save_global_settings(&store, &global).await.unwrap(); + let first = configuration_change(&store, &sandbox).await.unwrap(); + let mut local = load_sandbox_settings(&store, "default", "clock") + .await + .unwrap(); + local + .settings + .insert("ocsf_json_enabled".into(), StoredSettingValue::Bool(true)); + save_sandbox_settings(&store, "default", "clock", &local) + .await + .unwrap(); + assert_eq!(configuration_change(&store, &sandbox).await.unwrap(), first); + let mut global = load_global_settings(&store).await.unwrap(); + global.settings.remove("ocsf_json_enabled"); + save_global_settings(&store, &global).await.unwrap(); + let deleted = configuration_change(&store, &sandbox).await.unwrap(); + assert_ne!(deleted.id, first.id); + let loaded = load_global_settings(&store).await.unwrap(); + assert!(loaded.change_clocks.contains_key("ocsf_json_enabled")); + assert_eq!( + deleted.committed_at_ms, + loaded.change_clocks["ocsf_json_enabled"].committed_at_ms + ); + } + + #[tokio::test] + async fn provisioning_lazy_policy_backfill_does_not_change_generation() { + let store = Store::connect("sqlite::memory:").await.unwrap(); + let mut sandbox = sandbox(); + let policy = openshell_policy::restrictive_default_policy(); + let hash = openshell_core::policy_identity::deterministic_policy_hash(&policy); + sandbox.spec = Some(openshell_core::proto::SandboxSpec { + policy: Some(policy.clone()), + ..Default::default() + }); + let first = configuration_change(&store, &sandbox).await.unwrap(); + store + .put_policy_revision( + "policy-1", + "sb-clock", + "default", + 1, + &policy.encode_to_vec(), + &hash, + ) + .await + .unwrap(); + let projected = configuration_change(&store, &sandbox).await.unwrap(); + assert_eq!(projected.id, first.id); + store + .put_policy_revision( + "policy-2", + "sb-clock", + "default", + 2, + &policy.encode_to_vec(), + &hash, + ) + .await + .unwrap(); + assert_ne!( + configuration_change(&store, &sandbox).await.unwrap().id, + first.id + ); + } +} diff --git a/crates/openshell-server/src/grpc/sandbox.rs b/crates/openshell-server/src/grpc/sandbox.rs index e72f5631e4..a1342f4575 100644 --- a/crates/openshell-server/src/grpc/sandbox.rs +++ b/crates/openshell-server/src/grpc/sandbox.rs @@ -490,6 +490,31 @@ async fn handle_create_sandbox_inner( created_from_workload_template, }; sandbox.set_phase(SandboxPhase::Provisioning as i32); + sandbox + .status + .get_or_insert_with(Default::default) + .configuration_admission = Some(openshell_core::proto::SandboxConfigurationAdmission { + state: openshell_core::proto::ConfigurationAdmissionState::Pending.into(), + ..Default::default() + }); + sandbox + .status + .as_mut() + .expect("status initialized") + .configuration_activated = Some(false); + sandbox + .status + .as_mut() + .expect("status initialized") + .provisioning = Some(crate::compute::provisioning_deadline::new_record(now_ms)); + crate::compute::provisioning_deadline::refresh_configuration( + &state.store, + &mut sandbox, + now_ms, + ) + .await + .map_err(Status::internal)?; + crate::compute::apply_configuration_readiness(&mut sandbox); // Ensure metadata is valid (defense in depth - should always be true for server-constructed metadata) super::validation::validate_object_metadata(sandbox.metadata.as_ref(), "sandbox")?; @@ -1229,6 +1254,10 @@ pub(super) async fn handle_attach_sandbox_provider( spec.providers.push(provider_name.clone()); spec.provider_attachment_epoch.clone_from(&mutation_id); attached_clone.store(true, Ordering::Relaxed); + crate::compute::provisioning_deadline::attachments_changed( + sandbox, + current_time_ms(), + ); } }, ) @@ -1348,6 +1377,10 @@ pub(super) async fn handle_detach_sandbox_provider( detached_clone.store(true, Ordering::Relaxed); // Only dedupe after making a change dedupe_provider_names(&mut spec.providers); + crate::compute::provisioning_deadline::attachments_changed( + sandbox, + current_time_ms(), + ); } }, ) diff --git a/crates/openshell-server/src/lib.rs b/crates/openshell-server/src/lib.rs index 47eefb7704..80cc2acd57 100644 --- a/crates/openshell-server/src/lib.rs +++ b/crates/openshell-server/src/lib.rs @@ -813,6 +813,12 @@ pub(crate) async fn run_server( ))); } + // Deadlines must run while restored supervisors wait for policy repair. + let (startup_tx, startup_rx) = watch::channel(false); + state + .compute + .spawn_watchers(shutdown_rx.clone(), startup_rx); + // Restored supervisors need the callback listeners while the compute // driver reconciles persisted sandboxes. Serve them before starting that // reconciliation so policy fetch and supervisor-session registration @@ -841,7 +847,7 @@ pub(crate) async fn run_server( warn!(error = %err, "Failed to start persisted sandboxes during startup"); } - state.compute.spawn_watchers(shutdown_rx.clone()); + startup_tx.send_replace(true); ssh_sessions::spawn_session_reaper(store.clone(), Duration::from_hours(1)); supervisor_session::spawn_relay_reaper(state.clone(), Duration::from_secs(30)); provider_refresh::spawn_refresh_worker(state.clone(), Duration::from_mins(1)); diff --git a/crates/openshell-server/src/policy_store.rs b/crates/openshell-server/src/policy_store.rs index 464957b44f..cf6e23ef51 100644 --- a/crates/openshell-server/src/policy_store.rs +++ b/crates/openshell-server/src/policy_store.rs @@ -34,6 +34,8 @@ pub struct AtomicPolicyRevisionWrite { pub provenance: HashMap, pub expected_resource_version: u64, pub annotations: HashMap, + /// Populate the create-time baseline, or replace it while startup admission + /// is blocked and no workload has consumed the static restrictions. pub backfill_policy: Option, } @@ -55,6 +57,26 @@ pub fn policy_record_for_atomic_write( } } +/// Only a new sandbox with durable evidence of no prior activation can replace +/// static restrictions. Legacy records are conservative: absence is not false. +pub fn permits_initial_static_policy_repair(sandbox: &Sandbox) -> bool { + sandbox.status.as_ref().is_some_and(|status| { + status.configuration_activated == Some(false) + && status + .configuration_admission + .as_ref() + .is_some_and(|admission| { + matches!( + openshell_core::proto::ConfigurationAdmissionState::try_from( + admission.state + ), + Ok(openshell_core::proto::ConfigurationAdmissionState::Pending + | openshell_core::proto::ConfigurationAdmissionState::Rejected) + ) + }) + }) +} + pub fn project_policy_revision_onto_sandbox( write: &AtomicPolicyRevisionWrite, payload: &[u8], @@ -74,6 +96,7 @@ pub fn project_policy_revision_onto_sandbox( sandbox.set_resource_version(current_resource_version); let mut changed = false; + let startup_blocked = permits_initial_static_policy_repair(&sandbox); if let Some(backfill_policy) = write.backfill_policy.as_ref() { let spec = sandbox .spec @@ -85,6 +108,10 @@ pub fn project_policy_revision_onto_sandbox( changed = true; } Some(current) if current == backfill_policy => {} + Some(_) if startup_blocked => { + spec.policy = Some(backfill_policy.clone()); + changed = true; + } Some(_) => { return Err(PersistenceError::Conflict { current_resource_version: Some(current_resource_version), @@ -597,3 +624,67 @@ pub fn draft_chunk_record_from_parts( candidate_effective_policy: wrapper.candidate_effective_policy, }) } + +#[cfg(test)] +mod tests { + use super::*; + use openshell_core::proto::{ + ConfigurationAdmissionState as Admission, SandboxConfigurationAdmission, SandboxSpec, + SandboxStatus, + }; + + #[test] + fn static_projection_requires_durable_evidence_of_no_previous_activation() { + let baseline = openshell_policy::restrictive_default_policy(); + let mut replacement = baseline.clone(); + replacement + .filesystem + .as_mut() + .unwrap() + .read_write + .push("/new-static-path".to_string()); + let write = AtomicPolicyRevisionWrite { + id: "revision".to_string(), + sandbox_id: "sandbox".to_string(), + workspace: "default".to_string(), + version: 2, + policy_payload: replacement.encode_to_vec(), + policy_hash: String::new(), + provenance: HashMap::new(), + expected_resource_version: 0, + annotations: HashMap::new(), + backfill_policy: Some(replacement.clone()), + }; + for activated in [None, Some(false), Some(true)] { + for state in [Admission::Pending, Admission::Rejected, Admission::Accepted] { + let sandbox = Sandbox { + spec: Some(SandboxSpec { + policy: Some(baseline.clone()), + ..Default::default() + }), + status: Some(SandboxStatus { + configuration_activated: activated, + configuration_admission: Some(SandboxConfigurationAdmission { + state: state.into(), + ..Default::default() + }), + ..Default::default() + }), + ..Default::default() + }; + let result = + project_policy_revision_onto_sandbox(&write, &sandbox.encode_to_vec(), 1); + if activated == Some(false) && state != Admission::Accepted { + let (projected, changed) = result.unwrap(); + assert!(changed); + assert_eq!(projected.spec.unwrap().policy, Some(replacement.clone())); + } else { + assert!( + matches!(result, Err(PersistenceError::Conflict { .. })), + "{activated:?} {state:?}" + ); + } + } + } + } +} diff --git a/crates/openshell-server/src/storage_proto.rs b/crates/openshell-server/src/storage_proto.rs index 6e53903178..209d600a82 100644 --- a/crates/openshell-server/src/storage_proto.rs +++ b/crates/openshell-server/src/storage_proto.rs @@ -118,11 +118,11 @@ mod tests { const STORAGE_V1_SCHEMA_SHA256: &str = "d68401809d8cea445c35233ef32412bbd041cb2ac5acaf368a0d0bf74d2ddf17"; const PUBLIC_RPC_SCHEMA_SHA256: &str = - "beea342cc79c06b6efda934370a2425e444b8dab1c795b2858e9f241dec1ca2b"; + "87be23fc0ac4eaf8ce5890a1c87e6a48279f65fc8fbcc0cea7d7cbe426f2cc46"; const DURABLE_SCHEMA_SHA256: &str = - "557ca283c55fd46b213d5573b950ba8604cc3f4b31bad3e433eb9c5f9975138d"; + "654649c8f65f44ac2ba04290f49c56de2f488271f99bc0fd4c6d025039c05128"; const PUBLIC_DURABLE_OVERLAP_SHA256: &str = - "f541c25bb3e1e5806865bc61470c66d10c16cca7399bf5909c77dc384d469171"; + "376cc8ecbc8b9b995e2170ccb5c2f18ef82adf9b5f55f1683571410722dfd4cf"; // A persisted Sandbox without endpoint status retains its lifecycle fields; // the absent repeated field decodes empty and needs no database rewrite. const SANDBOX_WITHOUT_ENDPOINT_STATUS: &str = "0a1e0a0a73616e64626f782d6964120773616e64626f783a0764656661756c741a2b0a0773616e64626f782a0d0a05526561647912045472756530023807420d73757065727669736f722d6964"; @@ -513,12 +513,12 @@ mod tests { } assert_eq!( compiled_method_count, - 101 + PROVIDER_READINESS_RPC_SIGNATURES.len(), + 102 + PROVIDER_READINESS_RPC_SIGNATURES.len(), "classify every compiled RPC" ); assert_eq!( methods.len(), - 75 + PROVIDER_READINESS_RPC_SIGNATURES.len(), + 76 + PROVIDER_READINESS_RPC_SIGNATURES.len(), "inventory every public gateway RPC" ); assert_eq!( @@ -526,7 +526,7 @@ mod tests { .iter() .filter(|method| method.starts_with("openshell.v1.OpenShell/")) .count(), - 75 + PROVIDER_READINESS_RPC_SIGNATURES.len() + 76 + PROVIDER_READINESS_RPC_SIGNATURES.len() ); assert!(methods.iter().all(|method| !method.contains(".storage."))); @@ -570,9 +570,9 @@ mod tests { overlap_hash.as_str(), ), ( - (295, 20), - (90, 15), - (78, 15), + (299, 21), + (92, 16), + (80, 16), PUBLIC_RPC_SCHEMA_SHA256, DURABLE_SCHEMA_SHA256, PUBLIC_DURABLE_OVERLAP_SHA256 @@ -593,6 +593,25 @@ mod tests { assert!(spec.provider_attachment_epoch.is_empty()); } + #[test] + fn pre_admission_sandbox_bytes_preserve_legacy_status() { + use openshell_core::proto::{Sandbox, SandboxPhase}; + // Synthetic Sandbox encoded with main 0357daee, before admission fields. + let bytes = + legacy_bytes("0a180a096c65676163792d6964120b6c65676163792d6e616d651a0430023807"); + let sandbox = Sandbox::decode(bytes.as_slice()).unwrap(); + let status = sandbox.status.as_ref().unwrap(); + assert_eq!(status.phase, SandboxPhase::Ready as i32); + assert_eq!(status.current_policy_version, 7); + assert!(status.configuration_admission.is_none()); + assert_eq!(status.configuration_activated, None); + assert!(status.provisioning.is_none()); + assert!(!crate::policy_store::permits_initial_static_policy_repair( + &sandbox + )); + assert_eq!(sandbox.encode_to_vec(), bytes); + } + fn legacy_bytes(encoded: &str) -> Vec { hex::decode(encoded).expect("checked-in legacy fixture must be valid hex") } diff --git a/crates/openshell-server/tests/common/mod.rs b/crates/openshell-server/tests/common/mod.rs index 5391a3ab4e..64e2762e2a 100644 --- a/crates/openshell-server/tests/common/mod.rs +++ b/crates/openshell-server/tests/common/mod.rs @@ -463,6 +463,13 @@ impl OpenShell for TestOpenShell { Err(Status::unimplemented("not implemented in test")) } + async fn report_sandbox_configuration( + &self, + _request: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _request: tonic::Request, diff --git a/crates/openshell-server/tests/supervisor_relay_integration.rs b/crates/openshell-server/tests/supervisor_relay_integration.rs index f3ae883f78..31ab9cb1eb 100644 --- a/crates/openshell-server/tests/supervisor_relay_integration.rs +++ b/crates/openshell-server/tests/supervisor_relay_integration.rs @@ -434,6 +434,13 @@ impl OpenShell for RelayGateway { ) -> Result, Status> { Err(Status::unimplemented("unused")) } + async fn report_sandbox_configuration( + &self, + _: tonic::Request, + ) -> Result, Status> { + Err(Status::unimplemented("not implemented in test")) + } + async fn report_policy_status( &self, _: tonic::Request, diff --git a/crates/openshell-supervisor-network/src/opa.rs b/crates/openshell-supervisor-network/src/opa.rs index 5a7056a79c..ba1f8d1a28 100644 --- a/crates/openshell-supervisor-network/src/opa.rs +++ b/crates/openshell-supervisor-network/src/opa.rs @@ -728,47 +728,39 @@ impl OpaEngine { proto: &ProtoSandboxPolicy, entrypoint_pid: u32, ) -> Result { - // Build a complete new engine through the same validated pipeline. - let new = Self::from_proto_with_pid(proto, entrypoint_pid)?; - let new_engine = new - .engine - .into_inner() - .map_err(|_| miette::miette!("lock poisoned on new engine"))?; - let mut engine = self - .engine - .lock() - .map_err(|_| miette::miette!("OPA engine lock poisoned"))?; - *engine = new_engine; - *self - .fail_closed_reason - .write() - .map_err(|_| miette::miette!("OPA fail-closed state lock poisoned"))? = None; - let generation = self.advance_generation(); - // Capture evidence while the installation lock still excludes a - // competing reload; reading the generation later can bind the wrong policy. - self.generation_guard(generation) + self.reload_configuration_from_proto_with_pid(proto, entrypoint_pid, None, || {}) } /// Reload the policy and middleware registry as one runtime generation. - /// - /// Both replacements are prepared before the live locks are acquired. The - /// engine and runner are then swapped while holding both locks, followed by - /// a single generation increment. A preparation or lock failure leaves the - /// live pair and generation untouched. - /// Returns evidence tied to that combined installation. pub fn reload_policy_and_middleware_from_proto_with_pid( &self, proto: &ProtoSandboxPolicy, entrypoint_pid: u32, registry: MiddlewareRegistry, + ) -> Result { + self.reload_configuration_from_proto_with_pid(proto, entrypoint_pid, Some(registry), || {}) + } + + /// Validate a complete candidate before publishing policy, middleware, and + /// prepared credentials together. A validation or lock failure leaves the + /// active configuration untouched and never invokes `commit_credentials`. + /// + /// The callback must be infallible and must not call back into this engine. + /// Existing policy guards become stale before credentials change; new + /// policy readers remain blocked until the complete configuration is live. + pub fn reload_configuration_from_proto_with_pid( + &self, + proto: &ProtoSandboxPolicy, + entrypoint_pid: u32, + registry: Option, + commit_credentials: impl FnOnce(), ) -> Result { let new = Self::from_proto_with_pid(proto, entrypoint_pid)?; let new_engine = new .engine .into_inner() .map_err(|_| miette::miette!("lock poisoned on new engine"))?; - // Match clone_engine_for_tunnel's lock order (engine, then runner) so - // readers can observe only the old pair or the new pair. + // Match clone_engine_for_tunnel's lock order (engine, then runner). let mut engine = self .engine .lock() @@ -777,14 +769,18 @@ impl OpaEngine { .middleware_runner .write() .map_err(|_| miette::miette!("middleware runner lock poisoned"))?; - let new_runner = runner.with_replacement_registry(registry); - *engine = new_engine; - *runner = new_runner; - *self + let mut fail_closed_reason = self .fail_closed_reason .write() - .map_err(|_| miette::miette!("OPA fail-closed state lock poisoned"))? = None; + .map_err(|_| miette::miette!("OPA fail-closed state lock poisoned"))?; + let new_runner = registry.map(|registry| runner.with_replacement_registry(registry)); let generation = self.advance_generation(); + commit_credentials(); + *engine = new_engine; + if let Some(new_runner) = new_runner { + *runner = new_runner; + } + *fail_closed_reason = None; self.generation_guard(generation) } @@ -10592,6 +10588,44 @@ network_policies: assert!(described[0].is_resolved()); } + #[test] + fn rejected_configuration_never_commits_credentials() { + let mut proto = test_proto(); + let engine = OpaEngine::from_proto(&proto).unwrap(); + proto.network_middlewares.insert( + String::new(), + NetworkMiddlewareConfig { + middleware: openshell_supervisor_middleware_builtins::BUILTIN_REGEX.into(), + ..Default::default() + }, + ); + engine + .reload_configuration_from_proto_with_pid(&proto, 0, None, || { + panic!("invalid candidate must not publish credentials"); + }) + .expect_err("invalid candidate"); + assert_eq!(engine.current_generation(), 0); + } + + #[test] + fn configuration_commit_invalidates_old_guards_before_credentials_change() { + let proto = test_proto(); + let engine = OpaEngine::from_proto(&proto).unwrap(); + let old = engine.clone_engine_for_tunnel(0).unwrap(); + engine.enter_fail_closed("invalid candidate").unwrap(); + let mut committed = false; + engine + .reload_configuration_from_proto_with_pid(&proto, 0, None, || { + assert!(old.generation_guard().is_stale()); + assert_eq!(engine.current_generation(), 2); + committed = true; + }) + .unwrap(); + assert!(committed); + assert!(engine.fail_closed_reason().is_none()); + assert!(engine.clone_engine_for_tunnel(2).is_ok()); + } + #[tokio::test] async fn failed_combined_reload_preserves_policy_registry_and_generation() { let proto = test_proto(); diff --git a/crates/openshell-supervisor/Cargo.toml b/crates/openshell-supervisor/Cargo.toml index 2b7197a596..d4fb9cee68 100644 --- a/crates/openshell-supervisor/Cargo.toml +++ b/crates/openshell-supervisor/Cargo.toml @@ -51,6 +51,7 @@ telemetry = ["openshell-core/telemetry"] bundled-ca-roots = ["openshell-supervisor-network/bundled-ca-roots"] [dev-dependencies] +tokio = { workspace = true, features = ["test-util"] } futures = { workspace = true } temp-env = "0.3" tokio-tungstenite = { workspace = true } diff --git a/crates/openshell-supervisor/src/lib.rs b/crates/openshell-supervisor/src/lib.rs index 3443b8fae6..0398cb09cd 100644 --- a/crates/openshell-supervisor/src/lib.rs +++ b/crates/openshell-supervisor/src/lib.rs @@ -465,7 +465,7 @@ pub async fn run_network_proxy( } let extension_credentials = openshell_extension_core::ExtensionCredentialStore::new(); - let (mut policy, opa_engine, _, _, _, initial_agent_proposals_enabled, _) = load_policy( + let (mut policy, opa_engine, _, _, _, initial_agent_proposals_enabled, _, _) = load_policy( None, None, None, @@ -611,6 +611,33 @@ pub async fn run_sandbox( // and the policy poll loop that rotates them stay the same objects. let extension_credentials = openshell_extension_core::ExtensionCredentialStore::new(); + let runtime_descriptor: openshell_sandbox_backend::boundary_protocol::SandboxRuntimeDescriptor = + serde_json::from_slice(&backend_descriptor.payload) + .map_err(|error| miette::miette!("decode sandbox runtime descriptor: {error}"))?; + if auth_bundle.runtime_generation.as_str() != runtime_descriptor.generation { + return Err(miette::miette!( + "supervisor authentication bundle does not match runtime generation" + )); + } + let sandbox_bearer = openshell_core::grpc_client::install_supervisor_auth_bundle(&auth_bundle)?; + let (image_yaml, invalid_image) = + openshell_sandbox_backend::OpenShellRuntimeBackend::discover_policy( + runtime_descriptor.clone(), + sandbox_bearer.clone(), + ) + .await + .map_err(|error| miette::miette!("discover workload image policy: {error}"))?; + let image_discovery = if invalid_image { + ImagePolicyDiscovery::Invalid + } else if let Some(yaml) = image_yaml { + openshell_policy::parse_sandbox_policy(&yaml) + .map_or(ImagePolicyDiscovery::Invalid, |policy| { + ImagePolicyDiscovery::Policy(Box::new(policy)) + }) + } else { + ImagePolicyDiscovery::Missing + }; + // Load policy and initialize OPA engine let openshell_endpoint_for_proxy = openshell_endpoint.clone(); let sandbox_name_for_agg = sandbox.clone(); @@ -622,7 +649,8 @@ pub async fn run_sandbox( loaded_policy_origin, initial_agent_proposals_enabled, initial_extension_authentication_enabled, - ) = load_policy( + captured_provider_credentials, + ) = load_policy_with_gateway( sandbox_id.clone(), sandbox, openshell_endpoint.clone(), @@ -630,6 +658,10 @@ pub async fn run_sandbox( policy_data, &extension_credentials, LocalPolicyIdentity::Required, + Some(image_discovery), + &RemoteStartupGateway { + endpoint: openshell_endpoint.clone().unwrap_or_default(), + }, ) .await?; @@ -642,7 +674,9 @@ pub async fn run_sandbox( let workspace = workdir; let provider_readiness = ProviderReadinessTracker::new(); - let provider_credentials = { + let provider_credentials = if let Some(credentials) = captured_provider_credentials { + credentials + } else { // Fetch provider environment variables from the server. // This is done after loading the policy so the sandbox can still start // even if provider env fetch fails (graceful degradation). @@ -709,6 +743,9 @@ pub async fn run_sandbox( // snapshot that produced the policy so networking and process setup agree // before the poll loop starts reconciling later changes. let agent_proposals = AgentProposals::new(initial_agent_proposals_enabled); + // Keep the accepted launch generation fixed until the child has actually + // spawned. Live reconciliation must not race its captured policy/env. + let (workload_started_tx, workload_started_rx) = tokio::sync::watch::channel(false); // Shared PID: set after process spawn so the proxy can look up // the entrypoint process's /proc/net/tcp for identity binding. @@ -720,15 +757,6 @@ pub async fn run_sandbox( let admitted_backend_name = admitted_isolation_backend.ok_or_else(|| { miette::miette!("runtime descriptor supplied without an admitted isolation backend") })?; - let runtime_descriptor: openshell_sandbox_backend::boundary_protocol::SandboxRuntimeDescriptor = - serde_json::from_slice(&backend_descriptor.payload) - .map_err(|error| miette::miette!("decode sandbox runtime descriptor: {error}"))?; - if auth_bundle.runtime_generation.as_str() != runtime_descriptor.generation { - return Err(miette::miette!( - "supervisor authentication bundle does not match runtime generation" - )); - } - let sandbox_bearer = openshell_core::grpc_client::install_supervisor_auth_bundle(&auth_bundle)?; let session_id = runtime_descriptor.session_id; let ca_file_paths = Arc::new(std::sync::Mutex::new(None)); let backend: Arc = @@ -1020,6 +1048,10 @@ pub async fn run_sandbox( }; tokio::spawn(async move { + let mut workload_started = workload_started_rx; + if workload_started.wait_for(|started| *started).await.is_err() { + return; + } if let Err(e) = run_policy_poll_loop(poll_ctx).await { ocsf_emit!( AppLifecycleBuilder::new(ocsf_ctx()) @@ -1053,6 +1085,7 @@ pub async fn run_sandbox( .start_agent() .await .map_err(|error| miette::miette!(error.to_string()))?; + workload_started_tx.send_replace(true); info!(backend = %backend_name, "Isolation boundary agent started"); let agent = running.agent(); let boundary_access = openshell_supervisor_process::delegated::start_boundary_access( @@ -2010,6 +2043,18 @@ fn is_retryable_error(err: &miette::Report) -> bool { true } +/// Bound the complete attempt, including connection setup and a pending unary +/// response. Dropping a timed-out future prevents it from stalling startup. +async fn grpc_attempt(op_name: &str, operation: impl Future>) -> Result { + timeout(Duration::from_secs(10), operation) + .await + .map_err(|_| { + openshell_core::grpc_client::grpc_status_error(tonic::Status::deadline_exceeded( + format!("{op_name} timed out after 10 seconds"), + )) + })? +} + /// Retry a gRPC operation with exponential backoff (capped at 4 s). /// /// Non-transient gRPC errors (e.g. `NOT_FOUND`, `INVALID_ARGUMENT`, @@ -2021,7 +2066,7 @@ where { let mut last_err = None; for attempt in 1..=5u32 { - match f().await { + match grpc_attempt(op_name, f()).await { Ok(val) => return Ok(val), Err(e) => { if !is_retryable_error(&e) { @@ -2047,6 +2092,81 @@ where )) } +#[tonic::async_trait] +trait StartupGateway: Send + Sync { + async fn snapshot(&self, id: &str) -> Result; + async fn provider( + &self, + id: &str, + ) -> Result; + async fn sync( + &self, + id: &str, + sandbox: &str, + policy: &openshell_core::proto::SandboxPolicy, + workspace: &str, + ) -> Result; + async fn report( + &self, + id: &str, + instance_id: &str, + snapshot: Option<&openshell_core::grpc_client::SettingsPollResult>, + state: openshell_core::proto::ConfigurationAdmissionState, + error: &str, + ) -> Result<()>; +} + +struct RemoteStartupGateway { + endpoint: String, +} + +#[tonic::async_trait] +impl StartupGateway for RemoteStartupGateway { + async fn snapshot(&self, id: &str) -> Result { + openshell_core::grpc_client::fetch_settings_snapshot(&self.endpoint, id).await + } + async fn provider( + &self, + id: &str, + ) -> Result { + openshell_core::grpc_client::fetch_provider_environment(&self.endpoint, id).await + } + async fn sync( + &self, + id: &str, + sandbox: &str, + policy: &openshell_core::proto::SandboxPolicy, + workspace: &str, + ) -> Result { + openshell_core::grpc_client::sync_policy_and_fetch_snapshot( + &self.endpoint, + id, + sandbox, + policy, + workspace, + ) + .await + } + async fn report( + &self, + id: &str, + instance_id: &str, + snapshot: Option<&openshell_core::grpc_client::SettingsPollResult>, + state: openshell_core::proto::ConfigurationAdmissionState, + error: &str, + ) -> Result<()> { + openshell_core::grpc_client::report_sandbox_configuration( + &self.endpoint, + id, + instance_id, + snapshot, + state, + error, + ) + .await + } +} + /// Load sandbox policy from local files or gRPC. /// /// Priority: @@ -2080,9 +2200,56 @@ async fn load_policy( LoadedPolicyOrigin, bool, bool, + Option, +)> { + load_policy_with_gateway( + sandbox_id, + sandbox, + openshell_endpoint.clone(), + policy_rules, + policy_data, + extension_credentials, + local_policy_identity, + None, + &RemoteStartupGateway { + endpoint: openshell_endpoint.unwrap_or_default(), + }, + ) + .await +} + +#[allow( + clippy::too_many_arguments, + reason = "Startup gateway injection preserves the production policy-loading inputs" +)] +async fn load_policy_with_gateway( + sandbox_id: Option, + sandbox: Option, + openshell_endpoint: Option, + policy_rules: Option, + policy_data: Option, + extension_credentials: &openshell_extension_core::ExtensionCredentialStore, + local_policy_identity: LocalPolicyIdentity, + image_discovery: Option, + gateway: &impl StartupGateway, +) -> Result<( + SandboxPolicy, + Option>, + Option, + MiddlewareRegistryStatus, + LoadedPolicyOrigin, + bool, + bool, + Option, )> { + use openshell_core::proto::ConfigurationAdmissionState; // File mode: load OPA engine from rego rules + YAML data (dev override) if let (Some(policy_file), Some(data_file)) = (&policy_rules, &policy_data) { + if sandbox_id.is_some() && openshell_endpoint.is_some() { + return Err(miette::miette!( + "Local policy overrides cannot be combined with gateway-managed activation; replace the sandbox policy through the gateway" + )); + } ocsf_emit!(ConfigStateChangeBuilder::new(ocsf_ctx()) .severity(SeverityId::Informational) .status(StatusId::Success) @@ -2139,6 +2306,7 @@ async fn load_policy( LoadedPolicyOrigin::LocalOverride, false, false, + None, )); } @@ -2149,156 +2317,208 @@ async fn load_policy( endpoint = %endpoint, "Fetching sandbox policy via gRPC" ); - let mut snapshot = grpc_retry("Policy fetch", || { - openshell_core::grpc_client::fetch_settings_snapshot(endpoint, id) + let instance_id = uuid::Uuid::new_v4().to_string(); + // Capture the previous instance once. Registration retries must never + // rebase this fence and displace a newer supervisor instance. + let registration_snapshot = + grpc_retry("Startup configuration fetch", || gateway.snapshot(id)).await?; + grpc_retry("Supervisor registration", || { + gateway.report( + id, + &instance_id, + Some(®istration_snapshot), + ConfigurationAdmissionState::Pending, + "", + ) }) .await?; - - let mut proto_policy = if let Some(p) = snapshot.policy.clone() { - p - } else { - // No policy configured on the server. Discover from disk or - // fall back to the restrictive default, then sync to the - // gateway so it becomes the authoritative baseline. - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Informational) - .status(StatusId::Success) - .state(StateId::Other, "discovery") - .message("Server returned no policy; attempting local discovery") - .build() - ); - let mut discovered = discover_policy_from_disk_or_default(); - // Enrich before syncing so the gateway baseline includes - // baseline paths from the start. - enrich_proto_baseline_paths(&mut discovered); - strip_proto_provider_policy_entries(&mut discovered); - let sandbox = sandbox.as_deref().ok_or_else(|| { - miette::miette!( - "Cannot sync discovered policy: sandbox not available.\n\ - Set OPENSHELL_SANDBOX or --sandbox to enable policy sync." - ) - })?; - - // Sync and re-fetch over a single connection to avoid extra - // TLS handshakes. - let ws = snapshot.workspace.clone(); - snapshot = grpc_retry("Policy discovery sync", || { - openshell_core::grpc_client::sync_policy_and_fetch_snapshot( - endpoint, + let discovery = image_discovery.unwrap_or_else(discover_image_policy); + let mut reconciliation_attempts = 0u32; + let mut rejection_log = StartupRejectionLog::default(); + loop { + if reconciliation_attempts == 5 { + return Err(miette::miette!( + "Startup configuration did not stabilize after 5 attempts" + )); + } + reconciliation_attempts += 1; + let mut snapshot = + grpc_retry("Startup configuration fetch", || gateway.snapshot(id)).await?; + + if snapshot.policy.is_none() && !snapshot.configuration_error.is_empty() { + reject_startup_configuration( + gateway, + &mut rejection_log, id, - sandbox, - &discovered, - &ws, + &instance_id, + &snapshot, + &snapshot.configuration_error, ) - }) - .await?; - snapshot.policy.clone().ok_or_else(|| { - miette::miette!("Server still returned no policy after sync — this is a bug") - })? - }; + .await?; + reconciliation_attempts = 0; + continue; + } - // True only while `snapshot` describes the exact policy that will be - // constructed below. If enrichment cannot be synced and re-fetched, - // the policy remains enforceable but cannot be acknowledged by - // inferred structural equality. - let mut policy_bound_to_snapshot = true; - - // Ensure baseline filesystem paths are present for proxy-mode - // sandboxes. If the policy was enriched, sync the updated version - // back to the gateway so users can see the effective policy. - let enriched = enrich_proto_baseline_paths(&mut proto_policy); - let sync_policy = proto_sync_payload_for_enriched_policy(&proto_policy, enriched); - if let Some(sync_policy) = sync_policy { - if let Some(sandbox_name) = sandbox.as_deref() { - match openshell_core::grpc_client::sync_policy_and_fetch_snapshot( - endpoint, - id, - sandbox_name, - &sync_policy, - &snapshot.workspace, - ) - .await - { - Ok(canonical) => { - if let Some(policy) = canonical.policy.clone() { - proto_policy = policy; - snapshot = canonical; - } else { - policy_bound_to_snapshot = false; - warn!( - "Gateway returned no policy after enrichment sync; initial revision will be reconciled" - ); - } + let mut proto_policy = if let Some(p) = snapshot.policy.clone() { + p + } else { + // No policy configured on the server. Discover from disk or + // fall back to the restrictive default, then sync to the + // gateway so it becomes the authoritative baseline. + ocsf_emit!( + ConfigStateChangeBuilder::new(ocsf_ctx()) + .severity(SeverityId::Informational) + .status(StatusId::Success) + .state(StateId::Other, "discovery") + .message("Server returned no policy; attempting local discovery") + .build() + ); + let mut discovered = match &discovery { + ImagePolicyDiscovery::Policy(policy) => *policy.clone(), + ImagePolicyDiscovery::Missing => openshell_policy::restrictive_default_policy(), + ImagePolicyDiscovery::Invalid => { + reject_startup_configuration(gateway, &mut rejection_log, id, &instance_id, &snapshot, "Image policy is invalid; replace the sandbox policy to repair configuration").await?; + reconciliation_attempts = 0; + continue; } - Err(e) => { - policy_bound_to_snapshot = false; - warn!( - error = %e, - "Failed to sync enriched policy back to gateway; initial revision will be reconciled" - ); + }; + // Enrich before syncing so the gateway baseline includes + // baseline paths from the start. + enrich_proto_baseline_paths(&mut discovered); + strip_proto_provider_policy_entries(&mut discovered); + let sandbox = sandbox.as_deref().ok_or_else(|| { + miette::miette!( + "Cannot sync discovered policy: sandbox not available.\n\ + Set OPENSHELL_SANDBOX or --sandbox to enable policy sync." + ) + })?; + + // Sync and re-fetch over a single connection to avoid extra + // TLS handshakes. + let ws = snapshot.workspace.clone(); + snapshot = grpc_retry("Image policy synchronization", || { + gateway.sync(id, sandbox, &discovered, &ws) + }) + .await?; + if let Some(policy) = snapshot.policy.clone() { + policy + } else { + if snapshot.configuration_error.is_empty() { + return Err(miette::miette!( + "Gateway returned no effective policy after image discovery" + )); } + reject_startup_configuration( + gateway, + &mut rejection_log, + id, + &instance_id, + &snapshot, + "Effective policy is unavailable after image discovery", + ) + .await?; + reconciliation_attempts = 0; + continue; + } + }; + + // Ensure baseline filesystem paths are present for proxy-mode + // sandboxes. If the policy was enriched, sync the updated version + // back to the gateway so users can see the effective policy. + let enriched = enrich_proto_baseline_paths(&mut proto_policy); + let sync_policy = proto_sync_payload_for_enriched_policy(&proto_policy, enriched); + if let Some(sync_policy) = sync_policy { + if let Some(sandbox_name) = sandbox.as_deref() { + let canonical = grpc_retry("Enriched policy synchronization", || { + gateway.sync(id, sandbox_name, &sync_policy, &snapshot.workspace) + }) + .await?; + proto_policy = canonical.policy.clone().ok_or_else(|| { + miette::miette!("Gateway returned no effective policy after enrichment") + })?; + snapshot = canonical; + } else { + return Err(miette::miette!( + "Cannot sync enriched policy: sandbox name is unavailable" + )); } - } else { - policy_bound_to_snapshot = false; } - } - let mut loaded_policy_revision = - policy_bound_to_snapshot.then(|| LoadedPolicyRevision::from_snapshot(&snapshot)); - - // Build OPA engine from baked-in rules + typed proto data. - // In cluster mode, proxy networking is always enabled so OPA is - // always required for allow/deny decisions. - // The initial load uses pid=0 (no symlink resolution) because the - // container hasn't started yet. After the entrypoint spawns, the - // engine is rebuilt with the real PID for symlink resolution. - info!("Creating OPA engine from proto policy data"); - let mut has_last_valid_policy = true; - let engine = match OpaEngine::from_proto(&proto_policy) { - Ok(engine) => Arc::new(engine), - Err(e) => { - report_initial_policy_failure(endpoint, id, loaded_policy_revision.as_ref(), &e) + let loaded_policy_revision = Some({ + let mut revision = LoadedPolicyRevision::from_snapshot(&snapshot); + revision.admission_instance_id = Some(instance_id.clone()); + revision + }); + + // Build OPA engine from baked-in rules + typed proto data. + // In cluster mode, proxy networking is always enabled so OPA is + // always required for allow/deny decisions. + // The initial load uses pid=0 (no symlink resolution) because the + // container hasn't started yet. After the entrypoint spawns, the + // engine is rebuilt with the real PID for symlink resolution. + let has_last_valid_policy = true; + if !snapshot.configuration_admitted { + reject_startup_configuration( + gateway, + &mut rejection_log, + id, + &instance_id, + &snapshot, + if snapshot.configuration_error.is_empty() { + "Effective configuration was rejected by admission" + } else { + &snapshot.configuration_error + }, + ) + .await?; + reconciliation_attempts = 0; + continue; + } + let provider = + grpc_retry("Startup provider environment", || gateway.provider(id)).await?; + if provider.provider_env_revision != snapshot.provider_env_revision { + tokio::time::sleep(Duration::from_secs(1u64 << reconciliation_attempts.min(2))) .await; - let validation_error = e.to_string(); - let candidate_version = snapshot.version; - let candidate_hash = snapshot.policy_hash.clone(); - // There is no in-memory last-known-good generation during - // startup, so both configured modes necessarily fail closed. - // Load the restrictive default atomically and keep the - // rejected revision unacknowledged for poll reconciliation. - has_last_valid_policy = false; - proto_policy = openshell_policy::restrictive_default_policy(); - let engine = Arc::new(OpaEngine::from_proto(&proto_policy)?); - let disposition = apply_policy_validation_failure( - &engine, - snapshot.policy_validation_failure_mode, - has_last_valid_policy, - candidate_version, - &validation_error, - )?; - emit_policy_validation_failure( - &disposition, - candidate_version, - &candidate_hash, - &validation_error, - ); - loaded_policy_revision = None; - engine + continue; } - }; - - // Install the in-process catalog before any external connection can - // fail. A newly started sandbox must always be able to resolve built-in - // bindings, even while operator-run services are unavailable. - install_builtin_middleware_registry(&engine).await?; - - // Connect operator-registered middleware services. A connect/describe - // failure keeps the built-in registry active so each request's - // `on_error` policy governs matched traffic. The policy poll loop - // retries the install without waiting for a config change. - let middleware_services = snapshot.supervisor_middleware_services.clone(); - let middleware_registry_status = if middleware_services.is_empty() { + debug!("Creating OPA engine from proto policy data"); + let (engine, policy, captured_provider_credentials) = + match prepare_startup_configuration(&snapshot, &proto_policy, &provider) { + Ok(prepared) => prepared, + Err(error) => { + report_initial_policy_failure( + endpoint, + id, + loaded_policy_revision.as_ref(), + &error, + ) + .await; + reject_startup_configuration( + gateway, + &mut rejection_log, + id, + &instance_id, + &snapshot, + "Policy or provider environment failed runtime validation", + ) + .await?; + reconciliation_attempts = 0; + continue; + } + }; + let engine = Arc::new(engine); + + // Install the in-process catalog before any external connection can + // fail. A newly started sandbox must always be able to resolve built-in + // bindings, even while operator-run services are unavailable. + install_builtin_middleware_registry(&engine).await?; + + // Connect operator-registered middleware services. A connect/describe + // failure keeps the built-in registry active so each request's + // `on_error` policy governs matched traffic. The policy poll loop + // retries the install without waiting for a config change. + let middleware_services = snapshot.supervisor_middleware_services.clone(); + let middleware_registry_status = if middleware_services.is_empty() { MiddlewareRegistryStatus::Synchronized } else if let Err(error) = grpc_retry("Middleware connect", || { let middleware_services = middleware_services.clone(); @@ -2349,28 +2569,54 @@ async fn load_policy( } else { MiddlewareRegistryStatus::Synchronized }; - let opa_engine = Some(engine); - - let policy = match SandboxPolicy::try_from(proto_policy.clone()) { - Ok(policy) => policy, - Err(e) => { - report_initial_policy_failure(endpoint, id, loaded_policy_revision.as_ref(), &e) + let opa_engine = Some(engine); + + // The gateway compares the entire tuple again. A concurrent repair or + // provider rotation invalidates this candidate before any workload + // identity, child environment or services are captured. + if let Err(error) = grpc_attempt( + "Startup acceptance report", + gateway.report( + id, + &instance_id, + Some(&snapshot), + ConfigurationAdmissionState::Accepted, + "", + ), + ) + .await + { + if !is_retryable_error(&error) { + return Err(error); + } + tokio::time::sleep(Duration::from_secs(1u64 << reconciliation_attempts.min(2))) .await; - return Err(e); + continue; } - }; - return Ok(( - policy, - opa_engine, - Some(proto_policy), - middleware_registry_status, - LoadedPolicyOrigin::Gateway { - revision: loaded_policy_revision, - has_last_valid_policy, - }, - agent_proposals_enabled_from_settings(&snapshot.settings), - snapshot.extension_authentication_enabled, - )); + if rejection_log.0.is_some() { + ocsf_emit!( + ConfigStateChangeBuilder::new(ocsf_ctx()) + .severity(SeverityId::Informational) + .status(StatusId::Success) + .state(StateId::Other, "configuration_recovered") + .message("Startup configuration repaired and accepted") + .build() + ); + } + return Ok(( + policy, + opa_engine, + Some(proto_policy), + middleware_registry_status, + LoadedPolicyOrigin::Gateway { + revision: loaded_policy_revision, + has_last_valid_policy, + }, + agent_proposals_enabled_from_settings(&snapshot.settings), + snapshot.extension_authentication_enabled, + Some(captured_provider_credentials), + )); + } } // No policy source available @@ -2381,112 +2627,133 @@ async fn load_policy( )) } -/// Try to discover a sandbox policy from the well-known disk path, falling -/// back to the legacy path, then to the hardcoded restrictive default. -fn discover_policy_from_disk_or_default() -> openshell_core::proto::SandboxPolicy { - let primary = std::path::Path::new(openshell_policy::CONTAINER_POLICY_PATH); - if primary.exists() { - return discover_policy_from_path(primary); +/// Capture the policy from the workload filesystem, preserving invalid input +/// as a repairable error instead of silently substituting another policy. +#[derive(Clone, Debug)] +enum ImagePolicyDiscovery { + Missing, + Invalid, + Policy(Box), +} + +fn discover_image_policy() -> ImagePolicyDiscovery { + for path in [ + openshell_policy::CONTAINER_POLICY_PATH, + openshell_policy::LEGACY_CONTAINER_POLICY_PATH, + ] { + match discover_image_policy_from_path(std::path::Path::new(path)) { + ImagePolicyDiscovery::Missing => {} + discovered => return discovered, + } } - let legacy = std::path::Path::new(openshell_policy::LEGACY_CONTAINER_POLICY_PATH); - if legacy.exists() { - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Informational) - .status(StatusId::Success) - .state(StateId::Enabled, "loaded") - .unmapped( - "legacy_path", - serde_json::json!(legacy.display().to_string()) - ) - .unmapped("new_path", serde_json::json!(primary.display().to_string())) - .message(format!( - "Policy found at legacy path; consider moving [legacy_path:{} new_path:{}]", - legacy.display(), - primary.display() - )) - .build() - ); - return discover_policy_from_path(legacy); + ImagePolicyDiscovery::Missing +} + +fn discover_image_policy_from_path(path: &std::path::Path) -> ImagePolicyDiscovery { + if matches!(path.try_exists(), Ok(false)) { + return ImagePolicyDiscovery::Missing; } - discover_policy_from_path(primary) + openshell_policy::parse_sandbox_policy_file(path) + .map_or(ImagePolicyDiscovery::Invalid, |policy| { + ImagePolicyDiscovery::Policy(Box::new(policy)) + }) } -/// Try to read a sandbox policy YAML from `path`, falling back to the -/// hardcoded restrictive default if the file is missing or invalid. -fn discover_policy_from_path(path: &std::path::Path) -> openshell_core::proto::SandboxPolicy { - use openshell_policy::{ - parse_sandbox_policy_file, restrictive_default_policy, validate_sandbox_policy, - }; +/// Everything here is preparation: it cannot mutate an accepted generation. +fn prepare_startup_configuration( + snapshot: &openshell_core::grpc_client::SettingsPollResult, + policy: &openshell_core::proto::SandboxPolicy, + provider: &openshell_core::grpc_client::ProviderEnvironmentResult, +) -> Result<(OpaEngine, SandboxPolicy, ProviderCredentialState)> { + if !snapshot.configuration_admitted { + return Err(miette::miette!( + "Effective configuration admission rejected" + )); + } + if provider.readiness_reason != ProviderReadinessReason::Unspecified { + return Err(miette::miette!( + "Provider credentials are not ready for installation" + )); + } + if snapshot.provider_env_revision != provider.provider_env_revision { + return Err(miette::miette!( + "Provider environment revision changed during configuration preparation" + )); + } + let engine = OpaEngine::from_proto(policy)?; + let process_policy = SandboxPolicy::try_from(policy.clone())?; + let credentials = prepare_provider_environment(provider)?; + Ok((engine, process_policy, credentials)) +} + +fn prepare_provider_environment( + provider: &openshell_core::grpc_client::ProviderEnvironmentResult, +) -> Result { + ProviderCredentialState::from_bound_environment( + provider.provider_env_revision, + provider.environment.clone(), + provider.credential_expires_at_ms.clone(), + provider.dynamic_credentials.clone(), + provider.static_credential_bindings.clone(), + provider.non_secret_environment_keys.clone(), + ) + .map_err(|_| miette::miette!("Provider credential bindings are invalid")) +} + +// Retain only the most recent rejection, so A -> B -> A emits all transitions. +#[derive(Default)] +struct StartupRejectionLog(Option<(LoadedPolicyRevision, String)>); + +impl StartupRejectionLog { + fn changed( + &mut self, + snapshot: &openshell_core::grpc_client::SettingsPollResult, + error: &str, + ) -> bool { + let rejection = ( + LoadedPolicyRevision::from_snapshot(snapshot), + error.to_owned(), + ); + if self.0.as_ref() == Some(&rejection) { + return false; + } + self.0 = Some(rejection); + true + } +} - if !path.exists() { +async fn reject_startup_configuration( + gateway: &impl StartupGateway, + rejection_log: &mut StartupRejectionLog, + sandbox_id: &str, + instance_id: &str, + snapshot: &openshell_core::grpc_client::SettingsPollResult, + error: &str, +) -> Result<()> { + grpc_retry("Startup rejection report", || { + gateway.report( + sandbox_id, + instance_id, + Some(snapshot), + openshell_core::proto::ConfigurationAdmissionState::Rejected, + error, + ) + }) + .await?; + // Keep reporting readiness on every retry, but log only changed rejections. + // Fixed, bounded diagnostics deliberately omit the candidate and credentials. + if rejection_log.changed(snapshot, error) { ocsf_emit!( ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Informational) - .status(StatusId::Success) - .state(StateId::Enabled, "default") - .message(format!( - "No policy file on disk, using restrictive default [path:{}]", - path.display() - )) + .severity(SeverityId::High) + .status(StatusId::Failure) + .state(StateId::Disabled, "configuration_error") + .message(error) .build() ); - return restrictive_default_policy(); - } - match parse_sandbox_policy_file(path) { - Ok(policy) => { - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Informational) - .status(StatusId::Success) - .state(StateId::Enabled, "loaded") - .message(format!( - "Loaded sandbox policy from container disk [path:{}]", - path.display() - )) - .build() - ); - // Validate the disk-loaded policy for safety. - if let Err(violations) = validate_sandbox_policy(&policy) { - let messages: Vec = violations.iter().map(ToString::to_string).collect(); - ocsf_emit!(DetectionFindingBuilder::new(ocsf_ctx()) - .activity(ActivityId::Open) - .severity(SeverityId::Medium) - .action(ActionId::Denied) - .disposition(DispositionId::Blocked) - .finding_info( - FindingInfo::new( - "unsafe-disk-policy", - "Unsafe Disk Policy Content", - ) - .with_desc(&format!( - "Disk policy at {} contains unsafe content: {}", - path.display(), - messages.join("; "), - )), - ) - .message(format!( - "Disk policy contains unsafe content, using restrictive default [path:{}]", - path.display() - )) - .build()); - return restrictive_default_policy(); - } - policy - } - Err(e) => { - ocsf_emit!(ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Medium) - .status(StatusId::Failure) - .state(StateId::Other, "fallback") - .message(format!( - "Failed to parse disk policy, using restrictive default [path:{} error:{e}]", - path.display() - )) - .build()); - restrictive_default_policy() - } } + tokio::time::sleep(Duration::from_secs(2)).await; + Ok(()) } #[derive(Clone, Copy, Debug, PartialEq, Eq)] @@ -2545,12 +2812,32 @@ struct MiddlewareReloadContext<'a> { connector: &'a MiddlewareConnector, } +#[cfg(test)] async fn reload_gateway_policy_runtime( engine: &OpaEngine, policy: Option<&openshell_core::proto::SandboxPolicy>, entrypoint_pid: u32, middleware: MiddlewareReloadContext<'_>, transparent_tcp: TransparentTcpReloadState, +) -> std::result::Result { + reload_gateway_configuration_runtime( + engine, + policy, + entrypoint_pid, + middleware, + transparent_tcp, + || {}, + ) + .await +} + +async fn reload_gateway_configuration_runtime( + engine: &OpaEngine, + policy: Option<&openshell_core::proto::SandboxPolicy>, + entrypoint_pid: u32, + middleware: MiddlewareReloadContext<'_>, + transparent_tcp: TransparentTcpReloadState, + commit_credentials: impl FnOnce(), ) -> std::result::Result { if let Some(policy) = policy && policy_contains_explicit_tcp(policy) @@ -2579,14 +2866,24 @@ async fn reload_gateway_policy_runtime( .await .map_err(GatewayRuntimeReloadError::MiddlewareRegistry)?; engine - .reload_policy_and_middleware_from_proto_with_pid(policy, entrypoint_pid, registry) + .reload_configuration_from_proto_with_pid( + policy, + entrypoint_pid, + Some(registry), + commit_credentials, + ) .map_err(GatewayRuntimeReloadError::PolicyValidation) } // Policy-only change: the installed registry already matches the // delivered service set, so swap the engine alone. This must not // require middleware reachability. Some(policy) => engine - .reload_from_proto_with_pid(policy, entrypoint_pid) + .reload_configuration_from_proto_with_pid( + policy, + entrypoint_pid, + None, + commit_credentials, + ) .map_err(GatewayRuntimeReloadError::PolicyValidation), None => Err(GatewayRuntimeReloadError::PolicyValidation( miette::miette!("runtime reload requires a policy payload but none was returned"), @@ -2648,6 +2945,8 @@ struct LoadedPolicyRevision { policy_hash: String, config_revision: u64, policy_source: openshell_core::proto::PolicySource, + admission_instance_id: Option, + provider_env_revision: u64, } /// Identifies where the policy currently loaded into OPA came from. @@ -2690,6 +2989,8 @@ impl LoadedPolicyRevision { policy_hash: snapshot.policy_hash.clone(), config_revision: snapshot.config_revision, policy_source: snapshot.policy_source, + admission_instance_id: None, + provider_env_revision: snapshot.provider_env_revision, } } } @@ -2777,6 +3078,11 @@ fn initial_policy_ack_candidate( canonical: &openshell_core::grpc_client::SettingsPollResult, ) -> Option { let loaded = loaded?; + if !canonical.configuration_admitted + || canonical.provider_env_revision != loaded.provider_env_revision + { + return None; + } if loaded.policy_source != openshell_core::proto::PolicySource::Sandbox || canonical.policy_source != openshell_core::proto::PolicySource::Sandbox { @@ -3595,6 +3901,49 @@ fn emit_policy_validation_failure( } } +async fn report_runtime_configuration( + ctx: &PolicyPollLoopContext, + snapshot: &openshell_core::grpc_client::SettingsPollResult, + accepted: bool, + error: &str, +) -> bool { + let LoadedPolicyOrigin::Gateway { + revision: Some(revision), + .. + } = &ctx.loaded_policy_origin + else { + return true; + }; + let Some(instance_id) = revision.admission_instance_id.as_deref() else { + return true; + }; + let state = if accepted { + openshell_core::proto::ConfigurationAdmissionState::Accepted + } else { + openshell_core::proto::ConfigurationAdmissionState::Rejected + }; + if !accepted { + ocsf_emit!( + ConfigStateChangeBuilder::new(ocsf_ctx()) + .severity(SeverityId::High) + .status(StatusId::Failure) + .state(StateId::Other, "configuration_error") + .message(error) + .build() + ); + } + openshell_core::grpc_client::report_sandbox_configuration( + &ctx.endpoint, + &ctx.sandbox_id, + instance_id, + Some(snapshot), + state, + error, + ) + .await + .is_ok() +} + async fn run_policy_poll_loop(ctx: PolicyPollLoopContext) -> Result<()> { let client = openshell_core::grpc_client::CachedOpenShellClient::connect_with_credentials( &ctx.endpoint, @@ -3785,6 +4134,30 @@ async fn run_policy_poll_loop_with_client( std::collections::HashMap::new() }; + if reloads_gateway_policy && !result.configuration_admitted { + let disposition = apply_policy_validation_failure( + &ctx.opa_engine, + result.policy_validation_failure_mode, + has_last_valid_policy, + result.version, + &result.configuration_error, + )?; + emit_policy_validation_failure( + &disposition, + result.version, + &result.policy_hash, + &result.configuration_error, + ); + rejected_policy_generation = Some(RejectedPolicyGeneration { + version: result.version, + policy_hash: result.policy_hash.clone(), + validation_error: result.configuration_error.clone(), + configured_mode: result.policy_validation_failure_mode, + }); + report_runtime_configuration(&ctx, &result, false, &result.configuration_error).await; + continue; + } + let config_changed = result.config_revision != current_config_revision; let desired_identity = EnvironmentIdentity::from_settings(&result); let provider_env_changed = result.provider_env_revision != current_provider_env_revision @@ -3803,14 +4176,14 @@ async fn run_policy_poll_loop_with_client( // equals `current_policy_hash`, but the runtime is still quarantined // and must reload (or it would remain deny-all indefinitely). let recovering_rejected_policy = reloads_gateway_policy - && rejected_policy_generation - .as_ref() - .is_some_and(|rejected| rejected.policy_hash != result.policy_hash); - let policy_runtime_changed = recovering_rejected_policy - || (reloads_gateway_policy - && current_policy_generation + && rejected_policy_generation.is_some() + && result.configuration_admitted; + let policy_runtime_changed = (reloads_gateway_policy + && (provider_env_changed + || current_policy_generation .as_ref() - .is_some_and(PolicyGenerationGuard::is_stale)) + .is_some_and(PolicyGenerationGuard::is_stale))) + || recovering_rejected_policy || extension_authentication_changed || gateway_policy_runtime_needs_reconciliation( reloads_gateway_policy, @@ -3909,108 +4282,117 @@ async fn run_policy_poll_loop_with_client( .build()); } - if provider_env_changed { + // Prepare the matching environment before activation. Failed refreshes + // revoke static credentials while preserving independently bound dynamic grants. + let mut prepared_identity = None; + let prepared_provider = if provider_env_changed { ctx.provider_readiness.credentials_failed( desired_identity.clone(), ProviderReadinessReason::WaitingForCredentials, ); - match client + let provider = match client .fetch_provider_environment(&ctx.endpoint, &ctx.sandbox_id) .await { - Ok(env_result) => { - let identity = EnvironmentIdentity::from_environment(&env_result); - let expires_at_ms = env_result - .credential_expires_at_ms - .values() - .copied() - .filter(|expiry| *expiry > 0) - .min(); - if env_result.readiness_reason == ProviderReadinessReason::Unspecified { - let provider_env_revision = env_result.provider_env_revision; - let install_result = ctx.provider_credentials.install_bound_environment( - provider_env_revision, - env_result.environment, - env_result.credential_expires_at_ms, - env_result.dynamic_credentials, - env_result.static_credential_bindings, - env_result.non_secret_environment_keys, - ); - if let Err(error) = install_result { - ctx.provider_readiness.credentials_failed( - identity, - ProviderReadinessReason::CredentialInstallFailed, - ); - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::High) - .status(StatusId::Failure) - .state(StateId::Disabled, "fail_closed") - .message(format!( - "Rejected provider environment refresh; static provider credentials were revoked; fetched dynamic token grants remain active: {error}" - )) - .build() - ); - } else { - ctx.provider_readiness.credentials_installed( - identity, - &ctx.provider_credentials, - expires_at_ms, - ); - let env_count = - ctx.provider_credentials.child_env_with_gcp_resolved().len(); - current_provider_env_revision = provider_env_revision; - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::Informational) - .status(StatusId::Success) - .state(StateId::Enabled, "loaded") - .unmapped( - "provider_env_revision", - serde_json::json!(provider_env_revision) - ) - .message(format!( - "Provider environment refreshed [revision:{provider_env_revision} env_count:{env_count}]" - )) - .build() - ); - } - } else { - ctx.provider_credentials - .revoke_static_provider_environment(env_result.provider_env_revision); - ctx.provider_readiness - .credentials_failed(identity, env_result.readiness_reason); - } + Ok(provider) + if EnvironmentIdentity::from_environment(&provider) == desired_identity + && provider.readiness_reason == ProviderReadinessReason::Unspecified => + { + provider } - Err(e) => { - ctx.provider_readiness.credentials_failed( - desired_identity.clone(), - ProviderReadinessReason::CredentialInstallFailed, - ); + failed => { + let reason = match failed { + Ok(provider) + if provider.readiness_reason + != ProviderReadinessReason::Unspecified => + { + provider.readiness_reason + } + Ok(_) => ProviderReadinessReason::SnapshotMismatch, + Err(_) => ProviderReadinessReason::CredentialInstallFailed, + }; + ctx.provider_readiness + .credentials_failed(desired_identity.clone(), reason); + ocsf_emit!(ConfigStateChangeBuilder::new(ocsf_ctx()) + .severity(SeverityId::High) + .status(StatusId::Failure) + .state(StateId::Disabled, "fail_closed") + .message("Provider environment refresh failed; static credentials were revoked and previous dynamic grants remain active") + .build()); ctx.provider_credentials .revoke_static_provider_environment(result.provider_env_revision); - warn!( - error = %e, - provider_env_revision = result.provider_env_revision, - "Settings poll: failed to refresh provider environment; static provider credentials were revoked; previous dynamic token grants remain active" - ); - ocsf_emit!( - ConfigStateChangeBuilder::new(ocsf_ctx()) - .severity(SeverityId::High) - .status(StatusId::Failure) - .state(StateId::Disabled, "fail_closed") - .message( - "Provider environment refresh failed; static provider credentials were revoked; previous dynamic token grants remain active" - ) - .build() - ); + endpoint_status::reset( + ctx.endpoint_observation_tx.as_ref(), + current_endpoint_policy.as_ref(), + ¤t_policy_hash, + result.provider_env_revision, + ) + .await; + report_runtime_configuration( + &ctx, + &result, + false, + "Provider environment is unavailable or changed during preparation", + ) + .await; + continue; } + }; + if let Ok(prepared) = prepare_provider_environment(&provider) { + prepared_identity = Some(( + EnvironmentIdentity::from_environment(&provider), + provider + .credential_expires_at_ms + .values() + .copied() + .filter(|expiry| *expiry > 0) + .min(), + )); + Some(prepared) + } else { + ocsf_emit!(ConfigStateChangeBuilder::new(ocsf_ctx()) + .severity(SeverityId::High) + .status(StatusId::Failure) + .state(StateId::Disabled, "fail_closed") + .message("Provider environment bindings failed validation; static credentials were revoked and fetched dynamic grants remain active") + .build()); + ctx.provider_readiness.credentials_failed( + desired_identity.clone(), + ProviderReadinessReason::CredentialInstallFailed, + ); + // Repeat the rejected binding validation on the live state to + // revoke static material and retain the fetched dynamic grants. + let _ = ctx.provider_credentials.install_bound_environment( + provider.provider_env_revision, + provider.environment, + provider.credential_expires_at_ms, + provider.dynamic_credentials, + provider.static_credential_bindings, + provider.non_secret_environment_keys, + ); + endpoint_status::reset( + ctx.endpoint_observation_tx.as_ref(), + current_endpoint_policy.as_ref(), + ¤t_policy_hash, + result.provider_env_revision, + ) + .await; + report_runtime_configuration( + &ctx, + &result, + false, + "Provider environment bindings failed validation", + ) + .await; + continue; } - } + } else { + None + }; if policy_runtime_changed { let pid = ctx.entrypoint_pid.load(Ordering::Acquire); - let runtime_result = reload_gateway_policy_runtime( + let runtime_result = reload_gateway_configuration_runtime( &ctx.opa_engine, result.policy.as_ref(), pid, @@ -4024,12 +4406,24 @@ async fn run_policy_poll_loop_with_client( connector: &ctx.middleware_connector, }, ctx.transparent_tcp, + || { + if let Some(prepared) = prepared_provider.as_ref() { + ctx.provider_credentials.install_prepared(prepared); + } + }, ) .await; match runtime_result { Ok(generation) => { policy_runtime_reconciled = true; + if let Some((identity, expires_at_ms)) = prepared_identity.as_ref() { + ctx.provider_readiness.credentials_installed( + identity.clone(), + &ctx.provider_credentials, + *expires_at_ms, + ); + } ctx.provider_readiness.policy_activated( &desired_identity, result.config_revision, @@ -4220,6 +4614,24 @@ async fn run_policy_poll_loop_with_client( } } + if policy_runtime_changed && !policy_runtime_reconciled { + report_runtime_configuration(&ctx, &result, false, "Effective configuration failed runtime preparation; prior credentials remain installed").await; + continue; + } + if !reloads_gateway_policy && let Some(prepared) = prepared_provider.as_ref() { + ctx.provider_credentials.install_prepared(prepared); + if let Some((identity, expires_at_ms)) = prepared_identity.as_ref() { + ctx.provider_readiness.credentials_installed( + identity.clone(), + &ctx.provider_credentials, + *expires_at_ms, + ); + } + } + if provider_env_changed || policy_runtime_reconciled { + current_provider_env_revision = result.provider_env_revision; + } + if let Some(version) = unchanged_policy_revision_ready_to_ack( unchanged_policy_revision, policy_runtime_changed, @@ -4275,6 +4687,11 @@ async fn run_policy_poll_loop_with_client( skills::install_static_skills, ); + if !report_runtime_configuration(&ctx, &result, true, "").await { + // Retry the exact status tuple on the next poll before advancing + // the observed revision; an old instance cannot claim readiness. + continue; + } current_config_revision = result.config_revision; if !reloads_gateway_policy { current_policy_hash = result.policy_hash; @@ -4656,15 +5073,12 @@ mod tests { // ---- Policy disk discovery tests ---- #[test] - fn discover_policy_from_nonexistent_path_returns_restrictive_default() { + fn discover_policy_from_nonexistent_path_is_missing() { let path = std::path::Path::new("/nonexistent/policy.yaml"); - let policy = discover_policy_from_path(path); - // Restrictive default has no network policies. - assert!(policy.network_policies.is_empty()); - // It keeps filesystem restrictions while leaving identity to the - // active compute driver. - assert!(policy.filesystem.is_some()); - assert!(policy.process.is_none()); + assert!(matches!( + discover_image_policy_from_path(path), + ImagePolicyDiscovery::Missing + )); } #[test] @@ -4692,7 +5106,9 @@ network_policies: ) .unwrap(); - let policy = discover_policy_from_path(&path); + let ImagePolicyDiscovery::Policy(policy) = discover_image_policy_from_path(&path) else { + panic!("expected parsed policy") + }; assert_eq!(policy.network_policies.len(), 1); assert!(policy.network_policies.contains_key("test")); let fs = policy.filesystem.unwrap(); @@ -4700,34 +5116,31 @@ network_policies: } #[test] - fn discover_policy_from_invalid_yaml_returns_restrictive_default() { + fn discover_policy_from_invalid_yaml_remains_invalid() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("policy.yaml"); std::fs::write(&path, "this is not valid yaml: [[[").unwrap(); - let policy = discover_policy_from_path(&path); - // Falls back to restrictive default. - assert!(policy.network_policies.is_empty()); - assert!(policy.filesystem.is_some()); + assert!(matches!( + discover_image_policy_from_path(&path), + ImagePolicyDiscovery::Invalid + )); } #[test] - fn discover_policy_from_oversized_file_returns_restrictive_default() { + fn discover_policy_from_oversized_file_remains_invalid() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("policy.yaml"); let oversized = format!("version: 1\n{}", " ".repeat(4 * 1024 * 1024)); std::fs::write(&path, oversized).unwrap(); - - let policy = discover_policy_from_path(&path); - assert!(policy.network_policies.is_empty()); - assert!( - policy.filesystem.is_some(), - "an oversized otherwise-valid policy must fall back instead of parsing" - ); + assert!(matches!( + discover_image_policy_from_path(&path), + ImagePolicyDiscovery::Invalid + )); } #[test] - fn discover_policy_from_unsafe_yaml_falls_back_to_default() { + fn discover_policy_from_unsafe_yaml_preserves_candidate_for_admission() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("policy.yaml"); std::fs::write( @@ -4747,9 +5160,10 @@ filesystem_policy: ) .unwrap(); - let policy = discover_policy_from_path(&path); - // Falls back to restrictive default because of root user. - assert!(policy.process.is_none()); + let ImagePolicyDiscovery::Policy(policy) = discover_image_policy_from_path(&path) else { + panic!("expected parsed policy") + }; + assert!(openshell_policy::validate_sandbox_policy(&policy).is_err()); } #[test] @@ -4804,9 +5218,388 @@ network_policies: workspace: String::new(), policy_validation_failure_mode: PolicyValidationFailureMode::default(), extension_authentication_enabled: false, + configuration_admitted: true, + configuration_error: String::new(), + configuration_instance_id: String::new(), + } + } + + #[derive(Clone)] + struct TestStartupGateway { + desired: Arc>, + reports: UnboundedSender, + reject_next_accept: Arc, + snapshot_error: Option, + report_error: Option, + pending_snapshot: bool, + pending_acceptance: bool, + } + + #[tonic::async_trait] + impl StartupGateway for TestStartupGateway { + async fn snapshot( + &self, + _id: &str, + ) -> Result { + if self.pending_snapshot { + return std::future::pending().await; + } + if let Some(code) = self.snapshot_error { + return Err(openshell_core::grpc_client::grpc_status_error( + tonic::Status::new(code, "snapshot unavailable"), + )); + } + Ok(self.desired.lock().unwrap().clone()) + } + async fn provider( + &self, + _id: &str, + ) -> Result { + Ok(startup_provider( + self.desired.lock().unwrap().provider_env_revision, + )) + } + async fn sync( + &self, + _id: &str, + _sandbox: &str, + _policy: &openshell_core::proto::SandboxPolicy, + _workspace: &str, + ) -> Result { + self.snapshot("").await + } + async fn report( + &self, + _id: &str, + _instance_id: &str, + snapshot: Option<&openshell_core::grpc_client::SettingsPollResult>, + state: openshell_core::proto::ConfigurationAdmissionState, + _error: &str, + ) -> Result<()> { + use openshell_core::proto::ConfigurationAdmissionState; + if let Some(code) = self.report_error { + return Err(openshell_core::grpc_client::grpc_status_error( + tonic::Status::new(code, "registration fence changed"), + )); + } + self.reports.send(state).unwrap(); + if state == ConfigurationAdmissionState::Accepted { + if self.pending_acceptance { + return std::future::pending().await; + } + if self.reject_next_accept.swap(false, Ordering::SeqCst) { + return Err(miette::miette!( + "desired generation changed before activation" + )); + } + assert_eq!( + snapshot.unwrap().config_revision, + self.desired.lock().unwrap().config_revision + ); + } + Ok(()) + } + } + + #[test] + fn startup_rejection_logs_only_changed_configuration_or_error() { + let mut snapshot = settings_poll_result( + Some(proto_policy_fixture()), + 1, + openshell_core::proto::PolicySource::Sandbox, + ); + let mut log = StartupRejectionLog::default(); + assert!(log.changed(&snapshot, "invalid policy")); + for _ in 0..10 { + assert!(!log.changed(&snapshot, "invalid policy")); + } + snapshot.config_revision += 1; + assert!(log.changed(&snapshot, "invalid policy")); + snapshot.provider_env_revision += 1; + assert!(log.changed(&snapshot, "invalid policy")); + snapshot.policy_hash.push_str("changed"); + assert!(log.changed(&snapshot, "invalid policy")); + snapshot.version += 1; + assert!(log.changed(&snapshot, "invalid policy")); + assert!(log.changed(&snapshot, "invalid provider")); + assert!(!log.changed(&snapshot, "invalid provider")); + assert!(log.changed(&snapshot, "invalid policy")); + } + + #[tokio::test(start_paused = true)] + async fn startup_pending_gateway_calls_exhaust_their_budgets() { + for pending_snapshot in [true, false] { + let mut policy = proto_policy_fixture(); + enrich_proto_baseline_paths(&mut policy); + let (reports, _reported) = tokio::sync::mpsc::unbounded_channel(); + let gateway = TestStartupGateway { + desired: Arc::new(std::sync::Mutex::new(settings_poll_result( + Some(policy), + 1, + openshell_core::proto::PolicySource::Sandbox, + ))), + reports, + reject_next_accept: Arc::new(AtomicBool::new(false)), + snapshot_error: None, + report_error: None, + pending_snapshot, + pending_acceptance: !pending_snapshot, + }; + let result = timeout( + Duration::from_mins(2), + load_policy_with_gateway( + Some("sandbox-id".to_string()), + Some("sandbox".to_string()), + Some("http://unused.invalid".to_string()), + None, + None, + &openshell_extension_core::ExtensionCredentialStore::new(), + LocalPolicyIdentity::Required, + Some(ImagePolicyDiscovery::Missing), + &gateway, + ), + ) + .await + .expect("pending RPC must not hang startup"); + let Err(error) = result else { + panic!("pending gateway unexpectedly admitted startup") + }; + assert!( + error.to_string().contains(if pending_snapshot { + "failed after 5 attempts" + } else { + "did not stabilize after 5 attempts" + }), + "{error}" + ); + } + } + + #[tokio::test] + async fn startup_transient_gateway_errors_exhaust_retry_budget() { + let calls = AtomicUsize::new(0); + let result: Result<()> = timeout( + Duration::from_secs(15), + grpc_retry("Startup configuration fetch", || { + calls.fetch_add(1, Ordering::SeqCst); + async { + Err(openshell_core::grpc_client::grpc_status_error( + tonic::Status::unavailable("gateway down"), + )) + } + }), + ) + .await + .expect("transient failure must have a bounded retry budget"); + assert!( + result + .unwrap_err() + .to_string() + .contains("failed after 5 attempts") + ); + assert_eq!(calls.load(Ordering::SeqCst), 5); + } + + #[tokio::test] + async fn startup_returns_permanent_gateway_errors_without_waiting_for_policy_repair() { + for (snapshot_error, report_error) in [ + (Some(tonic::Code::PermissionDenied), None), + (Some(tonic::Code::NotFound), None), + (None, Some(tonic::Code::FailedPrecondition)), + ] { + let (reports, _reported) = tokio::sync::mpsc::unbounded_channel(); + let gateway = TestStartupGateway { + desired: Arc::new(std::sync::Mutex::new(settings_poll_result( + None, + 1, + openshell_core::proto::PolicySource::Sandbox, + ))), + reports, + reject_next_accept: Arc::new(AtomicBool::new(false)), + snapshot_error, + report_error, + pending_snapshot: false, + pending_acceptance: false, + }; + let result = timeout( + Duration::from_secs(1), + load_policy_with_gateway( + Some("sandbox-id".to_string()), + Some("sandbox".to_string()), + Some("http://unused.invalid".to_string()), + None, + None, + &openshell_extension_core::ExtensionCredentialStore::new(), + LocalPolicyIdentity::Required, + Some(ImagePolicyDiscovery::Missing), + &gateway, + ), + ) + .await + .expect("permanent errors must terminate startup"); + let Err(error) = result else { + panic!("startup unexpectedly succeeded") + }; + assert!(!is_retryable_error(&error)); + assert!(error.to_string().contains(if report_error.is_some() { + "registration fence changed" + } else { + "snapshot unavailable" + })); + } + } + + #[tokio::test] + async fn startup_waits_for_repair_and_retries_stale_activation_before_returning() { + use openshell_core::proto::{ConfigurationAdmissionState, PolicySource}; + let mut policy = proto_policy_fixture(); + enrich_proto_baseline_paths(&mut policy); + let mut rejected = settings_poll_result(Some(policy), 1, PolicySource::Sandbox); + rejected.configuration_admitted = false; + let (reports, mut reported) = tokio::sync::mpsc::unbounded_channel(); + let gateway = TestStartupGateway { + desired: Arc::new(std::sync::Mutex::new(rejected)), + reports, + reject_next_accept: Arc::new(AtomicBool::new(true)), + snapshot_error: None, + report_error: None, + pending_snapshot: false, + pending_acceptance: false, + }; + let active_gateway = gateway.clone(); + let handle = tokio::spawn(async move { + load_policy_with_gateway( + Some("sandbox-id".to_string()), + Some("sandbox".to_string()), + Some("http://unused.invalid".to_string()), + None, + None, + &openshell_extension_core::ExtensionCredentialStore::new(), + LocalPolicyIdentity::Required, + Some(ImagePolicyDiscovery::Missing), + &active_gateway, + ) + .await + }); + assert_eq!( + reported.recv().await, + Some(ConfigurationAdmissionState::Pending) + ); + assert_eq!( + reported.recv().await, + Some(ConfigurationAdmissionState::Rejected) + ); + assert!( + !handle.is_finished(), + "rejected configuration must not return a launch bundle" + ); + assert_eq!( + timeout(Duration::from_secs(5), reported.recv()) + .await + .unwrap(), + Some(ConfigurationAdmissionState::Rejected), + "unchanged rejection must still report readiness on subsequent polls" + ); + { + let mut desired = gateway.desired.lock().unwrap(); + desired.configuration_admitted = true; + desired.config_revision += 1; + } + assert_eq!( + timeout(Duration::from_secs(5), reported.recv()) + .await + .unwrap(), + Some(ConfigurationAdmissionState::Accepted) + ); + assert!( + !handle.is_finished(), + "a stale activation acknowledgement must not return a launch bundle" + ); + assert_eq!( + timeout(Duration::from_secs(5), reported.recv()) + .await + .unwrap(), + Some(ConfigurationAdmissionState::Accepted) + ); + let bundle = timeout(Duration::from_secs(5), handle) + .await + .unwrap() + .unwrap() + .expect("repair returns one launch bundle"); + assert!( + bundle.7.is_some(), + "launch bundle retains matching provider state" + ); + } + + fn startup_provider(revision: u64) -> openshell_core::grpc_client::ProviderEnvironmentResult { + openshell_core::grpc_client::ProviderEnvironmentResult { + provider_env_revision: revision, + provider_attachment_epoch: String::new(), + policy_hash: String::new(), + readiness_reason: ProviderReadinessReason::Unspecified, + environment: std::collections::HashMap::new(), + credential_expires_at_ms: std::collections::HashMap::new(), + dynamic_credentials: std::collections::HashMap::new(), + static_credential_bindings: std::collections::HashMap::new(), + non_secret_environment_keys: Vec::new(), + } + } + + #[test] + fn startup_configuration_rejects_mixed_provider_revision() { + let policy = proto_policy_fixture(); + let mut snapshot = settings_poll_result( + Some(policy.clone()), + 1, + openshell_core::proto::PolicySource::Sandbox, + ); + snapshot.provider_env_revision = 10; + assert!(prepare_startup_configuration(&snapshot, &policy, &startup_provider(11)).is_err()); + let (_, _, credentials) = + prepare_startup_configuration(&snapshot, &policy, &startup_provider(10)) + .expect("matching generation is admitted"); + assert_eq!(credentials.revision(), 10); + } + + #[test] + fn startup_configuration_revalidates_on_restart_and_accepts_repair() { + let policy = proto_policy_fixture(); + let mut snapshot = settings_poll_result( + Some(policy.clone()), + 1, + openshell_core::proto::PolicySource::Sandbox, + ); + for _restart in 0..2 { + snapshot.configuration_admitted = false; + assert!( + prepare_startup_configuration(&snapshot, &policy, &startup_provider(0)).is_err() + ); + snapshot.configuration_admitted = true; + assert!( + prepare_startup_configuration(&snapshot, &policy, &startup_provider(0)).is_ok() + ); } } + #[test] + fn startup_configuration_does_not_substitute_invalid_opa_policy() { + let mut policy = proto_tcp_policy_fixture(); + policy + .network_policies + .values_mut() + .next() + .expect("fixture has policy") + .endpoints[0] + .protocol = "invalid-protocol".to_string(); + let snapshot = settings_poll_result( + Some(policy.clone()), + 1, + openshell_core::proto::PolicySource::Sandbox, + ); + assert!(prepare_startup_configuration(&snapshot, &policy, &startup_provider(0)).is_err()); + } + #[derive(Clone)] struct ScriptedPolicyGateway { polls: Arc< @@ -4817,6 +5610,7 @@ network_policies: >, >, reports: UnboundedSender<(u32, bool, String)>, + environment_identity: Arc>, } #[tonic::async_trait] @@ -4825,12 +5619,31 @@ network_policies: &self, _sandbox_id: &str, ) -> Result { - self.polls + let result = self + .polls .lock() .await .recv() .await - .ok_or_else(|| miette::miette!("scripted policy poll channel closed")) + .ok_or_else(|| miette::miette!("scripted policy poll channel closed"))?; + *self.environment_identity.lock().unwrap() = + EnvironmentIdentity::from_settings(&result); + Ok(result) + } + + async fn fetch_provider_environment( + &self, + _endpoint: &str, + _sandbox_id: &str, + ) -> Result { + let identity = self.environment_identity.lock().unwrap().clone(); + let mut provider = startup_provider(identity.revision); + provider.provider_attachment_epoch = identity.attachment_epoch; + provider.policy_hash = identity.policy_hash; + if provider.policy_hash.is_empty() { + provider.readiness_reason = ProviderReadinessReason::SnapshotMismatch; + } + Ok(provider) } async fn report_policy_status( @@ -4865,6 +5678,16 @@ network_policies: self.inner.poll_settings(sandbox_id).await } + async fn fetch_provider_environment( + &self, + endpoint: &str, + sandbox_id: &str, + ) -> Result { + self.inner + .fetch_provider_environment(endpoint, sandbox_id) + .await + } + async fn report_policy_status( &self, sandbox_id: &str, @@ -4904,6 +5727,9 @@ network_policies: ScriptedPolicyGateway { polls: Arc::new(tokio::sync::Mutex::new(poll_rx)), reports: report_tx, + environment_identity: Arc::new(std::sync::Mutex::new( + EnvironmentIdentity::default(), + )), }, poll_tx, report_rx, @@ -5154,6 +5980,16 @@ network_policies: Ok(result) } + async fn fetch_provider_environment( + &self, + endpoint: &str, + sandbox_id: &str, + ) -> Result { + self.inner + .fetch_provider_environment(endpoint, sandbox_id) + .await + } + async fn report_policy_status( &self, sandbox_id: &str, @@ -5415,6 +6251,25 @@ network_policies: middleware_connector: MiddlewareConnector, ) -> PolicyPollLoopContext { let (workspace_tx, _workspace_rx) = tokio::sync::watch::channel(String::new()); + let provider_credentials = + ProviderCredentialState::from_child_env_snapshot(0, std::collections::HashMap::new()); + let provider_readiness = ProviderReadinessTracker::new(); + // This fixture models a successfully installed initial launch snapshot. + if let LoadedPolicyOrigin::Gateway { + revision: Some(revision), + .. + } = &loaded_policy_origin + { + provider_readiness.credentials_installed( + EnvironmentIdentity { + revision: 0, + attachment_epoch: String::new(), + policy_hash: revision.policy_hash.clone(), + }, + &provider_credentials, + None, + ); + } PolicyPollLoopContext { endpoint: String::new(), sandbox_id: "sandbox-test".to_string(), @@ -5423,11 +6278,8 @@ network_policies: entrypoint_pid: Arc::new(AtomicU32::new(0)), interval_secs: 0, ocsf_enabled: Arc::new(AtomicBool::new(false)), - provider_credentials: ProviderCredentialState::from_child_env_snapshot( - 0, - std::collections::HashMap::new(), - ), - provider_readiness: ProviderReadinessTracker::new(), + provider_credentials, + provider_readiness, policy_local_ctx: None, agent_proposals: AgentProposals::default(), middleware_registry_status: MiddlewareRegistryStatus::Synchronized, @@ -6085,8 +6937,17 @@ network_policies: LocalPolicyIdentity::Required, ) }; - let (_, engine, proto, registry, origin, proposals, extension_authentication_enabled) = - startup().await.expect("load valid local policy"); + let ( + _, + engine, + proto, + registry, + origin, + proposals, + extension_authentication_enabled, + provider_credentials, + ) = startup().await.expect("load valid local policy"); + assert!(provider_credentials.is_none()); assert!(proto.is_none()); assert!(matches!(origin, LoadedPolicyOrigin::LocalOverride)); assert!(matches!(registry, MiddlewareRegistryStatus::Synchronized)); diff --git a/crates/openshell-tui/src/app.rs b/crates/openshell-tui/src/app.rs index ee86b5f4f6..e0689ee8a4 100644 --- a/crates/openshell-tui/src/app.rs +++ b/crates/openshell-tui/src/app.rs @@ -657,6 +657,7 @@ pub struct App { pub sandbox_created: Vec, pub sandbox_images: Vec, pub sandbox_notes: Vec, + pub sandbox_detail_notes: Vec, /// Formatted labels for each sandbox (e.g., "env=prod,team=platform" or empty string). pub sandbox_labels: Vec, /// Formatted annotations for each sandbox (e.g., "policy-signature=abc" or empty string). @@ -1019,6 +1020,7 @@ impl App { sandbox_created: Vec::new(), sandbox_images: Vec::new(), sandbox_notes: Vec::new(), + sandbox_detail_notes: Vec::new(), sandbox_labels: Vec::new(), sandbox_annotations: Vec::new(), sandbox_workspaces: Vec::new(), @@ -3528,6 +3530,7 @@ impl App { self.sandbox_created.clear(); self.sandbox_images.clear(); self.sandbox_notes.clear(); + self.sandbox_detail_notes.clear(); self.sandbox_labels.clear(); self.sandbox_annotations.clear(); self.sandbox_policy_versions.clear(); diff --git a/crates/openshell-tui/src/lib.rs b/crates/openshell-tui/src/lib.rs index 23705a24e9..5e9f7aee7c 100644 --- a/crates/openshell-tui/src/lib.rs +++ b/crates/openshell-tui/src/lib.rs @@ -2731,6 +2731,62 @@ async fn fetch_sandboxes( } } +fn sandbox_notes(sandbox: &openshell_core::proto::Sandbox, forwards: String) -> String { + sandbox_notes_for_view(sandbox, forwards, false) +} + +fn sandbox_notes_for_view( + sandbox: &openshell_core::proto::Sandbox, + forwards: String, + detail: bool, +) -> String { + if let Some(record) = sandbox + .status + .as_ref() + .and_then(|status| status.provisioning.as_ref()) + && record.timeout_time.is_some() + { + let cleanup = if record.cleanup_completed_time.is_some() { + "compute reclaimed" + } else { + "compute cleanup pending" + }; + let mut notes = format!("Provisioning timed out; {cleanup}"); + if !forwards.is_empty() { + notes.push_str("; "); + notes.push_str(&forwards); + } + return notes; + } + let rejection = sandbox.status.as_ref().and_then(|status| { + status.conditions.iter().find(|condition| { + matches!(condition.r#type.as_str(), "ConfigurationReady" | "Ready") + && condition.status == "False" + && condition.reason == "ConfigurationInvalid" + }) + }); + let Some(rejection) = rejection else { + return forwards; + }; + let mut notes = if detail { + format!( + "Invalid config: {}", + rejection + .message + .split_whitespace() + .collect::>() + .join(" ") + ) + } else { + "Invalid config".to_string() + }; + if !forwards.is_empty() { + notes.push_str("; "); + notes.push_str(&forwards); + } + notes +} + fn apply_sandbox_refresh(app: &mut App, sandboxes: Vec) { app.sandbox_count = sandboxes.len(); app.sandbox_ids = sandboxes @@ -2780,13 +2836,22 @@ fn apply_sandbox_refresh(app: &mut App, sandboxes: Vec, app: &mut App, area: Rect) { let chunks = Layout::default() .direction(Direction::Vertical) .constraints([ - Constraint::Length(sandbox_detail::required_height(app)), // metadata - Constraint::Min(0), // policy or logs + Constraint::Length(sandbox_detail::required_height(app, area.width)), // metadata + Constraint::Min(0), // policy or logs ]) .split(area); @@ -738,6 +738,55 @@ mod tests { assert!(!rendered.contains("ALPHA")); } + #[tokio::test] + async fn configuration_notes_fit_dashboard_and_wrap_in_detail() { + let mut app = test_app(); + app.sandbox_names = vec!["quarantined".into()]; + app.sandbox_count = 1; + app.sandbox_notes = vec!["Invalid config".into()]; + let diagnostic = "Invalid config: credentialed endpoint api.example.com:443 requires L7 inspection before the sandbox workload can start safely"; + app.sandbox_detail_notes = vec![diagnostic.into()]; + for width in [80, 100, 120] { + for all_workspaces in [false, true] { + app.all_workspaces = all_workspaces; + let mut terminal = Terminal::new(TestBackend::new(width, 24)).unwrap(); + terminal + .draw(|frame| { + sandboxes::draw(frame, &app, frame.size(), true); + }) + .unwrap(); + let text: String = terminal + .backend() + .buffer() + .content() + .iter() + .map(ratatui::buffer::Cell::symbol) + .collect(); + assert!( + text.contains("Invalid config"), + "dashboard at {width}: {text}" + ); + assert!(!text.contains("credentialed endpoint")); + } + app.screen = Screen::Sandbox; + let mut terminal = Terminal::new(TestBackend::new(width, 24)).unwrap(); + terminal.draw(|frame| draw(frame, &mut app)).unwrap(); + let text: String = terminal + .backend() + .buffer() + .content() + .iter() + .map(ratatui::buffer::Cell::symbol) + .collect(); + let words = text + .replace('│', " ") + .split_whitespace() + .collect::>() + .join(" "); + assert!(words.contains(diagnostic), "detail at {width}: {words}"); + } + } + #[tokio::test] async fn sandbox_delete_confirmation_is_visible_in_standard_terminal() { let mut app = test_app(); diff --git a/crates/openshell-tui/src/ui/sandbox_detail.rs b/crates/openshell-tui/src/ui/sandbox_detail.rs index a398797e40..341e46c71a 100644 --- a/crates/openshell-tui/src/ui/sandbox_detail.rs +++ b/crates/openshell-tui/src/ui/sandbox_detail.rs @@ -27,8 +27,20 @@ fn pending_draft_count(app: &App) -> usize { } } +fn note_lines(app: &App, width: u16) -> Vec { + let notes = app + .sandbox_detail_notes + .get(app.sandbox_selected) + .filter(|s| !s.is_empty()) + .map_or("none", String::as_str); + super::sandbox_draft::wrap_value( + &format!(" Notes: {notes}"), + usize::from(width.saturating_sub(4).max(1)), + ) +} + /// Return the rows needed to render every metadata line without clipping. -pub(super) fn required_height(app: &App) -> u16 { +pub(super) fn required_height(app: &App, width: u16) -> u16 { let policy_rows = u16::from(app.sandbox_policy_is_global); let action_rows = if app.confirm_delete { 2 // spacer plus confirmation @@ -36,7 +48,11 @@ pub(super) fn required_height(app: &App) -> u16 { u16::from(pending_draft_count(app) > 0) }; - BASE_CONTENT_ROWS + policy_rows + action_rows + BORDER_ROWS + BASE_CONTENT_ROWS + + policy_rows + + action_rows + + BORDER_ROWS + + u16::try_from(note_lines(app, width).len().saturating_sub(1)).unwrap_or(u16::MAX - 16) } /// Draw a compact metadata pane for the currently selected sandbox. @@ -130,18 +146,12 @@ pub fn draw(frame: &mut Frame<'_>, app: &App, area: Rect) { Span::styled(providers_str, t.text), ]); - // Row 6: Forwarded Ports - let forwards_str = app - .sandbox_notes - .get(idx) - .filter(|s| !s.is_empty()) - .map_or("none", String::as_str); - let row6 = Line::from(vec![ - Span::styled(" Forwards: ", t.muted), - Span::styled(forwards_str, t.text), - ]); - - let mut lines = vec![row1, row2, row3, row4, row5, row6]; + let mut lines = vec![row1, row2, row3, row4, row5]; + lines.extend( + note_lines(app, area.width) + .into_iter() + .map(|line| Line::from(Span::styled(line, t.text))), + ); // Show global policy indicator when the sandbox's policy is managed at // gateway scope. diff --git a/crates/openshell-tui/src/ui/sandbox_draft.rs b/crates/openshell-tui/src/ui/sandbox_draft.rs index dd2360b4d8..7be11ddbc2 100644 --- a/crates/openshell-tui/src/ui/sandbox_draft.rs +++ b/crates/openshell-tui/src/ui/sandbox_draft.rs @@ -574,7 +574,7 @@ fn display_width(text: &str) -> usize { /// /// A word wider than `width` is hard-broken rather than allowed to overflow. /// Always returns at least one row so callers can index the first row safely. -fn wrap_value(text: &str, width: usize) -> Vec { +pub(super) fn wrap_value(text: &str, width: usize) -> Vec { if width == 0 { return vec![text.to_string()]; } diff --git a/crates/openshell-tui/src/ui/sandboxes.rs b/crates/openshell-tui/src/ui/sandboxes.rs index b1d3edc1fe..3f8a20991e 100644 --- a/crates/openshell-tui/src/ui/sandboxes.rs +++ b/crates/openshell-tui/src/ui/sandboxes.rs @@ -94,7 +94,7 @@ pub fn draw(frame: &mut Frame<'_>, app: &App, area: Rect, focused: bool) { Constraint::Percentage(7), Constraint::Percentage(18), Constraint::Percentage(15), - Constraint::Percentage(12), + Constraint::Length(18), ] } else { vec![ @@ -104,7 +104,7 @@ pub fn draw(frame: &mut Frame<'_>, app: &App, area: Rect, focused: bool) { Constraint::Percentage(8), Constraint::Percentage(20), Constraint::Percentage(15), - Constraint::Percentage(12), + Constraint::Length(18), ] }; diff --git a/docs/reference/gateway-config.mdx b/docs/reference/gateway-config.mdx index abced28b74..75599ae19f 100644 --- a/docs/reference/gateway-config.mdx +++ b/docs/reference/gateway-config.mdx @@ -266,7 +266,7 @@ The client-certificate handshake policy is derived and has no `require_client_au `[openshell.gateway.tls]` supports optional SNI-based dual-certificate mode for deployments that need separate internal and external server certificates. Set `external_cert_path` and `external_key_path` to point at the external (e.g. ACME/publicly-trusted) certificate and key. List the hostnames that should be served with the external certificate in `external_server_names`. Connections whose TLS SNI hostname matches one of those names receive the external certificate; all other connections (including those with no SNI) receive the primary internal certificate from `cert_path`/`key_path`. Both fields must be set together — providing only one is a configuration error. On Kubernetes with the Helm chart, the external certificate is managed automatically when `certManager.serverIssuerRef.name` is set; the chart populates these fields from the cert-manager-issued external server certificate. -`[openshell.gateway] policy_validation_failure_mode` controls what sandbox supervisors do when a complete candidate policy fails runtime validation. The default, `fail_closed`, deactivates the previous network policy, closes relays pinned to it, and denies new egress until a valid generation loads. `retain_last_valid` leaves the previous valid generation active. Both modes reject the candidate atomically; startup always fails closed when no previous valid generation exists. Gateway mutation paths that can preflight a known effective scope reject invalid candidates before persistence and leave the active policy unchanged regardless of this setting. Changing the value requires restarting the gateway so it can reload `gateway.toml` and distribute the new posture to sandbox supervisors. +`[openshell.gateway] policy_validation_failure_mode` controls what sandbox supervisors do when a complete candidate policy fails runtime validation. The default, `fail_closed`, deactivates the previous network policy, closes relays pinned to it, and denies new egress until a valid generation loads. `retain_last_valid` leaves the previous valid generation active. Both modes reject the candidate atomically; startup keeps the workload unstarted until the effective policy and matching provider configuration pass admission. A rejected startup exposes `ConfigurationInvalid` and remains available for policy/provider repair in either mode. Gateway mutation paths that can preflight a known effective scope reject invalid candidates before persistence and leave the active policy unchanged regardless of this setting. Changing the value requires restarting the gateway so it can reload `gateway.toml` and distribute the new posture to sandbox supervisors. `[openshell.gateway.gateway_jwt] ttl_secs` controls gateway-minted sandbox JWT lifetime. Omit it for a non-expiring token: the token has no `exp` claim and the response omits `expiration_time`. Use this only for local single-player Docker, Podman, or VM gateways. Explicit `0` is invalid. Kubernetes and other shared deployments should set a positive TTL; Helm renders `3600` seconds by default, and the gateway logs a warning when a Kubernetes gateway omits the field. diff --git a/docs/sandboxes/manage-sandboxes.mdx b/docs/sandboxes/manage-sandboxes.mdx index 86968a9910..879a90fa98 100644 --- a/docs/sandboxes/manage-sandboxes.mdx +++ b/docs/sandboxes/manage-sandboxes.mdx @@ -609,6 +609,8 @@ Use the terminal to spot blocked connections marked `action=deny` and provider-r The dashboard has three panels stacked vertically: Gateways, Providers (or Global Settings), and Sandboxes. Navigate within a panel with `Up`/`Down` or `j`/`k`. At a list boundary the cursor overflows into the adjacent panel, skipping empty panels. Use `Tab`/`Shift+Tab` to cycle panels directly. Press `h`/`l` or `Left`/`Right` in the middle panel to switch between the Providers and Global Settings tabs. +The sandbox table’s NOTES column shows `Invalid config` when policy or provider configuration blocks provisioning. Open the sandbox detail view for the full rejection reason, or run `openshell sandbox get -o json`. The note clears after the configuration is repaired; active port forwards remain listed. + ## Port Forwarding Forward a local port to a running sandbox to access services inside it, such as a web server or database: @@ -760,6 +762,39 @@ after it attempts every requested deletion if any entry failed. Every sandbox moves through a defined set of phases: +Before workload activation, OpenShell validates the effective policy and matching +provider configuration. A rejection keeps the workload unstarted and exposes a +`ConfigurationInvalid` condition in `Provisioning`. Use `openshell sandbox get` +to inspect the diagnostic, then [repair the policy or provider configuration](/sandboxes/policies#validation-failures). +Management operations remain available while startup is blocked. After repair, +the supervisor completes startup without recreating the sandbox. Starting a +stopped sandbox repeats configuration admission before launching its workload. + +The gateway enforces a 300-second provisioning repair window, independently of +the CLI wait timeout. An effective policy, settings, provider, profile, or +attachment change resets the window from its stored change time. The first +failed configuration load for that change grants another full window. Repeated +failures and reconnects do not extend it; reaching `Ready` clears it. + +When the window expires, the sandbox enters `Error` with reason +`ProvisioningTimedOut`. The gateway stops its workload and supervisor compute, +retaining the sandbox record, diagnostic, and restartable storage. Cleanup can +remain pending if the backend is unavailable; the gateway retries it. Inspect +`provisioning` in JSON output for the deadline, timeout, and cleanup timestamps. +TUI NOTES distinguishes pending cleanup from reclaimed compute. + +Repair the configuration, wait for cleanup to complete, then explicitly restart: + +```shell +openshell sandbox get my-sandbox --output json +openshell sandbox start my-sandbox +``` + +Editing configuration after expiry does not restart compute. A retry gets a new +300-second window, while static-policy restrictions from any previous activation +remain in force. Timed-out records are retained even for ephemeral creates; use +`sandbox delete` when you no longer need the diagnostic or stored state. + | Phase | Description | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Provisioning | The runtime is setting up the sandbox environment, or the gateway is waiting for the sandbox supervisor to establish its authenticated control session. | diff --git a/docs/sandboxes/policies.mdx b/docs/sandboxes/policies.mdx index 749dd0c5a4..a8b743b5cd 100644 --- a/docs/sandboxes/policies.mdx +++ b/docs/sandboxes/policies.mdx @@ -269,6 +269,38 @@ The following steps outline the hot-reload policy update workflow. ### Validation failures +Before starting a workload, OpenShell validates its effective policy together +with attached provider rules and credential bindings. An image policy can be +valid alone and fail after composition, for example when an L4-only endpoint +overlaps a credentialed provider that requires L7 inspection. + +When startup validation fails, the sandbox stays in `Provisioning` with a +`ConfigurationInvalid` readiness condition. Its workload has not started. Inspect +the condition with `openshell sandbox get `, then submit a complete repaired +policy or detach the conflicting provider: + +```shell +openshell policy set --policy repaired-policy.yaml --wait +openshell sandbox provider detach +``` + +These are alternative repairs; choose the one that matches the intended access. +Startup has a [300-second provisioning repair window](/sandboxes/manage-sandboxes#sandbox-lifecycle). +Effective configuration changes and their first failed load reset the window; +repeated failures do not. If it expires, the gateway records `ProvisioningTimedOut` +and reclaims compute. Repair the configuration, wait for cleanup, then run +`openshell sandbox start ` to retry. Before expiry, repair resumes the same +provisioning attempt. +The supervisor starts the workload after the repaired configuration passes +validation. You can replace static policy fields while the first startup is +blocked. After the first accepted activation, the usual static-field restrictions +apply permanently, including while a restart is pending or rejected. Images without an +embedded policy use the restrictive baseline and gain network access only from +operator-selected configuration. Explicit user/global policy precedence remains +unchanged. Gateway authorization or compatibility errors, exhausted connection +retries, and unavailable sandbox boundary connections terminate startup rather than +waiting for policy repair. + OpenShell validates a complete candidate policy before activating any part of it. Endpoints may overlap when their connection and request-processing metadata agree. For example, two `api.example.com:443` REST entries can contribute different allow and deny rules when they use the same TLS, destination, credential, parser, and enforcement settings. A plain L4 endpoint may overlap an L7 endpoint because it authorizes the destination without contributing request-processing metadata. A more-specific path endpoint may override request-processing metadata from a broader endpoint, such as a `/graphql` GraphQL endpoint alongside a general REST endpoint for the same host. OpenShell rejects the candidate when overlapping exact or wildcard host selectors can both contribute equally specific endpoint configuration and disagree on those fields. Internal policy-advisor provenance does not make otherwise compatible endpoints ambiguous. This lets an advisor proposal extend a provider-covered host without modifying the provider rule. TLS, destination IP constraints, credential handling, protocol, parser, and equally specific enforcement settings must still agree. @@ -303,7 +335,7 @@ Operators that explicitly prioritize availability can retain the previous genera policy_validation_failure_mode = "retain_last_valid" ``` -In `retain_last_valid` mode, the rejected candidate remains inactive and the previous valid generation remains active. If no previous valid generation exists, such as during initial startup, OpenShell still fails closed. Restart the gateway after changing `gateway.toml`; connected sandbox supervisors receive the configured posture from the restarted gateway. Individual sandboxes cannot override it. +In `retain_last_valid` mode, the rejected candidate remains inactive and the previous valid generation remains active. During initial startup, a rejected configuration keeps the workload unstarted in either mode. Restart the gateway after changing `gateway.toml`; connected sandbox supervisors receive the configured posture from the restarted gateway. Individual sandboxes cannot override it. OCSF configuration and finding events identify the rejected candidate, validation rationale, configured and effective modes, active generation, and whether the previous policy is active. When `retain_last_valid` is configured without a previous valid generation, the effective mode remains `fail_closed`. Connection denials during quarantine include the validation failure as their policy denial rationale. diff --git a/e2e/rust/Cargo.toml b/e2e/rust/Cargo.toml index 51f30c37fc..e2ed363915 100644 --- a/e2e/rust/Cargo.toml +++ b/e2e/rust/Cargo.toml @@ -38,6 +38,11 @@ e2e-oidc-pkce = [] e2e-provider-refresh-keycloak = [] e2e-vm = ["e2e", "e2e-host-gateway"] +[[test]] +name = "policy_activation" +path = "tests/policy_activation.rs" +required-features = ["e2e-docker"] + [[test]] name = "oidc_pkce" path = "tests/oidc_pkce.rs" diff --git a/e2e/rust/tests/policy_activation.rs b/e2e/rust/tests/policy_activation.rs new file mode 100644 index 0000000000..0491e80c3f --- /dev/null +++ b/e2e/rust/tests/policy_activation.rs @@ -0,0 +1,383 @@ +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +#![cfg(feature = "e2e-docker")] + +//! A rejected image/provider composition must never launch its main process. + +use std::process::Stdio; +use std::time::Duration; + +use openshell_e2e::harness::binary::{openshell_bin, openshell_cmd}; +use openshell_e2e::harness::cli::run_cli; +use openshell_e2e::harness::container::{ContainerEngine, ImageGuard}; +use openshell_e2e::harness::output::strip_ansi; + +const MARKER: &str = "/sandbox/activation-count"; +const WORKLOAD: &str = "echo started >> /sandbox/activation-count; exec sleep infinity"; +const POLICY: &str = r"version: 1 +filesystem_policy: + include_workdir: true + read_only: [/usr, /lib, /proc, /etc, /dev/urandom] + read_write: [/sandbox, /tmp, /dev/null] +landlock: + compatibility: best_effort +process: + run_as_user: sandbox + run_as_group: sandbox +network_policies: + image_api: + endpoints: + - host: api.example.com + port: 443 + binaries: + - path: /usr/bin/curl +"; + +struct Resources { + sandbox: String, + standalone_sandbox: String, + provider: String, +} + +impl Drop for Resources { + fn drop(&mut self) { + // Deletion drains asynchronously; retry dependencies on panic as well. + let bin = openshell_bin(); + let _ = std::process::Command::new(&bin) + .args(["sandbox", "delete", &self.sandbox]) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status(); + let _ = std::process::Command::new(&bin) + .args(["sandbox", "delete", &self.standalone_sandbox]) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status(); + for _ in 0..20 { + let deleted = std::process::Command::new(&bin) + .args(["provider", "delete", &self.provider]) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status(); + if deleted.is_ok_and(|status| status.success()) { + break; + } + std::thread::sleep(Duration::from_millis(250)); + } + let _ = std::process::Command::new(&bin) + .args(["provider", "profile", "delete", &self.provider]) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status(); + } +} + +async fn cli_ok(args: &[&str]) { + let (output, code) = run_cli(args).await; + assert_eq!(code, 0, "{} failed:\n{output}", args.join(" ")); +} + +fn container_id(engine: &ContainerEngine, name: &str) -> String { + role_container_id(engine, name, "sandbox") +} + +fn role_container_id(engine: &ContainerEngine, name: &str, role: &str) -> String { + let output = engine + .command() + .args([ + "ps", + "--quiet", + "--filter", + &format!("label=openshell.ai/sandbox-name={name}"), + "--filter", + &format!("label=openshell.ai/isolation-role={role}"), + ]) + .output() + .expect("find sandbox container"); + assert!(output.status.success(), "container lookup failed"); + let ids = String::from_utf8_lossy(&output.stdout); + let ids: Vec<_> = ids.split_whitespace().collect(); + assert_eq!( + ids.len(), + 1, + "expected one running {role} container: {ids:?}" + ); + ids[0].to_string() +} + +fn assert_marker(engine: &ContainerEngine, container: &str, started: bool) { + let script = if started { + format!("test -f {MARKER} && test \"$(wc -l < {MARKER})\" -eq 1") + } else { + format!("test ! -e {MARKER}") + }; + let output = engine + .command() + .args(["exec", container, "sh", "-c", &script]) + .output() + .expect("inspect actual workload marker"); + assert!( + output.status.success(), + "workload marker assertion failed (started={started}): {}", + String::from_utf8_lossy(&output.stderr) + ); +} + +async fn wait_for_marker(engine: &ContainerEngine, container: &str) { + let deadline = tokio::time::Instant::now() + Duration::from_secs(30); + loop { + let output = engine + .command() + .args(["exec", container, "test", "-f", MARKER]) + .output() + .unwrap(); + if output.status.success() { + break; + } + assert!( + tokio::time::Instant::now() < deadline, + "admitted workload did not start" + ); + tokio::time::sleep(Duration::from_millis(250)).await; + } + assert_marker(engine, container, true); +} + +#[tokio::test] +async fn invalid_image_provider_bundle_waits_for_repair_before_launch() { + let suffix = format!("{:016x}", rand::random::()); + let resources = Resources { + sandbox: format!("ac-{suffix}"), + standalone_sandbox: format!("al-{suffix}"), + provider: format!("ap-{suffix}"), + }; + let context = tempfile::tempdir().unwrap(); + std::fs::write(context.path().join("policy.yaml"), POLICY).unwrap(); + std::fs::write(context.path().join("Dockerfile"), r#"FROM public.ecr.aws/docker/library/python:3.13-slim +RUN apt-get update && apt-get install -y --no-install-recommends iproute2 && rm -rf /var/lib/apt/lists/* \ + && groupadd sandbox && useradd -m -g sandbox sandbox && mkdir -p /sandbox && chown sandbox:sandbox /sandbox +COPY policy.yaml /etc/openshell/policy.yaml +WORKDIR /sandbox +USER sandbox +CMD ["sh", "-c", "echo started >> /sandbox/activation-count; exec sleep infinity"] +"#).unwrap(); + let image = ImageGuard::build( + "policy-activation", + &context.path().join("Dockerfile"), + context.path(), + ) + .unwrap(); + // The very same embedded policy is valid before provider composition. + tokio::time::timeout( + Duration::from_secs(120), + cli_ok(&[ + "sandbox", + "create", + "--name", + &resources.standalone_sandbox, + "--detach", + "--from", + image.tag(), + "--", + "sh", + "-c", + WORKLOAD, + ]), + ) + .await + .expect("standalone image policy activates"); + let engine = ContainerEngine::from_env().unwrap(); + wait_for_marker( + &engine, + &container_id(&engine, &resources.standalone_sandbox), + ) + .await; + cli_ok(&["sandbox", "delete", &resources.standalone_sandbox]).await; + + let profile = context.path().join("provider.yaml"); + std::fs::write( + &profile, + format!( + r"id: {} +display_name: Activation test +category: other +credentials: + - name: token + env_vars: [ACTIVATION_TOKEN] + required: true + auth_style: bearer + header_name: authorization +endpoints: + - host: api.example.com + port: 443 + protocol: rest + access: full +binaries: + - path: /usr/bin/curl +", + resources.provider + ), + ) + .unwrap(); + cli_ok(&[ + "provider", + "profile", + "import", + "--file", + profile.to_str().unwrap(), + ]) + .await; + cli_ok(&[ + "provider", + "create", + "--name", + &resources.provider, + "--type", + &resources.provider, + "--credential", + "ACTIVATION_TOKEN=activation-test-not-a-real-secret", + ]) + .await; + let mut create = openshell_cmd() + .args([ + "sandbox", + "create", + "--name", + &resources.sandbox, + "--detach", + "--from", + image.tag(), + "--provider", + &resources.provider, + "--", + "sh", + "-c", + WORKLOAD, + ]) + .stdout(Stdio::null()) + .stderr(Stdio::inherit()) + .spawn() + .expect("start sandbox create"); + let deadline = tokio::time::Instant::now() + Duration::from_secs(120); + loop { + let (output, code) = + run_cli(&["sandbox", "get", &resources.sandbox, "--output", "json"]).await; + let clean = strip_ansi(&output); + if code == 0 && clean.contains("ConfigurationInvalid") { + let details: serde_json::Value = serde_json::from_str(&clean).expect("sandbox JSON"); + let phase = details + .get("phase") + .and_then(serde_json::Value::as_str) + .expect("sandbox detail must expose a phase string"); + assert_eq!( + phase, "Provisioning", + "rejected configuration must not be usable" + ); + assert!(!clean.contains("activation-test-not-a-real-secret")); + break; + } + assert!( + tokio::time::Instant::now() < deadline, + "configuration did not reject:\n{clean}" + ); + tokio::time::sleep(Duration::from_millis(500)).await; + } + let container = container_id(&engine, &resources.sandbox); + let supervisor = role_container_id(&engine, &resources.sandbox, "supervisor"); + assert_marker(&engine, &container, false); + // Repeated observation distinguishes a stable gate from a crash/relaunch loop. + tokio::time::sleep(Duration::from_secs(3)).await; + assert_eq!(container_id(&engine, &resources.sandbox), container); + assert_eq!( + role_container_id(&engine, &resources.sandbox, "supervisor"), + supervisor + ); + let restarts = engine + .command() + .args(["inspect", "--format", "{{.RestartCount}}", &supervisor]) + .output() + .expect("inspect supervisor restart count"); + assert!(restarts.status.success()); + assert_eq!( + String::from_utf8_lossy(&restarts.stdout).trim(), + "0", + "invalid configuration must not crash-loop" + ); + assert_marker(&engine, &container, false); + let logs = engine + .command() + .args(["logs", &supervisor]) + .output() + .expect("read quarantined supervisor logs"); + assert!(logs.status.success()); + let logs = format!( + "{}{}", + String::from_utf8_lossy(&logs.stdout), + String::from_utf8_lossy(&logs.stderr) + ); + assert_eq!( + logs.matches("credentialed endpoint 'api.example.com:443'") + .count(), + 1, + "unchanged startup rejection must be logged only once: {logs}" + ); + assert!(!logs.contains("Creating OPA engine from proto policy data")); + let repaired = context.path().join("repaired.yaml"); + std::fs::write( + &repaired, + POLICY.replace( + " port: 443", + " port: 443\n protocol: rest\n access: full", + ), + ) + .unwrap(); + cli_ok(&[ + "policy", + "set", + &resources.sandbox, + "--policy", + repaired.to_str().unwrap(), + ]) + .await; + let status = tokio::time::timeout(Duration::from_secs(120), create.wait()) + .await + .expect("create completes after repair") + .expect("wait for create"); + assert!(status.success(), "create failed after valid repair"); + wait_for_marker(&engine, &container).await; + // An invalid later replacement must not displace the admitted live policy. + let (output, code) = run_cli(&[ + "policy", + "set", + &resources.sandbox, + "--policy", + context.path().join("policy.yaml").to_str().unwrap(), + ]) + .await; + assert_ne!( + code, 0, + "unsafe replacement unexpectedly succeeded: {output}" + ); + assert_marker(&engine, &container, true); + // An explicit stop/start must run the admission gate again before the saved + // command launches. Clear the marker to distinguish that new launch. + let removed = engine + .command() + .args(["exec", &container, "rm", "-f", MARKER]) + .status() + .unwrap(); + assert!(removed.success()); + cli_ok(&["sandbox", "stop", &resources.sandbox]).await; + tokio::time::timeout( + Duration::from_secs(120), + cli_ok(&["sandbox", "start", &resources.sandbox]), + ) + .await + .expect("repaired configuration revalidates on restart"); + let restarted_container = container_id(&engine, &resources.sandbox); + wait_for_marker(&engine, &restarted_container).await; + drop(create); + drop(resources); + drop(image); +} diff --git a/e2e/rust/tests/provider_auto_create.rs b/e2e/rust/tests/provider_auto_create.rs index 80e6e75fc3..86d5d336c2 100644 --- a/e2e/rust/tests/provider_auto_create.rs +++ b/e2e/rust/tests/provider_auto_create.rs @@ -84,12 +84,35 @@ async fn auto_created_provider_credential_available_in_sandbox() { // Clean up any leftover from a previous run. delete_provider("claude-code").await; + // This test only reads the injected environment placeholder. Do not inherit + // the published image's network rules, which may be incompatible with the + // attached credential provider's startup validation. + let policy = tempfile::NamedTempFile::new().expect("create provider test policy"); + std::fs::write( + policy.path(), + r"version: 1 +filesystem_policy: + include_workdir: true + read_only: [/usr, /lib, /etc, /proc] + read_write: [/sandbox, /tmp, /dev/null] +landlock: + compatibility: best_effort +process: + run_as_user: sandbox + run_as_group: sandbox +network_policies: {} +", + ) + .expect("write provider test policy"); + // Create a sandbox that prints the ANTHROPIC_API_KEY env var. // --auto-providers skips the interactive prompt. let mut cmd = openshell_cmd(); cmd.arg("sandbox") .arg("create") .arg("--detach") + .arg("--policy") + .arg(policy.path()) .arg("--provider") .arg("claude-code") .arg("--auto-providers") diff --git a/e2e/rust/tests/sandbox_lifecycle.rs b/e2e/rust/tests/sandbox_lifecycle.rs index 279b5fdd47..e82a269812 100644 --- a/e2e/rust/tests/sandbox_lifecycle.rs +++ b/e2e/rust/tests/sandbox_lifecycle.rs @@ -680,7 +680,54 @@ async fn canonical_main_disconnect_reconnect_replays_history_for_same_process() #[tokio::test] async fn sandbox_create_with_no_keep_cleans_up_after_tty_command() { - let mut cmd = openshell_tty_cmd(&["sandbox", "create", "--no-keep", "--", "echo", "OK"]); + let name = format!("tty-{:015x}", rand::random::() & 0x0fff_ffff_ffff_ffff); + // Capture startup diagnostics before --no-keep removes a failed container. + // This is best-effort: the lifecycle assertions also run on other drivers. + let log_name = name.clone(); + let diagnostics = tokio::spawn(async move { + tokio::time::timeout(Duration::from_secs(30), async { + loop { + let containers = tokio::process::Command::new("docker") + .args(["ps", "--all", "--quiet", "--filter"]) + .arg(format!("label=openshell.ai/sandbox-name={log_name}")) + .kill_on_drop(true) + .output() + .await + .ok()?; + if !containers.status.success() { + return None; + } + let ids = String::from_utf8_lossy(&containers.stdout); + if let Some(id) = ids.split_whitespace().next() { + let logs = tokio::process::Command::new("docker") + .args(["logs", "--follow", id]) + .kill_on_drop(true) + .output() + .await + .ok()?; + return Some(normalize_output(&format!( + "{}{}", + String::from_utf8_lossy(&logs.stdout), + String::from_utf8_lossy(&logs.stderr) + ))); + } + sleep(Duration::from_millis(100)).await; + } + }) + .await + .ok() + .flatten() + }); + let mut cmd = openshell_tty_cmd(&[ + "sandbox", + "create", + "--name", + &name, + "--no-keep", + "--", + "echo", + "OK", + ]); cmd.stdout(Stdio::piped()).stderr(Stdio::piped()); let output = cmd.output().await.expect("spawn openshell sandbox create"); @@ -688,7 +735,17 @@ async fn sandbox_create_with_no_keep_cleans_up_after_tty_command() { let stderr = String::from_utf8_lossy(&output.stderr).to_string(); let combined = normalize_output(&format!("{stdout}{stderr}")); - assert!(output.status.success(), "create failed:\n{combined}"); + let startup_logs = if output.status.success() { + diagnostics.abort(); + None + } else { + diagnostics.await.ok().flatten() + }; + assert!( + output.status.success(), + "create failed:\n{combined}\nsupervisor logs:\n{}", + startup_logs.as_deref().unwrap_or("unavailable") + ); assert!( combined.contains("OK"), "main output was not streamed:\n{combined}" diff --git a/proto/openshell.proto b/proto/openshell.proto index 91c0365863..586b7d435f 100644 --- a/proto/openshell.proto +++ b/proto/openshell.proto @@ -503,6 +503,12 @@ service OpenShell { }; } + // Register startup and acknowledge an exact validated runtime configuration. + rpc ReportSandboxConfiguration(ReportSandboxConfigurationRequest) + returns (ReportSandboxConfigurationResponse) { + option (openshell.options.v1.authorization) = { auth_mode: "sandbox" }; + } + // Get provider environment for a sandbox (called by sandbox supervisor at startup). rpc GetSandboxProviderEnvironment(GetSandboxProviderEnvironmentRequest) returns (GetSandboxProviderEnvironmentResponse) { @@ -1110,6 +1116,12 @@ message SandboxStatus { // Currently populated for MCP-over-HTTP endpoints. These passive results // remain separate from sandbox lifecycle conditions and readiness. repeated EndpointStatus endpoint_statuses = 10; + // Independent of infrastructure phase; retained across driver observations. + SandboxConfigurationAdmission configuration_admission = 11; + // Durable first-acceptance marker. Absent on legacy records; never reset by restart. + optional bool configuration_activated = 12; + // Gateway-owned repair window. Retained after timeout for inspection and retry. + SandboxProvisioning provisioning = 13; } // User-facing sandbox condition derived from platform or gateway observations. @@ -2772,6 +2784,32 @@ message ReportPolicyStatusRequest { // Report policy status response. message ReportPolicyStatusResponse {} +enum ConfigurationAdmissionState { + CONFIGURATION_ADMISSION_STATE_UNSPECIFIED = 0; + CONFIGURATION_ADMISSION_STATE_PENDING = 1; + CONFIGURATION_ADMISSION_STATE_ACCEPTED = 2; + CONFIGURATION_ADMISSION_STATE_REJECTED = 3; +} + +message SandboxConfigurationAdmission { + string instance_id = 1; + ConfigurationAdmissionState state = 2; + uint32 policy_version = 3; + string policy_hash = 4; + uint64 config_revision = 5; + uint64 provider_env_revision = 6; + string error = 7; +} + +message ReportSandboxConfigurationRequest { + string sandbox_id = 1; + SandboxConfigurationAdmission admission = 2; + // Pending registration replaces only this previously observed instance. + string expected_instance_id = 3; +} + +message ReportSandboxConfigurationResponse {} + // A versioned policy revision with metadata. message SandboxPolicyRevision { reserved 5, 6; @@ -3645,3 +3683,23 @@ message EndpointStatus { // same-sequence retries do not advance it. Absent until a result is reported. google.protobuf.Timestamp last_reported_time = 106; } + +// Durable provisioning attempt, independent of supervisor registration and polling. +message SandboxProvisioning { + string attempt_id = 1; + string configuration_change_id = 2; + google.protobuf.Timestamp configuration_change_time = 3; + google.protobuf.Timestamp first_rejection_time = 4; + // Present only while the repair window is armed. + google.protobuf.Timestamp deadline = 5; + google.protobuf.Timestamp timeout_time = 6; + // Set only after both supervisor and workload compute have been reclaimed. + google.protobuf.Timestamp cleanup_completed_time = 7; + // A safe gateway-authored diagnostic; never a raw driver error. + string cleanup_error = 8; + // Durable backoff for interrupted or failed reclamation. + google.protobuf.Timestamp cleanup_retry_time = 9; + // Attachment edits have their own durable clock; status writes do not change it. + string attachment_change_id = 10; + google.protobuf.Timestamp attachment_change_time = 11; +} diff --git a/proto/sandbox.proto b/proto/sandbox.proto index 8b15056455..2c9d71e879 100644 --- a/proto/sandbox.proto +++ b/proto/sandbox.proto @@ -402,6 +402,13 @@ message GetSandboxConfigResponse { // Gateway-owned attachment identity captured with this desired configuration. // Compare for equality; reattachment invalidates previous installation evidence. string provider_attachment_epoch = 14; + // True only after validating this complete policy/provider composition. + // Missing (older gateway) is deliberately not admission. + bool configuration_admitted = 13; + // Bounded, credential-free admission diagnostic. Empty for admitted policy. + string configuration_error = 16; + // Registration fence for a new supervisor; capture once and retain on retry. + string configuration_instance_id = 15; } // Connection details for one operator-registered supervisor middleware service. diff --git a/sdk/go/openshell/v1/internal/converter/coverage_test.go b/sdk/go/openshell/v1/internal/converter/coverage_test.go index 4777942a02..37ceeb92c0 100644 --- a/sdk/go/openshell/v1/internal/converter/coverage_test.go +++ b/sdk/go/openshell/v1/internal/converter/coverage_test.go @@ -115,22 +115,23 @@ func TestConverterCoversAllProtoFields_SandboxStartup(t *testing.T) { func TestConverterCoversAllProtoFields_SandboxStatus(t *testing.T) { handled := fieldSet{ - "sandbox_name": true, - "agent_pod": true, - "agent_fd": true, - "sandbox_fd": true, - "phase": true, - "conditions": true, - "endpoint_statuses": true, - "current_policy_version": true, - "exit_code": true, - } - // These fields coordinate internal gateway/supervisor lifecycle fencing - // and idempotent status reconciliation. They remain available only through - // the raw protobuf API. - skipped := fieldSet{ - "main_process_instance_id": true, + "sandbox_name": true, + "agent_pod": true, + "agent_fd": true, + "sandbox_fd": true, + "phase": true, + "conditions": true, + "endpoint_statuses": true, + "current_policy_version": true, + "exit_code": true, + "configuration_admission": true, } + // The instance ID coordinates internal gateway/supervisor lifecycle + // fencing. The first-activation marker governs static policy repair. + // Provisioning carries gateway-owned attempt, deadline, and cleanup state; + // the curated API exposes its outcome through phase and conditions. Detailed + // lifecycle bookkeeping remains available through the raw protobuf API. + skipped := fieldSet{"main_process_instance_id": true, "configuration_activated": true, "provisioning": true} assertAllFieldsCovered(t, (&pb.SandboxStatus{}).ProtoReflect().Descriptor(), handled, skipped) } diff --git a/sdk/go/openshell/v1/internal/converter/sandbox.go b/sdk/go/openshell/v1/internal/converter/sandbox.go index ab064c2231..2db7002b73 100644 --- a/sdk/go/openshell/v1/internal/converter/sandbox.go +++ b/sdk/go/openshell/v1/internal/converter/sandbox.go @@ -125,6 +125,25 @@ func sandboxStatusFromProto(status *pb.SandboxStatus) types.SandboxStatus { }) } result.ExitCode = CopyInt32Ptr(status.ExitCode) + if admission := status.GetConfigurationAdmission(); admission != nil { + state := types.ConfigurationAdmissionUnknown + switch admission.GetState() { + case pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_PENDING: + state = types.ConfigurationAdmissionPending + case pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_ACCEPTED: + state = types.ConfigurationAdmissionAccepted + case pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_REJECTED: + state = types.ConfigurationAdmissionRejected + } + result.ConfigurationAdmission = &types.SandboxConfigurationAdmission{ + State: state, + PolicyVersion: admission.GetPolicyVersion(), + PolicyHash: admission.GetPolicyHash(), + ConfigRevision: admission.GetConfigRevision(), + ProviderEnvRevision: admission.GetProviderEnvRevision(), + Error: admission.GetError(), + } + } return result } diff --git a/sdk/go/openshell/v1/internal/converter/sandbox_test.go b/sdk/go/openshell/v1/internal/converter/sandbox_test.go index f80fef832e..81dc260cf8 100644 --- a/sdk/go/openshell/v1/internal/converter/sandbox_test.go +++ b/sdk/go/openshell/v1/internal/converter/sandbox_test.go @@ -19,6 +19,33 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) +func TestSandboxConfigurationAdmissionFromProto(t *testing.T) { + for _, tc := range []struct { + wire pb.ConfigurationAdmissionState + want v1.ConfigurationAdmissionState + }{ + {pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_PENDING, v1.ConfigurationAdmissionPending}, + {pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_ACCEPTED, v1.ConfigurationAdmissionAccepted}, + {pb.ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_REJECTED, v1.ConfigurationAdmissionRejected}, + {pb.ConfigurationAdmissionState(99), v1.ConfigurationAdmissionUnknown}, + } { + t.Run(string(tc.want), func(t *testing.T) { + wire := &pb.SandboxStatus{ConfigurationAdmission: &pb.SandboxConfigurationAdmission{ + State: tc.wire, PolicyVersion: 4, PolicyHash: "hash", ConfigRevision: 5, + ProviderEnvRevision: 6, Error: "invalid endpoint", + }} + got := sandboxStatusFromProto(wire) + assert.Equal(t, &v1.SandboxConfigurationAdmission{ + State: tc.want, PolicyVersion: 4, PolicyHash: "hash", ConfigRevision: 5, + ProviderEnvRevision: 6, Error: "invalid endpoint", + }, got.ConfigurationAdmission) + wire.ConfigurationAdmission.Error = "changed" + assert.Equal(t, "invalid endpoint", got.ConfigurationAdmission.Error) + }) + } + assert.Nil(t, sandboxStatusFromProto(&pb.SandboxStatus{}).ConfigurationAdmission) +} + func TestSandboxFromProto(t *testing.T) { userNS := true gpuCount := uint32(2) diff --git a/sdk/go/openshell/v1/types/sandbox.go b/sdk/go/openshell/v1/types/sandbox.go index 47d4a71b18..8d9436979d 100644 --- a/sdk/go/openshell/v1/types/sandbox.go +++ b/sdk/go/openshell/v1/types/sandbox.go @@ -119,7 +119,30 @@ type SandboxStatus struct { ExitCode *int32 // EndpointStatuses describes configured external tool endpoints and their // last accepted network results, independently of sandbox readiness. - EndpointStatuses []EndpointStatus + EndpointStatuses []EndpointStatus + ConfigurationAdmission *SandboxConfigurationAdmission +} + +// ConfigurationAdmissionState describes validation of an effective configuration. +type ConfigurationAdmissionState string + +// Configuration admission states reported by the gateway. +const ( + ConfigurationAdmissionUnknown ConfigurationAdmissionState = "unknown" + ConfigurationAdmissionPending ConfigurationAdmissionState = "pending" + ConfigurationAdmissionAccepted ConfigurationAdmissionState = "accepted" + ConfigurationAdmissionRejected ConfigurationAdmissionState = "rejected" +) + +// SandboxConfigurationAdmission identifies a validated or rejected configuration. +// Supervisor instance fencing remains available through the raw protobuf API. +type SandboxConfigurationAdmission struct { + State ConfigurationAdmissionState + PolicyVersion uint32 + PolicyHash string + ConfigRevision uint64 + ProviderEnvRevision uint64 + Error string } // EndpointStatus holds a configured tool endpoint and its last accepted network result. diff --git a/sdk/go/proto/openshellv1/openshell.pb.go b/sdk/go/proto/openshellv1/openshell.pb.go index d5f2b8aff4..319344a845 100644 --- a/sdk/go/proto/openshellv1/openshell.pb.go +++ b/sdk/go/proto/openshellv1/openshell.pb.go @@ -674,6 +674,58 @@ func (ProviderProfileCategory) EnumDescriptor() ([]byte, []int) { return file_openshell_proto_rawDescGZIP(), []int{9} } +type ConfigurationAdmissionState int32 + +const ( + ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_UNSPECIFIED ConfigurationAdmissionState = 0 + ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_PENDING ConfigurationAdmissionState = 1 + ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_ACCEPTED ConfigurationAdmissionState = 2 + ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_REJECTED ConfigurationAdmissionState = 3 +) + +// Enum value maps for ConfigurationAdmissionState. +var ( + ConfigurationAdmissionState_name = map[int32]string{ + 0: "CONFIGURATION_ADMISSION_STATE_UNSPECIFIED", + 1: "CONFIGURATION_ADMISSION_STATE_PENDING", + 2: "CONFIGURATION_ADMISSION_STATE_ACCEPTED", + 3: "CONFIGURATION_ADMISSION_STATE_REJECTED", + } + ConfigurationAdmissionState_value = map[string]int32{ + "CONFIGURATION_ADMISSION_STATE_UNSPECIFIED": 0, + "CONFIGURATION_ADMISSION_STATE_PENDING": 1, + "CONFIGURATION_ADMISSION_STATE_ACCEPTED": 2, + "CONFIGURATION_ADMISSION_STATE_REJECTED": 3, + } +) + +func (x ConfigurationAdmissionState) Enum() *ConfigurationAdmissionState { + p := new(ConfigurationAdmissionState) + *p = x + return p +} + +func (x ConfigurationAdmissionState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConfigurationAdmissionState) Descriptor() protoreflect.EnumDescriptor { + return file_openshell_proto_enumTypes[10].Descriptor() +} + +func (ConfigurationAdmissionState) Type() protoreflect.EnumType { + return &file_openshell_proto_enumTypes[10] +} + +func (x ConfigurationAdmissionState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConfigurationAdmissionState.Descriptor instead. +func (ConfigurationAdmissionState) EnumDescriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{10} +} + // Policy load status. type PolicyStatus int32 @@ -720,11 +772,11 @@ func (x PolicyStatus) String() string { } func (PolicyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[10].Descriptor() + return file_openshell_proto_enumTypes[11].Descriptor() } func (PolicyStatus) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[10] + return &file_openshell_proto_enumTypes[11] } func (x PolicyStatus) Number() protoreflect.EnumNumber { @@ -733,7 +785,7 @@ func (x PolicyStatus) Number() protoreflect.EnumNumber { // Deprecated: Use PolicyStatus.Descriptor instead. func (PolicyStatus) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{10} + return file_openshell_proto_rawDescGZIP(), []int{11} } // Service status enum. @@ -773,11 +825,11 @@ func (x ServiceStatus) String() string { } func (ServiceStatus) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[11].Descriptor() + return file_openshell_proto_enumTypes[12].Descriptor() } func (ServiceStatus) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[11] + return &file_openshell_proto_enumTypes[12] } func (x ServiceStatus) Number() protoreflect.EnumNumber { @@ -786,7 +838,7 @@ func (x ServiceStatus) Number() protoreflect.EnumNumber { // Deprecated: Use ServiceStatus.Descriptor instead. func (ServiceStatus) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{11} + return file_openshell_proto_rawDescGZIP(), []int{12} } // Workspace-scoped role for members. @@ -823,11 +875,11 @@ func (x WorkspaceRole) String() string { } func (WorkspaceRole) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[12].Descriptor() + return file_openshell_proto_enumTypes[13].Descriptor() } func (WorkspaceRole) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[12] + return &file_openshell_proto_enumTypes[13] } func (x WorkspaceRole) Number() protoreflect.EnumNumber { @@ -836,7 +888,7 @@ func (x WorkspaceRole) Number() protoreflect.EnumNumber { // Deprecated: Use WorkspaceRole.Descriptor instead. func (WorkspaceRole) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{12} + return file_openshell_proto_rawDescGZIP(), []int{13} } // Stable recovery action for the most recent provider credential refresh @@ -882,11 +934,11 @@ func (x ProviderCredentialRefreshRecoveryAction) String() string { } func (ProviderCredentialRefreshRecoveryAction) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[13].Descriptor() + return file_openshell_proto_enumTypes[14].Descriptor() } func (ProviderCredentialRefreshRecoveryAction) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[13] + return &file_openshell_proto_enumTypes[14] } func (x ProviderCredentialRefreshRecoveryAction) Number() protoreflect.EnumNumber { @@ -895,7 +947,7 @@ func (x ProviderCredentialRefreshRecoveryAction) Number() protoreflect.EnumNumbe // Deprecated: Use ProviderCredentialRefreshRecoveryAction.Descriptor instead. func (ProviderCredentialRefreshRecoveryAction) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{13} + return file_openshell_proto_rawDescGZIP(), []int{14} } // Result of a public delete, membership removal, or session revocation. @@ -945,11 +997,11 @@ func (x DeletionOutcome) String() string { } func (DeletionOutcome) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[14].Descriptor() + return file_openshell_proto_enumTypes[15].Descriptor() } func (DeletionOutcome) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[14] + return &file_openshell_proto_enumTypes[15] } func (x DeletionOutcome) Number() protoreflect.EnumNumber { @@ -958,7 +1010,7 @@ func (x DeletionOutcome) Number() protoreflect.EnumNumber { // Deprecated: Use DeletionOutcome.Descriptor instead. func (DeletionOutcome) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{14} + return file_openshell_proto_rawDescGZIP(), []int{15} } // Last observed network result for a configured external tool endpoint. @@ -1019,11 +1071,11 @@ func (x EndpointResult) String() string { } func (EndpointResult) Descriptor() protoreflect.EnumDescriptor { - return file_openshell_proto_enumTypes[15].Descriptor() + return file_openshell_proto_enumTypes[16].Descriptor() } func (EndpointResult) Type() protoreflect.EnumType { - return &file_openshell_proto_enumTypes[15] + return &file_openshell_proto_enumTypes[16] } func (x EndpointResult) Number() protoreflect.EnumNumber { @@ -1032,7 +1084,7 @@ func (x EndpointResult) Number() protoreflect.EnumNumber { // Deprecated: Use EndpointResult.Descriptor instead. func (EndpointResult) EnumDescriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{15} + return file_openshell_proto_rawDescGZIP(), []int{16} } // IssueSandboxToken request. Empty body; identity is established by the @@ -2775,8 +2827,14 @@ type SandboxStatus struct { // Currently populated for MCP-over-HTTP endpoints. These passive results // remain separate from sandbox lifecycle conditions and readiness. EndpointStatuses []*EndpointStatus `protobuf:"bytes,10,rep,name=endpoint_statuses,json=endpointStatuses,proto3" json:"endpoint_statuses,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Independent of infrastructure phase; retained across driver observations. + ConfigurationAdmission *SandboxConfigurationAdmission `protobuf:"bytes,11,opt,name=configuration_admission,json=configurationAdmission,proto3" json:"configuration_admission,omitempty"` + // Durable first-acceptance marker. Absent on legacy records; never reset by restart. + ConfigurationActivated *bool `protobuf:"varint,12,opt,name=configuration_activated,json=configurationActivated,proto3,oneof" json:"configuration_activated,omitempty"` + // Gateway-owned repair window. Retained after timeout for inspection and retry. + Provisioning *SandboxProvisioning `protobuf:"bytes,13,opt,name=provisioning,proto3" json:"provisioning,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SandboxStatus) Reset() { @@ -2879,6 +2937,27 @@ func (x *SandboxStatus) GetEndpointStatuses() []*EndpointStatus { return nil } +func (x *SandboxStatus) GetConfigurationAdmission() *SandboxConfigurationAdmission { + if x != nil { + return x.ConfigurationAdmission + } + return nil +} + +func (x *SandboxStatus) GetConfigurationActivated() bool { + if x != nil && x.ConfigurationActivated != nil { + return *x.ConfigurationActivated + } + return false +} + +func (x *SandboxStatus) GetProvisioning() *SandboxProvisioning { + if x != nil { + return x.Provisioning + } + return nil +} + // User-facing sandbox condition derived from platform or gateway observations. type SandboxCondition struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -11978,6 +12057,195 @@ func (*ReportPolicyStatusResponse) Descriptor() ([]byte, []int) { return file_openshell_proto_rawDescGZIP(), []int{153} } +type SandboxConfigurationAdmission struct { + state protoimpl.MessageState `protogen:"open.v1"` + InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + State ConfigurationAdmissionState `protobuf:"varint,2,opt,name=state,proto3,enum=openshell.v1.ConfigurationAdmissionState" json:"state,omitempty"` + PolicyVersion uint32 `protobuf:"varint,3,opt,name=policy_version,json=policyVersion,proto3" json:"policy_version,omitempty"` + PolicyHash string `protobuf:"bytes,4,opt,name=policy_hash,json=policyHash,proto3" json:"policy_hash,omitempty"` + ConfigRevision uint64 `protobuf:"varint,5,opt,name=config_revision,json=configRevision,proto3" json:"config_revision,omitempty"` + ProviderEnvRevision uint64 `protobuf:"varint,6,opt,name=provider_env_revision,json=providerEnvRevision,proto3" json:"provider_env_revision,omitempty"` + Error string `protobuf:"bytes,7,opt,name=error,proto3" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SandboxConfigurationAdmission) Reset() { + *x = SandboxConfigurationAdmission{} + mi := &file_openshell_proto_msgTypes[154] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SandboxConfigurationAdmission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SandboxConfigurationAdmission) ProtoMessage() {} + +func (x *SandboxConfigurationAdmission) ProtoReflect() protoreflect.Message { + mi := &file_openshell_proto_msgTypes[154] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SandboxConfigurationAdmission.ProtoReflect.Descriptor instead. +func (*SandboxConfigurationAdmission) Descriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{154} +} + +func (x *SandboxConfigurationAdmission) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *SandboxConfigurationAdmission) GetState() ConfigurationAdmissionState { + if x != nil { + return x.State + } + return ConfigurationAdmissionState_CONFIGURATION_ADMISSION_STATE_UNSPECIFIED +} + +func (x *SandboxConfigurationAdmission) GetPolicyVersion() uint32 { + if x != nil { + return x.PolicyVersion + } + return 0 +} + +func (x *SandboxConfigurationAdmission) GetPolicyHash() string { + if x != nil { + return x.PolicyHash + } + return "" +} + +func (x *SandboxConfigurationAdmission) GetConfigRevision() uint64 { + if x != nil { + return x.ConfigRevision + } + return 0 +} + +func (x *SandboxConfigurationAdmission) GetProviderEnvRevision() uint64 { + if x != nil { + return x.ProviderEnvRevision + } + return 0 +} + +func (x *SandboxConfigurationAdmission) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type ReportSandboxConfigurationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SandboxId string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` + Admission *SandboxConfigurationAdmission `protobuf:"bytes,2,opt,name=admission,proto3" json:"admission,omitempty"` + // Pending registration replaces only this previously observed instance. + ExpectedInstanceId string `protobuf:"bytes,3,opt,name=expected_instance_id,json=expectedInstanceId,proto3" json:"expected_instance_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportSandboxConfigurationRequest) Reset() { + *x = ReportSandboxConfigurationRequest{} + mi := &file_openshell_proto_msgTypes[155] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportSandboxConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportSandboxConfigurationRequest) ProtoMessage() {} + +func (x *ReportSandboxConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_openshell_proto_msgTypes[155] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportSandboxConfigurationRequest.ProtoReflect.Descriptor instead. +func (*ReportSandboxConfigurationRequest) Descriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{155} +} + +func (x *ReportSandboxConfigurationRequest) GetSandboxId() string { + if x != nil { + return x.SandboxId + } + return "" +} + +func (x *ReportSandboxConfigurationRequest) GetAdmission() *SandboxConfigurationAdmission { + if x != nil { + return x.Admission + } + return nil +} + +func (x *ReportSandboxConfigurationRequest) GetExpectedInstanceId() string { + if x != nil { + return x.ExpectedInstanceId + } + return "" +} + +type ReportSandboxConfigurationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ReportSandboxConfigurationResponse) Reset() { + *x = ReportSandboxConfigurationResponse{} + mi := &file_openshell_proto_msgTypes[156] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ReportSandboxConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportSandboxConfigurationResponse) ProtoMessage() {} + +func (x *ReportSandboxConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_openshell_proto_msgTypes[156] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportSandboxConfigurationResponse.ProtoReflect.Descriptor instead. +func (*ReportSandboxConfigurationResponse) Descriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{156} +} + // A versioned policy revision with metadata. type SandboxPolicyRevision struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -12008,7 +12276,7 @@ type SandboxPolicyRevision struct { func (x *SandboxPolicyRevision) Reset() { *x = SandboxPolicyRevision{} - mi := &file_openshell_proto_msgTypes[154] + mi := &file_openshell_proto_msgTypes[157] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12020,7 +12288,7 @@ func (x *SandboxPolicyRevision) String() string { func (*SandboxPolicyRevision) ProtoMessage() {} func (x *SandboxPolicyRevision) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[154] + mi := &file_openshell_proto_msgTypes[157] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12033,7 +12301,7 @@ func (x *SandboxPolicyRevision) ProtoReflect() protoreflect.Message { // Deprecated: Use SandboxPolicyRevision.ProtoReflect.Descriptor instead. func (*SandboxPolicyRevision) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{154} + return file_openshell_proto_rawDescGZIP(), []int{157} } func (x *SandboxPolicyRevision) GetVersion() uint32 { @@ -12113,7 +12381,7 @@ type GetSandboxLogsRequest struct { func (x *GetSandboxLogsRequest) Reset() { *x = GetSandboxLogsRequest{} - mi := &file_openshell_proto_msgTypes[155] + mi := &file_openshell_proto_msgTypes[158] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12125,7 +12393,7 @@ func (x *GetSandboxLogsRequest) String() string { func (*GetSandboxLogsRequest) ProtoMessage() {} func (x *GetSandboxLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[155] + mi := &file_openshell_proto_msgTypes[158] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12138,7 +12406,7 @@ func (x *GetSandboxLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxLogsRequest.ProtoReflect.Descriptor instead. func (*GetSandboxLogsRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{155} + return file_openshell_proto_rawDescGZIP(), []int{158} } func (x *GetSandboxLogsRequest) GetSandboxId() string { @@ -12196,7 +12464,7 @@ type PushSandboxLogsRequest struct { func (x *PushSandboxLogsRequest) Reset() { *x = PushSandboxLogsRequest{} - mi := &file_openshell_proto_msgTypes[156] + mi := &file_openshell_proto_msgTypes[159] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12208,7 +12476,7 @@ func (x *PushSandboxLogsRequest) String() string { func (*PushSandboxLogsRequest) ProtoMessage() {} func (x *PushSandboxLogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[156] + mi := &file_openshell_proto_msgTypes[159] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12221,7 +12489,7 @@ func (x *PushSandboxLogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PushSandboxLogsRequest.ProtoReflect.Descriptor instead. func (*PushSandboxLogsRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{156} + return file_openshell_proto_rawDescGZIP(), []int{159} } func (x *PushSandboxLogsRequest) GetSandboxId() string { @@ -12247,7 +12515,7 @@ type PushSandboxLogsResponse struct { func (x *PushSandboxLogsResponse) Reset() { *x = PushSandboxLogsResponse{} - mi := &file_openshell_proto_msgTypes[157] + mi := &file_openshell_proto_msgTypes[160] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12259,7 +12527,7 @@ func (x *PushSandboxLogsResponse) String() string { func (*PushSandboxLogsResponse) ProtoMessage() {} func (x *PushSandboxLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[157] + mi := &file_openshell_proto_msgTypes[160] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12272,7 +12540,7 @@ func (x *PushSandboxLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PushSandboxLogsResponse.ProtoReflect.Descriptor instead. func (*PushSandboxLogsResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{157} + return file_openshell_proto_rawDescGZIP(), []int{160} } // Get sandbox logs response. @@ -12288,7 +12556,7 @@ type GetSandboxLogsResponse struct { func (x *GetSandboxLogsResponse) Reset() { *x = GetSandboxLogsResponse{} - mi := &file_openshell_proto_msgTypes[158] + mi := &file_openshell_proto_msgTypes[161] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12300,7 +12568,7 @@ func (x *GetSandboxLogsResponse) String() string { func (*GetSandboxLogsResponse) ProtoMessage() {} func (x *GetSandboxLogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[158] + mi := &file_openshell_proto_msgTypes[161] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12313,7 +12581,7 @@ func (x *GetSandboxLogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSandboxLogsResponse.ProtoReflect.Descriptor instead. func (*GetSandboxLogsResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{158} + return file_openshell_proto_rawDescGZIP(), []int{161} } func (x *GetSandboxLogsResponse) GetLogs() []*SandboxLogLine { @@ -12346,7 +12614,7 @@ type SupervisorMessage struct { func (x *SupervisorMessage) Reset() { *x = SupervisorMessage{} - mi := &file_openshell_proto_msgTypes[159] + mi := &file_openshell_proto_msgTypes[162] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12358,7 +12626,7 @@ func (x *SupervisorMessage) String() string { func (*SupervisorMessage) ProtoMessage() {} func (x *SupervisorMessage) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[159] + mi := &file_openshell_proto_msgTypes[162] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12371,7 +12639,7 @@ func (x *SupervisorMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorMessage.ProtoReflect.Descriptor instead. func (*SupervisorMessage) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{159} + return file_openshell_proto_rawDescGZIP(), []int{162} } func (x *SupervisorMessage) GetPayload() isSupervisorMessage_Payload { @@ -12462,7 +12730,7 @@ type GatewayMessage struct { func (x *GatewayMessage) Reset() { *x = GatewayMessage{} - mi := &file_openshell_proto_msgTypes[160] + mi := &file_openshell_proto_msgTypes[163] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12474,7 +12742,7 @@ func (x *GatewayMessage) String() string { func (*GatewayMessage) ProtoMessage() {} func (x *GatewayMessage) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[160] + mi := &file_openshell_proto_msgTypes[163] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12487,7 +12755,7 @@ func (x *GatewayMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use GatewayMessage.ProtoReflect.Descriptor instead. func (*GatewayMessage) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{160} + return file_openshell_proto_rawDescGZIP(), []int{163} } func (x *GatewayMessage) GetPayload() isGatewayMessage_Payload { @@ -12591,7 +12859,7 @@ type SupervisorHello struct { func (x *SupervisorHello) Reset() { *x = SupervisorHello{} - mi := &file_openshell_proto_msgTypes[161] + mi := &file_openshell_proto_msgTypes[164] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12603,7 +12871,7 @@ func (x *SupervisorHello) String() string { func (*SupervisorHello) ProtoMessage() {} func (x *SupervisorHello) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[161] + mi := &file_openshell_proto_msgTypes[164] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12616,7 +12884,7 @@ func (x *SupervisorHello) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorHello.ProtoReflect.Descriptor instead. func (*SupervisorHello) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{161} + return file_openshell_proto_rawDescGZIP(), []int{164} } func (x *SupervisorHello) GetSandboxId() string { @@ -12653,7 +12921,7 @@ type SessionAccepted struct { func (x *SessionAccepted) Reset() { *x = SessionAccepted{} - mi := &file_openshell_proto_msgTypes[162] + mi := &file_openshell_proto_msgTypes[165] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12665,7 +12933,7 @@ func (x *SessionAccepted) String() string { func (*SessionAccepted) ProtoMessage() {} func (x *SessionAccepted) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[162] + mi := &file_openshell_proto_msgTypes[165] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12678,7 +12946,7 @@ func (x *SessionAccepted) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionAccepted.ProtoReflect.Descriptor instead. func (*SessionAccepted) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{162} + return file_openshell_proto_rawDescGZIP(), []int{165} } func (x *SessionAccepted) GetSessionId() string { @@ -12706,7 +12974,7 @@ type SessionRejected struct { func (x *SessionRejected) Reset() { *x = SessionRejected{} - mi := &file_openshell_proto_msgTypes[163] + mi := &file_openshell_proto_msgTypes[166] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12718,7 +12986,7 @@ func (x *SessionRejected) String() string { func (*SessionRejected) ProtoMessage() {} func (x *SessionRejected) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[163] + mi := &file_openshell_proto_msgTypes[166] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12731,7 +12999,7 @@ func (x *SessionRejected) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionRejected.ProtoReflect.Descriptor instead. func (*SessionRejected) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{163} + return file_openshell_proto_rawDescGZIP(), []int{166} } func (x *SessionRejected) GetReason() string { @@ -12750,7 +13018,7 @@ type SupervisorHeartbeat struct { func (x *SupervisorHeartbeat) Reset() { *x = SupervisorHeartbeat{} - mi := &file_openshell_proto_msgTypes[164] + mi := &file_openshell_proto_msgTypes[167] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12762,7 +13030,7 @@ func (x *SupervisorHeartbeat) String() string { func (*SupervisorHeartbeat) ProtoMessage() {} func (x *SupervisorHeartbeat) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[164] + mi := &file_openshell_proto_msgTypes[167] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12775,7 +13043,7 @@ func (x *SupervisorHeartbeat) ProtoReflect() protoreflect.Message { // Deprecated: Use SupervisorHeartbeat.ProtoReflect.Descriptor instead. func (*SupervisorHeartbeat) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{164} + return file_openshell_proto_rawDescGZIP(), []int{167} } // Gateway heartbeat. @@ -12787,7 +13055,7 @@ type GatewayHeartbeat struct { func (x *GatewayHeartbeat) Reset() { *x = GatewayHeartbeat{} - mi := &file_openshell_proto_msgTypes[165] + mi := &file_openshell_proto_msgTypes[168] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12799,7 +13067,7 @@ func (x *GatewayHeartbeat) String() string { func (*GatewayHeartbeat) ProtoMessage() {} func (x *GatewayHeartbeat) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[165] + mi := &file_openshell_proto_msgTypes[168] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12812,7 +13080,7 @@ func (x *GatewayHeartbeat) ProtoReflect() protoreflect.Message { // Deprecated: Use GatewayHeartbeat.ProtoReflect.Descriptor instead. func (*GatewayHeartbeat) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{165} + return file_openshell_proto_rawDescGZIP(), []int{168} } // Terminal result reported before the supervisor shuts down. A successful RPC @@ -12829,7 +13097,7 @@ type ReportMainProcessExitRequest struct { func (x *ReportMainProcessExitRequest) Reset() { *x = ReportMainProcessExitRequest{} - mi := &file_openshell_proto_msgTypes[166] + mi := &file_openshell_proto_msgTypes[169] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12841,7 +13109,7 @@ func (x *ReportMainProcessExitRequest) String() string { func (*ReportMainProcessExitRequest) ProtoMessage() {} func (x *ReportMainProcessExitRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[166] + mi := &file_openshell_proto_msgTypes[169] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12854,7 +13122,7 @@ func (x *ReportMainProcessExitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportMainProcessExitRequest.ProtoReflect.Descriptor instead. func (*ReportMainProcessExitRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{166} + return file_openshell_proto_rawDescGZIP(), []int{169} } func (x *ReportMainProcessExitRequest) GetSandboxId() string { @@ -12886,7 +13154,7 @@ type ReportMainProcessExitResponse struct { func (x *ReportMainProcessExitResponse) Reset() { *x = ReportMainProcessExitResponse{} - mi := &file_openshell_proto_msgTypes[167] + mi := &file_openshell_proto_msgTypes[170] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12898,7 +13166,7 @@ func (x *ReportMainProcessExitResponse) String() string { func (*ReportMainProcessExitResponse) ProtoMessage() {} func (x *ReportMainProcessExitResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[167] + mi := &file_openshell_proto_msgTypes[170] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12911,7 +13179,7 @@ func (x *ReportMainProcessExitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportMainProcessExitResponse.ProtoReflect.Descriptor instead. func (*ReportMainProcessExitResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{167} + return file_openshell_proto_rawDescGZIP(), []int{170} } // Terminal-delivery completion reported after all expected foreground SSH @@ -12926,7 +13194,7 @@ type FinalizeMainProcessExitRequest struct { func (x *FinalizeMainProcessExitRequest) Reset() { *x = FinalizeMainProcessExitRequest{} - mi := &file_openshell_proto_msgTypes[168] + mi := &file_openshell_proto_msgTypes[171] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12938,7 +13206,7 @@ func (x *FinalizeMainProcessExitRequest) String() string { func (*FinalizeMainProcessExitRequest) ProtoMessage() {} func (x *FinalizeMainProcessExitRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[168] + mi := &file_openshell_proto_msgTypes[171] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12951,7 +13219,7 @@ func (x *FinalizeMainProcessExitRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeMainProcessExitRequest.ProtoReflect.Descriptor instead. func (*FinalizeMainProcessExitRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{168} + return file_openshell_proto_rawDescGZIP(), []int{171} } func (x *FinalizeMainProcessExitRequest) GetSandboxId() string { @@ -12976,7 +13244,7 @@ type FinalizeMainProcessExitResponse struct { func (x *FinalizeMainProcessExitResponse) Reset() { *x = FinalizeMainProcessExitResponse{} - mi := &file_openshell_proto_msgTypes[169] + mi := &file_openshell_proto_msgTypes[172] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12988,7 +13256,7 @@ func (x *FinalizeMainProcessExitResponse) String() string { func (*FinalizeMainProcessExitResponse) ProtoMessage() {} func (x *FinalizeMainProcessExitResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[169] + mi := &file_openshell_proto_msgTypes[172] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13001,7 +13269,7 @@ func (x *FinalizeMainProcessExitResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeMainProcessExitResponse.ProtoReflect.Descriptor instead. func (*FinalizeMainProcessExitResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{169} + return file_openshell_proto_rawDescGZIP(), []int{172} } // Gateway requests the supervisor to open a relay channel. @@ -13030,7 +13298,7 @@ type RelayOpen struct { func (x *RelayOpen) Reset() { *x = RelayOpen{} - mi := &file_openshell_proto_msgTypes[170] + mi := &file_openshell_proto_msgTypes[173] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13042,7 +13310,7 @@ func (x *RelayOpen) String() string { func (*RelayOpen) ProtoMessage() {} func (x *RelayOpen) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[170] + mi := &file_openshell_proto_msgTypes[173] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13055,7 +13323,7 @@ func (x *RelayOpen) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayOpen.ProtoReflect.Descriptor instead. func (*RelayOpen) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{170} + return file_openshell_proto_rawDescGZIP(), []int{173} } func (x *RelayOpen) GetChannelId() string { @@ -13122,7 +13390,7 @@ type SshRelayTarget struct { func (x *SshRelayTarget) Reset() { *x = SshRelayTarget{} - mi := &file_openshell_proto_msgTypes[171] + mi := &file_openshell_proto_msgTypes[174] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13134,7 +13402,7 @@ func (x *SshRelayTarget) String() string { func (*SshRelayTarget) ProtoMessage() {} func (x *SshRelayTarget) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[171] + mi := &file_openshell_proto_msgTypes[174] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13147,7 +13415,7 @@ func (x *SshRelayTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use SshRelayTarget.ProtoReflect.Descriptor instead. func (*SshRelayTarget) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{171} + return file_openshell_proto_rawDescGZIP(), []int{174} } // TCP target dialed by the supervisor from inside the sandbox. @@ -13163,7 +13431,7 @@ type TcpRelayTarget struct { func (x *TcpRelayTarget) Reset() { *x = TcpRelayTarget{} - mi := &file_openshell_proto_msgTypes[172] + mi := &file_openshell_proto_msgTypes[175] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13175,7 +13443,7 @@ func (x *TcpRelayTarget) String() string { func (*TcpRelayTarget) ProtoMessage() {} func (x *TcpRelayTarget) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[172] + mi := &file_openshell_proto_msgTypes[175] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13188,7 +13456,7 @@ func (x *TcpRelayTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use TcpRelayTarget.ProtoReflect.Descriptor instead. func (*TcpRelayTarget) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{172} + return file_openshell_proto_rawDescGZIP(), []int{175} } func (x *TcpRelayTarget) GetHost() string { @@ -13216,7 +13484,7 @@ type RelayInit struct { func (x *RelayInit) Reset() { *x = RelayInit{} - mi := &file_openshell_proto_msgTypes[173] + mi := &file_openshell_proto_msgTypes[176] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13228,7 +13496,7 @@ func (x *RelayInit) String() string { func (*RelayInit) ProtoMessage() {} func (x *RelayInit) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[173] + mi := &file_openshell_proto_msgTypes[176] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13241,7 +13509,7 @@ func (x *RelayInit) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayInit.ProtoReflect.Descriptor instead. func (*RelayInit) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{173} + return file_openshell_proto_rawDescGZIP(), []int{176} } func (x *RelayInit) GetChannelId() string { @@ -13268,7 +13536,7 @@ type RelayFrame struct { func (x *RelayFrame) Reset() { *x = RelayFrame{} - mi := &file_openshell_proto_msgTypes[174] + mi := &file_openshell_proto_msgTypes[177] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13280,7 +13548,7 @@ func (x *RelayFrame) String() string { func (*RelayFrame) ProtoMessage() {} func (x *RelayFrame) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[174] + mi := &file_openshell_proto_msgTypes[177] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13293,7 +13561,7 @@ func (x *RelayFrame) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayFrame.ProtoReflect.Descriptor instead. func (*RelayFrame) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{174} + return file_openshell_proto_rawDescGZIP(), []int{177} } func (x *RelayFrame) GetPayload() isRelayFrame_Payload { @@ -13352,7 +13620,7 @@ type RelayOpenResult struct { func (x *RelayOpenResult) Reset() { *x = RelayOpenResult{} - mi := &file_openshell_proto_msgTypes[175] + mi := &file_openshell_proto_msgTypes[178] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13364,7 +13632,7 @@ func (x *RelayOpenResult) String() string { func (*RelayOpenResult) ProtoMessage() {} func (x *RelayOpenResult) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[175] + mi := &file_openshell_proto_msgTypes[178] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13377,7 +13645,7 @@ func (x *RelayOpenResult) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayOpenResult.ProtoReflect.Descriptor instead. func (*RelayOpenResult) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{175} + return file_openshell_proto_rawDescGZIP(), []int{178} } func (x *RelayOpenResult) GetChannelId() string { @@ -13414,7 +13682,7 @@ type RelayClose struct { func (x *RelayClose) Reset() { *x = RelayClose{} - mi := &file_openshell_proto_msgTypes[176] + mi := &file_openshell_proto_msgTypes[179] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13426,7 +13694,7 @@ func (x *RelayClose) String() string { func (*RelayClose) ProtoMessage() {} func (x *RelayClose) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[176] + mi := &file_openshell_proto_msgTypes[179] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13439,7 +13707,7 @@ func (x *RelayClose) ProtoReflect() protoreflect.Message { // Deprecated: Use RelayClose.ProtoReflect.Descriptor instead. func (*RelayClose) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{176} + return file_openshell_proto_rawDescGZIP(), []int{179} } func (x *RelayClose) GetChannelId() string { @@ -13473,7 +13741,7 @@ type L7RequestSample struct { func (x *L7RequestSample) Reset() { *x = L7RequestSample{} - mi := &file_openshell_proto_msgTypes[177] + mi := &file_openshell_proto_msgTypes[180] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13485,7 +13753,7 @@ func (x *L7RequestSample) String() string { func (*L7RequestSample) ProtoMessage() {} func (x *L7RequestSample) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[177] + mi := &file_openshell_proto_msgTypes[180] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13498,7 +13766,7 @@ func (x *L7RequestSample) ProtoReflect() protoreflect.Message { // Deprecated: Use L7RequestSample.ProtoReflect.Descriptor instead. func (*L7RequestSample) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{177} + return file_openshell_proto_rawDescGZIP(), []int{180} } func (x *L7RequestSample) GetMethod() string { @@ -13572,7 +13840,7 @@ type DenialSummary struct { func (x *DenialSummary) Reset() { *x = DenialSummary{} - mi := &file_openshell_proto_msgTypes[178] + mi := &file_openshell_proto_msgTypes[181] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13584,7 +13852,7 @@ func (x *DenialSummary) String() string { func (*DenialSummary) ProtoMessage() {} func (x *DenialSummary) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[178] + mi := &file_openshell_proto_msgTypes[181] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13597,7 +13865,7 @@ func (x *DenialSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use DenialSummary.ProtoReflect.Descriptor instead. func (*DenialSummary) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{178} + return file_openshell_proto_rawDescGZIP(), []int{181} } func (x *DenialSummary) GetSandboxId() string { @@ -13732,7 +14000,7 @@ type DenialGroupCount struct { func (x *DenialGroupCount) Reset() { *x = DenialGroupCount{} - mi := &file_openshell_proto_msgTypes[179] + mi := &file_openshell_proto_msgTypes[182] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13744,7 +14012,7 @@ func (x *DenialGroupCount) String() string { func (*DenialGroupCount) ProtoMessage() {} func (x *DenialGroupCount) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[179] + mi := &file_openshell_proto_msgTypes[182] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13757,7 +14025,7 @@ func (x *DenialGroupCount) ProtoReflect() protoreflect.Message { // Deprecated: Use DenialGroupCount.ProtoReflect.Descriptor instead. func (*DenialGroupCount) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{179} + return file_openshell_proto_rawDescGZIP(), []int{182} } func (x *DenialGroupCount) GetDenyGroup() string { @@ -13790,7 +14058,7 @@ type NetworkActivitySummary struct { func (x *NetworkActivitySummary) Reset() { *x = NetworkActivitySummary{} - mi := &file_openshell_proto_msgTypes[180] + mi := &file_openshell_proto_msgTypes[183] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13802,7 +14070,7 @@ func (x *NetworkActivitySummary) String() string { func (*NetworkActivitySummary) ProtoMessage() {} func (x *NetworkActivitySummary) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[180] + mi := &file_openshell_proto_msgTypes[183] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13815,7 +14083,7 @@ func (x *NetworkActivitySummary) ProtoReflect() protoreflect.Message { // Deprecated: Use NetworkActivitySummary.ProtoReflect.Descriptor instead. func (*NetworkActivitySummary) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{180} + return file_openshell_proto_rawDescGZIP(), []int{183} } func (x *NetworkActivitySummary) GetNetworkActivityCount() uint32 { @@ -13903,7 +14171,7 @@ type PolicyChunk struct { func (x *PolicyChunk) Reset() { *x = PolicyChunk{} - mi := &file_openshell_proto_msgTypes[181] + mi := &file_openshell_proto_msgTypes[184] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13915,7 +14183,7 @@ func (x *PolicyChunk) String() string { func (*PolicyChunk) ProtoMessage() {} func (x *PolicyChunk) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[181] + mi := &file_openshell_proto_msgTypes[184] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13928,7 +14196,7 @@ func (x *PolicyChunk) ProtoReflect() protoreflect.Message { // Deprecated: Use PolicyChunk.ProtoReflect.Descriptor instead. func (*PolicyChunk) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{181} + return file_openshell_proto_rawDescGZIP(), []int{184} } func (x *PolicyChunk) GetId() string { @@ -14116,7 +14384,7 @@ type DraftPolicyUpdate struct { func (x *DraftPolicyUpdate) Reset() { *x = DraftPolicyUpdate{} - mi := &file_openshell_proto_msgTypes[182] + mi := &file_openshell_proto_msgTypes[185] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14128,7 +14396,7 @@ func (x *DraftPolicyUpdate) String() string { func (*DraftPolicyUpdate) ProtoMessage() {} func (x *DraftPolicyUpdate) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[182] + mi := &file_openshell_proto_msgTypes[185] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14141,7 +14409,7 @@ func (x *DraftPolicyUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftPolicyUpdate.ProtoReflect.Descriptor instead. func (*DraftPolicyUpdate) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{182} + return file_openshell_proto_rawDescGZIP(), []int{185} } func (x *DraftPolicyUpdate) GetDraftVersion() uint64 { @@ -14199,7 +14467,7 @@ type SubmitPolicyAnalysisRequest struct { func (x *SubmitPolicyAnalysisRequest) Reset() { *x = SubmitPolicyAnalysisRequest{} - mi := &file_openshell_proto_msgTypes[183] + mi := &file_openshell_proto_msgTypes[186] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14211,7 +14479,7 @@ func (x *SubmitPolicyAnalysisRequest) String() string { func (*SubmitPolicyAnalysisRequest) ProtoMessage() {} func (x *SubmitPolicyAnalysisRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[183] + mi := &file_openshell_proto_msgTypes[186] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14224,7 +14492,7 @@ func (x *SubmitPolicyAnalysisRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitPolicyAnalysisRequest.ProtoReflect.Descriptor instead. func (*SubmitPolicyAnalysisRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{183} + return file_openshell_proto_rawDescGZIP(), []int{186} } func (x *SubmitPolicyAnalysisRequest) GetSummaries() []*DenialSummary { @@ -14287,7 +14555,7 @@ type SubmitPolicyAnalysisResponse struct { func (x *SubmitPolicyAnalysisResponse) Reset() { *x = SubmitPolicyAnalysisResponse{} - mi := &file_openshell_proto_msgTypes[184] + mi := &file_openshell_proto_msgTypes[187] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14299,7 +14567,7 @@ func (x *SubmitPolicyAnalysisResponse) String() string { func (*SubmitPolicyAnalysisResponse) ProtoMessage() {} func (x *SubmitPolicyAnalysisResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[184] + mi := &file_openshell_proto_msgTypes[187] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14312,7 +14580,7 @@ func (x *SubmitPolicyAnalysisResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitPolicyAnalysisResponse.ProtoReflect.Descriptor instead. func (*SubmitPolicyAnalysisResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{184} + return file_openshell_proto_rawDescGZIP(), []int{187} } func (x *SubmitPolicyAnalysisResponse) GetAcceptedChunks() uint32 { @@ -14358,7 +14626,7 @@ type GetDraftPolicyRequest struct { func (x *GetDraftPolicyRequest) Reset() { *x = GetDraftPolicyRequest{} - mi := &file_openshell_proto_msgTypes[185] + mi := &file_openshell_proto_msgTypes[188] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14370,7 +14638,7 @@ func (x *GetDraftPolicyRequest) String() string { func (*GetDraftPolicyRequest) ProtoMessage() {} func (x *GetDraftPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[185] + mi := &file_openshell_proto_msgTypes[188] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14383,7 +14651,7 @@ func (x *GetDraftPolicyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftPolicyRequest.ProtoReflect.Descriptor instead. func (*GetDraftPolicyRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{185} + return file_openshell_proto_rawDescGZIP(), []int{188} } func (x *GetDraftPolicyRequest) GetName() string { @@ -14423,7 +14691,7 @@ type GetDraftPolicyResponse struct { func (x *GetDraftPolicyResponse) Reset() { *x = GetDraftPolicyResponse{} - mi := &file_openshell_proto_msgTypes[186] + mi := &file_openshell_proto_msgTypes[189] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14435,7 +14703,7 @@ func (x *GetDraftPolicyResponse) String() string { func (*GetDraftPolicyResponse) ProtoMessage() {} func (x *GetDraftPolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[186] + mi := &file_openshell_proto_msgTypes[189] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14448,7 +14716,7 @@ func (x *GetDraftPolicyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftPolicyResponse.ProtoReflect.Descriptor instead. func (*GetDraftPolicyResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{186} + return file_openshell_proto_rawDescGZIP(), []int{189} } func (x *GetDraftPolicyResponse) GetChunks() []*PolicyChunk { @@ -14500,7 +14768,7 @@ type ApproveDraftChunkRequest struct { func (x *ApproveDraftChunkRequest) Reset() { *x = ApproveDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[187] + mi := &file_openshell_proto_msgTypes[190] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14512,7 +14780,7 @@ func (x *ApproveDraftChunkRequest) String() string { func (*ApproveDraftChunkRequest) ProtoMessage() {} func (x *ApproveDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[187] + mi := &file_openshell_proto_msgTypes[190] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14525,7 +14793,7 @@ func (x *ApproveDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveDraftChunkRequest.ProtoReflect.Descriptor instead. func (*ApproveDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{187} + return file_openshell_proto_rawDescGZIP(), []int{190} } func (x *ApproveDraftChunkRequest) GetName() string { @@ -14575,7 +14843,7 @@ type ApproveDraftChunkResponse struct { func (x *ApproveDraftChunkResponse) Reset() { *x = ApproveDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[188] + mi := &file_openshell_proto_msgTypes[191] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14587,7 +14855,7 @@ func (x *ApproveDraftChunkResponse) String() string { func (*ApproveDraftChunkResponse) ProtoMessage() {} func (x *ApproveDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[188] + mi := &file_openshell_proto_msgTypes[191] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14600,7 +14868,7 @@ func (x *ApproveDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveDraftChunkResponse.ProtoReflect.Descriptor instead. func (*ApproveDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{188} + return file_openshell_proto_rawDescGZIP(), []int{191} } func (x *ApproveDraftChunkResponse) GetPolicyVersion() uint32 { @@ -14637,7 +14905,7 @@ type RejectDraftChunkRequest struct { func (x *RejectDraftChunkRequest) Reset() { *x = RejectDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[189] + mi := &file_openshell_proto_msgTypes[192] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14649,7 +14917,7 @@ func (x *RejectDraftChunkRequest) String() string { func (*RejectDraftChunkRequest) ProtoMessage() {} func (x *RejectDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[189] + mi := &file_openshell_proto_msgTypes[192] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14662,7 +14930,7 @@ func (x *RejectDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RejectDraftChunkRequest.ProtoReflect.Descriptor instead. func (*RejectDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{189} + return file_openshell_proto_rawDescGZIP(), []int{192} } func (x *RejectDraftChunkRequest) GetName() string { @@ -14708,7 +14976,7 @@ type RejectDraftChunkResponse struct { func (x *RejectDraftChunkResponse) Reset() { *x = RejectDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[190] + mi := &file_openshell_proto_msgTypes[193] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14720,7 +14988,7 @@ func (x *RejectDraftChunkResponse) String() string { func (*RejectDraftChunkResponse) ProtoMessage() {} func (x *RejectDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[190] + mi := &file_openshell_proto_msgTypes[193] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14733,7 +15001,7 @@ func (x *RejectDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RejectDraftChunkResponse.ProtoReflect.Descriptor instead. func (*RejectDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{190} + return file_openshell_proto_rawDescGZIP(), []int{193} } // Approve all pending chunks. @@ -14747,7 +15015,7 @@ type DraftChunkApproval struct { func (x *DraftChunkApproval) Reset() { *x = DraftChunkApproval{} - mi := &file_openshell_proto_msgTypes[191] + mi := &file_openshell_proto_msgTypes[194] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14759,7 +15027,7 @@ func (x *DraftChunkApproval) String() string { func (*DraftChunkApproval) ProtoMessage() {} func (x *DraftChunkApproval) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[191] + mi := &file_openshell_proto_msgTypes[194] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14772,7 +15040,7 @@ func (x *DraftChunkApproval) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftChunkApproval.ProtoReflect.Descriptor instead. func (*DraftChunkApproval) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{191} + return file_openshell_proto_rawDescGZIP(), []int{194} } func (x *DraftChunkApproval) GetChunkId() string { @@ -14809,7 +15077,7 @@ type ApproveAllDraftChunksRequest struct { func (x *ApproveAllDraftChunksRequest) Reset() { *x = ApproveAllDraftChunksRequest{} - mi := &file_openshell_proto_msgTypes[192] + mi := &file_openshell_proto_msgTypes[195] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14821,7 +15089,7 @@ func (x *ApproveAllDraftChunksRequest) String() string { func (*ApproveAllDraftChunksRequest) ProtoMessage() {} func (x *ApproveAllDraftChunksRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[192] + mi := &file_openshell_proto_msgTypes[195] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14834,7 +15102,7 @@ func (x *ApproveAllDraftChunksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveAllDraftChunksRequest.ProtoReflect.Descriptor instead. func (*ApproveAllDraftChunksRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{192} + return file_openshell_proto_rawDescGZIP(), []int{195} } func (x *ApproveAllDraftChunksRequest) GetName() string { @@ -14889,7 +15157,7 @@ type ApproveAllDraftChunksResponse struct { func (x *ApproveAllDraftChunksResponse) Reset() { *x = ApproveAllDraftChunksResponse{} - mi := &file_openshell_proto_msgTypes[193] + mi := &file_openshell_proto_msgTypes[196] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14901,7 +15169,7 @@ func (x *ApproveAllDraftChunksResponse) String() string { func (*ApproveAllDraftChunksResponse) ProtoMessage() {} func (x *ApproveAllDraftChunksResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[193] + mi := &file_openshell_proto_msgTypes[196] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14914,7 +15182,7 @@ func (x *ApproveAllDraftChunksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApproveAllDraftChunksResponse.ProtoReflect.Descriptor instead. func (*ApproveAllDraftChunksResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{193} + return file_openshell_proto_rawDescGZIP(), []int{196} } func (x *ApproveAllDraftChunksResponse) GetPolicyVersion() uint32 { @@ -14965,7 +15233,7 @@ type EditDraftChunkRequest struct { func (x *EditDraftChunkRequest) Reset() { *x = EditDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[194] + mi := &file_openshell_proto_msgTypes[197] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14977,7 +15245,7 @@ func (x *EditDraftChunkRequest) String() string { func (*EditDraftChunkRequest) ProtoMessage() {} func (x *EditDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[194] + mi := &file_openshell_proto_msgTypes[197] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14990,7 +15258,7 @@ func (x *EditDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EditDraftChunkRequest.ProtoReflect.Descriptor instead. func (*EditDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{194} + return file_openshell_proto_rawDescGZIP(), []int{197} } func (x *EditDraftChunkRequest) GetName() string { @@ -15036,7 +15304,7 @@ type EditDraftChunkResponse struct { func (x *EditDraftChunkResponse) Reset() { *x = EditDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[195] + mi := &file_openshell_proto_msgTypes[198] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15048,7 +15316,7 @@ func (x *EditDraftChunkResponse) String() string { func (*EditDraftChunkResponse) ProtoMessage() {} func (x *EditDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[195] + mi := &file_openshell_proto_msgTypes[198] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15061,7 +15329,7 @@ func (x *EditDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EditDraftChunkResponse.ProtoReflect.Descriptor instead. func (*EditDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{195} + return file_openshell_proto_rawDescGZIP(), []int{198} } // Reverse an approval (remove merged rule from active policy). @@ -15082,7 +15350,7 @@ type UndoDraftChunkRequest struct { func (x *UndoDraftChunkRequest) Reset() { *x = UndoDraftChunkRequest{} - mi := &file_openshell_proto_msgTypes[196] + mi := &file_openshell_proto_msgTypes[199] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15094,7 +15362,7 @@ func (x *UndoDraftChunkRequest) String() string { func (*UndoDraftChunkRequest) ProtoMessage() {} func (x *UndoDraftChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[196] + mi := &file_openshell_proto_msgTypes[199] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15107,7 +15375,7 @@ func (x *UndoDraftChunkRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDraftChunkRequest.ProtoReflect.Descriptor instead. func (*UndoDraftChunkRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{196} + return file_openshell_proto_rawDescGZIP(), []int{199} } func (x *UndoDraftChunkRequest) GetName() string { @@ -15150,7 +15418,7 @@ type UndoDraftChunkResponse struct { func (x *UndoDraftChunkResponse) Reset() { *x = UndoDraftChunkResponse{} - mi := &file_openshell_proto_msgTypes[197] + mi := &file_openshell_proto_msgTypes[200] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15162,7 +15430,7 @@ func (x *UndoDraftChunkResponse) String() string { func (*UndoDraftChunkResponse) ProtoMessage() {} func (x *UndoDraftChunkResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[197] + mi := &file_openshell_proto_msgTypes[200] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15175,7 +15443,7 @@ func (x *UndoDraftChunkResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDraftChunkResponse.ProtoReflect.Descriptor instead. func (*UndoDraftChunkResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{197} + return file_openshell_proto_rawDescGZIP(), []int{200} } func (x *UndoDraftChunkResponse) GetPolicyVersion() uint32 { @@ -15208,7 +15476,7 @@ type ClearDraftChunksRequest struct { func (x *ClearDraftChunksRequest) Reset() { *x = ClearDraftChunksRequest{} - mi := &file_openshell_proto_msgTypes[198] + mi := &file_openshell_proto_msgTypes[201] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15220,7 +15488,7 @@ func (x *ClearDraftChunksRequest) String() string { func (*ClearDraftChunksRequest) ProtoMessage() {} func (x *ClearDraftChunksRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[198] + mi := &file_openshell_proto_msgTypes[201] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15233,7 +15501,7 @@ func (x *ClearDraftChunksRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearDraftChunksRequest.ProtoReflect.Descriptor instead. func (*ClearDraftChunksRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{198} + return file_openshell_proto_rawDescGZIP(), []int{201} } func (x *ClearDraftChunksRequest) GetName() string { @@ -15267,7 +15535,7 @@ type ClearDraftChunksResponse struct { func (x *ClearDraftChunksResponse) Reset() { *x = ClearDraftChunksResponse{} - mi := &file_openshell_proto_msgTypes[199] + mi := &file_openshell_proto_msgTypes[202] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15279,7 +15547,7 @@ func (x *ClearDraftChunksResponse) String() string { func (*ClearDraftChunksResponse) ProtoMessage() {} func (x *ClearDraftChunksResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[199] + mi := &file_openshell_proto_msgTypes[202] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15292,7 +15560,7 @@ func (x *ClearDraftChunksResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearDraftChunksResponse.ProtoReflect.Descriptor instead. func (*ClearDraftChunksResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{199} + return file_openshell_proto_rawDescGZIP(), []int{202} } func (x *ClearDraftChunksResponse) GetChunksCleared() uint32 { @@ -15315,7 +15583,7 @@ type GetDraftHistoryRequest struct { func (x *GetDraftHistoryRequest) Reset() { *x = GetDraftHistoryRequest{} - mi := &file_openshell_proto_msgTypes[200] + mi := &file_openshell_proto_msgTypes[203] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15327,7 +15595,7 @@ func (x *GetDraftHistoryRequest) String() string { func (*GetDraftHistoryRequest) ProtoMessage() {} func (x *GetDraftHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[200] + mi := &file_openshell_proto_msgTypes[203] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15340,7 +15608,7 @@ func (x *GetDraftHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftHistoryRequest.ProtoReflect.Descriptor instead. func (*GetDraftHistoryRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{200} + return file_openshell_proto_rawDescGZIP(), []int{203} } func (x *GetDraftHistoryRequest) GetName() string { @@ -15374,7 +15642,7 @@ type DraftHistoryEntry struct { func (x *DraftHistoryEntry) Reset() { *x = DraftHistoryEntry{} - mi := &file_openshell_proto_msgTypes[201] + mi := &file_openshell_proto_msgTypes[204] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15386,7 +15654,7 @@ func (x *DraftHistoryEntry) String() string { func (*DraftHistoryEntry) ProtoMessage() {} func (x *DraftHistoryEntry) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[201] + mi := &file_openshell_proto_msgTypes[204] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15399,7 +15667,7 @@ func (x *DraftHistoryEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use DraftHistoryEntry.ProtoReflect.Descriptor instead. func (*DraftHistoryEntry) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{201} + return file_openshell_proto_rawDescGZIP(), []int{204} } func (x *DraftHistoryEntry) GetEventTime() *timestamppb.Timestamp { @@ -15440,7 +15708,7 @@ type GetDraftHistoryResponse struct { func (x *GetDraftHistoryResponse) Reset() { *x = GetDraftHistoryResponse{} - mi := &file_openshell_proto_msgTypes[202] + mi := &file_openshell_proto_msgTypes[205] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15452,7 +15720,7 @@ func (x *GetDraftHistoryResponse) String() string { func (*GetDraftHistoryResponse) ProtoMessage() {} func (x *GetDraftHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[202] + mi := &file_openshell_proto_msgTypes[205] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15465,7 +15733,7 @@ func (x *GetDraftHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetDraftHistoryResponse.ProtoReflect.Descriptor instead. func (*GetDraftHistoryResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{202} + return file_openshell_proto_rawDescGZIP(), []int{205} } func (x *GetDraftHistoryResponse) GetEntries() []*DraftHistoryEntry { @@ -15490,7 +15758,7 @@ type CreateWorkspaceRequest struct { func (x *CreateWorkspaceRequest) Reset() { *x = CreateWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[203] + mi := &file_openshell_proto_msgTypes[206] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15502,7 +15770,7 @@ func (x *CreateWorkspaceRequest) String() string { func (*CreateWorkspaceRequest) ProtoMessage() {} func (x *CreateWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[203] + mi := &file_openshell_proto_msgTypes[206] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15515,7 +15783,7 @@ func (x *CreateWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWorkspaceRequest.ProtoReflect.Descriptor instead. func (*CreateWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{203} + return file_openshell_proto_rawDescGZIP(), []int{206} } func (x *CreateWorkspaceRequest) GetName() string { @@ -15549,7 +15817,7 @@ type CreateWorkspaceResponse struct { func (x *CreateWorkspaceResponse) Reset() { *x = CreateWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[204] + mi := &file_openshell_proto_msgTypes[207] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15561,7 +15829,7 @@ func (x *CreateWorkspaceResponse) String() string { func (*CreateWorkspaceResponse) ProtoMessage() {} func (x *CreateWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[204] + mi := &file_openshell_proto_msgTypes[207] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15574,7 +15842,7 @@ func (x *CreateWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWorkspaceResponse.ProtoReflect.Descriptor instead. func (*CreateWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{204} + return file_openshell_proto_rawDescGZIP(), []int{207} } func (x *CreateWorkspaceResponse) GetWorkspace() *datamodelv1.Workspace { @@ -15595,7 +15863,7 @@ type GetWorkspaceRequest struct { func (x *GetWorkspaceRequest) Reset() { *x = GetWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[205] + mi := &file_openshell_proto_msgTypes[208] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15607,7 +15875,7 @@ func (x *GetWorkspaceRequest) String() string { func (*GetWorkspaceRequest) ProtoMessage() {} func (x *GetWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[205] + mi := &file_openshell_proto_msgTypes[208] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15620,7 +15888,7 @@ func (x *GetWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWorkspaceRequest.ProtoReflect.Descriptor instead. func (*GetWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{205} + return file_openshell_proto_rawDescGZIP(), []int{208} } func (x *GetWorkspaceRequest) GetName() string { @@ -15640,7 +15908,7 @@ type GetWorkspaceResponse struct { func (x *GetWorkspaceResponse) Reset() { *x = GetWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[206] + mi := &file_openshell_proto_msgTypes[209] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15652,7 +15920,7 @@ func (x *GetWorkspaceResponse) String() string { func (*GetWorkspaceResponse) ProtoMessage() {} func (x *GetWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[206] + mi := &file_openshell_proto_msgTypes[209] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15665,7 +15933,7 @@ func (x *GetWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetWorkspaceResponse.ProtoReflect.Descriptor instead. func (*GetWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{206} + return file_openshell_proto_rawDescGZIP(), []int{209} } func (x *GetWorkspaceResponse) GetWorkspace() *datamodelv1.Workspace { @@ -15692,7 +15960,7 @@ type ListWorkspacesRequest struct { func (x *ListWorkspacesRequest) Reset() { *x = ListWorkspacesRequest{} - mi := &file_openshell_proto_msgTypes[207] + mi := &file_openshell_proto_msgTypes[210] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15704,7 +15972,7 @@ func (x *ListWorkspacesRequest) String() string { func (*ListWorkspacesRequest) ProtoMessage() {} func (x *ListWorkspacesRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[207] + mi := &file_openshell_proto_msgTypes[210] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15717,7 +15985,7 @@ func (x *ListWorkspacesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspacesRequest.ProtoReflect.Descriptor instead. func (*ListWorkspacesRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{207} + return file_openshell_proto_rawDescGZIP(), []int{210} } func (x *ListWorkspacesRequest) GetPageSize() int32 { @@ -15753,7 +16021,7 @@ type ListWorkspacesResponse struct { func (x *ListWorkspacesResponse) Reset() { *x = ListWorkspacesResponse{} - mi := &file_openshell_proto_msgTypes[208] + mi := &file_openshell_proto_msgTypes[211] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15765,7 +16033,7 @@ func (x *ListWorkspacesResponse) String() string { func (*ListWorkspacesResponse) ProtoMessage() {} func (x *ListWorkspacesResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[208] + mi := &file_openshell_proto_msgTypes[211] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15778,7 +16046,7 @@ func (x *ListWorkspacesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspacesResponse.ProtoReflect.Descriptor instead. func (*ListWorkspacesResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{208} + return file_openshell_proto_rawDescGZIP(), []int{211} } func (x *ListWorkspacesResponse) GetWorkspaces() []*datamodelv1.Workspace { @@ -15809,7 +16077,7 @@ type DeleteWorkspaceRequest struct { func (x *DeleteWorkspaceRequest) Reset() { *x = DeleteWorkspaceRequest{} - mi := &file_openshell_proto_msgTypes[209] + mi := &file_openshell_proto_msgTypes[212] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15821,7 +16089,7 @@ func (x *DeleteWorkspaceRequest) String() string { func (*DeleteWorkspaceRequest) ProtoMessage() {} func (x *DeleteWorkspaceRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[209] + mi := &file_openshell_proto_msgTypes[212] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15834,7 +16102,7 @@ func (x *DeleteWorkspaceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteWorkspaceRequest.ProtoReflect.Descriptor instead. func (*DeleteWorkspaceRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{209} + return file_openshell_proto_rawDescGZIP(), []int{212} } func (x *DeleteWorkspaceRequest) GetName() string { @@ -15868,7 +16136,7 @@ type DeleteWorkspaceResponse struct { func (x *DeleteWorkspaceResponse) Reset() { *x = DeleteWorkspaceResponse{} - mi := &file_openshell_proto_msgTypes[210] + mi := &file_openshell_proto_msgTypes[213] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15880,7 +16148,7 @@ func (x *DeleteWorkspaceResponse) String() string { func (*DeleteWorkspaceResponse) ProtoMessage() {} func (x *DeleteWorkspaceResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[210] + mi := &file_openshell_proto_msgTypes[213] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15893,7 +16161,7 @@ func (x *DeleteWorkspaceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteWorkspaceResponse.ProtoReflect.Descriptor instead. func (*DeleteWorkspaceResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{210} + return file_openshell_proto_rawDescGZIP(), []int{213} } func (x *DeleteWorkspaceResponse) GetOutcome() DeletionOutcome { @@ -15917,7 +16185,7 @@ type WorkspaceMember struct { func (x *WorkspaceMember) Reset() { *x = WorkspaceMember{} - mi := &file_openshell_proto_msgTypes[211] + mi := &file_openshell_proto_msgTypes[214] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15929,7 +16197,7 @@ func (x *WorkspaceMember) String() string { func (*WorkspaceMember) ProtoMessage() {} func (x *WorkspaceMember) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[211] + mi := &file_openshell_proto_msgTypes[214] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15942,7 +16210,7 @@ func (x *WorkspaceMember) ProtoReflect() protoreflect.Message { // Deprecated: Use WorkspaceMember.ProtoReflect.Descriptor instead. func (*WorkspaceMember) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{211} + return file_openshell_proto_rawDescGZIP(), []int{214} } func (x *WorkspaceMember) GetMetadata() *datamodelv1.ObjectMeta { @@ -15983,7 +16251,7 @@ type AddWorkspaceMemberRequest struct { func (x *AddWorkspaceMemberRequest) Reset() { *x = AddWorkspaceMemberRequest{} - mi := &file_openshell_proto_msgTypes[212] + mi := &file_openshell_proto_msgTypes[215] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15995,7 +16263,7 @@ func (x *AddWorkspaceMemberRequest) String() string { func (*AddWorkspaceMemberRequest) ProtoMessage() {} func (x *AddWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[212] + mi := &file_openshell_proto_msgTypes[215] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16008,7 +16276,7 @@ func (x *AddWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddWorkspaceMemberRequest.ProtoReflect.Descriptor instead. func (*AddWorkspaceMemberRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{212} + return file_openshell_proto_rawDescGZIP(), []int{215} } func (x *AddWorkspaceMemberRequest) GetWorkspace() string { @@ -16049,7 +16317,7 @@ type AddWorkspaceMemberResponse struct { func (x *AddWorkspaceMemberResponse) Reset() { *x = AddWorkspaceMemberResponse{} - mi := &file_openshell_proto_msgTypes[213] + mi := &file_openshell_proto_msgTypes[216] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16061,7 +16329,7 @@ func (x *AddWorkspaceMemberResponse) String() string { func (*AddWorkspaceMemberResponse) ProtoMessage() {} func (x *AddWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[213] + mi := &file_openshell_proto_msgTypes[216] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16074,7 +16342,7 @@ func (x *AddWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddWorkspaceMemberResponse.ProtoReflect.Descriptor instead. func (*AddWorkspaceMemberResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{213} + return file_openshell_proto_rawDescGZIP(), []int{216} } func (x *AddWorkspaceMemberResponse) GetMember() *WorkspaceMember { @@ -16100,7 +16368,7 @@ type RemoveWorkspaceMemberRequest struct { func (x *RemoveWorkspaceMemberRequest) Reset() { *x = RemoveWorkspaceMemberRequest{} - mi := &file_openshell_proto_msgTypes[214] + mi := &file_openshell_proto_msgTypes[217] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16112,7 +16380,7 @@ func (x *RemoveWorkspaceMemberRequest) String() string { func (*RemoveWorkspaceMemberRequest) ProtoMessage() {} func (x *RemoveWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[214] + mi := &file_openshell_proto_msgTypes[217] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16125,7 +16393,7 @@ func (x *RemoveWorkspaceMemberRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveWorkspaceMemberRequest.ProtoReflect.Descriptor instead. func (*RemoveWorkspaceMemberRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{214} + return file_openshell_proto_rawDescGZIP(), []int{217} } func (x *RemoveWorkspaceMemberRequest) GetWorkspace() string { @@ -16166,7 +16434,7 @@ type RemoveWorkspaceMemberResponse struct { func (x *RemoveWorkspaceMemberResponse) Reset() { *x = RemoveWorkspaceMemberResponse{} - mi := &file_openshell_proto_msgTypes[215] + mi := &file_openshell_proto_msgTypes[218] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16178,7 +16446,7 @@ func (x *RemoveWorkspaceMemberResponse) String() string { func (*RemoveWorkspaceMemberResponse) ProtoMessage() {} func (x *RemoveWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[215] + mi := &file_openshell_proto_msgTypes[218] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16191,7 +16459,7 @@ func (x *RemoveWorkspaceMemberResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveWorkspaceMemberResponse.ProtoReflect.Descriptor instead. func (*RemoveWorkspaceMemberResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{215} + return file_openshell_proto_rawDescGZIP(), []int{218} } func (x *RemoveWorkspaceMemberResponse) GetOutcome() DeletionOutcome { @@ -16218,7 +16486,7 @@ type ListWorkspaceMembersRequest struct { func (x *ListWorkspaceMembersRequest) Reset() { *x = ListWorkspaceMembersRequest{} - mi := &file_openshell_proto_msgTypes[216] + mi := &file_openshell_proto_msgTypes[219] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16230,7 +16498,7 @@ func (x *ListWorkspaceMembersRequest) String() string { func (*ListWorkspaceMembersRequest) ProtoMessage() {} func (x *ListWorkspaceMembersRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[216] + mi := &file_openshell_proto_msgTypes[219] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16243,7 +16511,7 @@ func (x *ListWorkspaceMembersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspaceMembersRequest.ProtoReflect.Descriptor instead. func (*ListWorkspaceMembersRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{216} + return file_openshell_proto_rawDescGZIP(), []int{219} } func (x *ListWorkspaceMembersRequest) GetWorkspace() string { @@ -16279,7 +16547,7 @@ type ListWorkspaceMembersResponse struct { func (x *ListWorkspaceMembersResponse) Reset() { *x = ListWorkspaceMembersResponse{} - mi := &file_openshell_proto_msgTypes[217] + mi := &file_openshell_proto_msgTypes[220] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16291,7 +16559,7 @@ func (x *ListWorkspaceMembersResponse) String() string { func (*ListWorkspaceMembersResponse) ProtoMessage() {} func (x *ListWorkspaceMembersResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[217] + mi := &file_openshell_proto_msgTypes[220] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16304,7 +16572,7 @@ func (x *ListWorkspaceMembersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorkspaceMembersResponse.ProtoReflect.Descriptor instead. func (*ListWorkspaceMembersResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{217} + return file_openshell_proto_rawDescGZIP(), []int{220} } func (x *ListWorkspaceMembersResponse) GetMembers() []*WorkspaceMember { @@ -16339,7 +16607,7 @@ type ExtensionServiceCredential struct { func (x *ExtensionServiceCredential) Reset() { *x = ExtensionServiceCredential{} - mi := &file_openshell_proto_msgTypes[218] + mi := &file_openshell_proto_msgTypes[221] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16351,7 +16619,7 @@ func (x *ExtensionServiceCredential) String() string { func (*ExtensionServiceCredential) ProtoMessage() {} func (x *ExtensionServiceCredential) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[218] + mi := &file_openshell_proto_msgTypes[221] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16364,7 +16632,7 @@ func (x *ExtensionServiceCredential) ProtoReflect() protoreflect.Message { // Deprecated: Use ExtensionServiceCredential.ProtoReflect.Descriptor instead. func (*ExtensionServiceCredential) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{218} + return file_openshell_proto_rawDescGZIP(), []int{221} } func (x *ExtensionServiceCredential) GetServiceName() string { @@ -16401,7 +16669,7 @@ type EndpointObservation struct { func (x *EndpointObservation) Reset() { *x = EndpointObservation{} - mi := &file_openshell_proto_msgTypes[219] + mi := &file_openshell_proto_msgTypes[222] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16413,7 +16681,7 @@ func (x *EndpointObservation) String() string { func (*EndpointObservation) ProtoMessage() {} func (x *EndpointObservation) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[219] + mi := &file_openshell_proto_msgTypes[222] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16426,7 +16694,7 @@ func (x *EndpointObservation) ProtoReflect() protoreflect.Message { // Deprecated: Use EndpointObservation.ProtoReflect.Descriptor instead. func (*EndpointObservation) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{219} + return file_openshell_proto_rawDescGZIP(), []int{222} } func (x *EndpointObservation) GetEndpointId() string { @@ -16469,7 +16737,7 @@ type ReportEndpointStatusRequest struct { func (x *ReportEndpointStatusRequest) Reset() { *x = ReportEndpointStatusRequest{} - mi := &file_openshell_proto_msgTypes[220] + mi := &file_openshell_proto_msgTypes[223] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16481,7 +16749,7 @@ func (x *ReportEndpointStatusRequest) String() string { func (*ReportEndpointStatusRequest) ProtoMessage() {} func (x *ReportEndpointStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[220] + mi := &file_openshell_proto_msgTypes[223] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16494,7 +16762,7 @@ func (x *ReportEndpointStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportEndpointStatusRequest.ProtoReflect.Descriptor instead. func (*ReportEndpointStatusRequest) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{220} + return file_openshell_proto_rawDescGZIP(), []int{223} } func (x *ReportEndpointStatusRequest) GetSandboxId() string { @@ -16555,7 +16823,7 @@ type ReportEndpointStatusResponse struct { func (x *ReportEndpointStatusResponse) Reset() { *x = ReportEndpointStatusResponse{} - mi := &file_openshell_proto_msgTypes[221] + mi := &file_openshell_proto_msgTypes[224] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16567,7 +16835,7 @@ func (x *ReportEndpointStatusResponse) String() string { func (*ReportEndpointStatusResponse) ProtoMessage() {} func (x *ReportEndpointStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[221] + mi := &file_openshell_proto_msgTypes[224] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16580,7 +16848,7 @@ func (x *ReportEndpointStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReportEndpointStatusResponse.ProtoReflect.Descriptor instead. func (*ReportEndpointStatusResponse) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{221} + return file_openshell_proto_rawDescGZIP(), []int{224} } // A configured endpoint and its last accepted network result in one record. @@ -16609,7 +16877,7 @@ type EndpointStatus struct { func (x *EndpointStatus) Reset() { *x = EndpointStatus{} - mi := &file_openshell_proto_msgTypes[222] + mi := &file_openshell_proto_msgTypes[225] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16621,7 +16889,7 @@ func (x *EndpointStatus) String() string { func (*EndpointStatus) ProtoMessage() {} func (x *EndpointStatus) ProtoReflect() protoreflect.Message { - mi := &file_openshell_proto_msgTypes[222] + mi := &file_openshell_proto_msgTypes[225] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16634,7 +16902,7 @@ func (x *EndpointStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use EndpointStatus.ProtoReflect.Descriptor instead. func (*EndpointStatus) Descriptor() ([]byte, []int) { - return file_openshell_proto_rawDescGZIP(), []int{222} + return file_openshell_proto_rawDescGZIP(), []int{225} } func (x *EndpointStatus) GetEndpointId() string { @@ -16679,6 +16947,136 @@ func (x *EndpointStatus) GetLastReportedTime() *timestamppb.Timestamp { return nil } +// Durable provisioning attempt, independent of supervisor registration and polling. +type SandboxProvisioning struct { + state protoimpl.MessageState `protogen:"open.v1"` + AttemptId string `protobuf:"bytes,1,opt,name=attempt_id,json=attemptId,proto3" json:"attempt_id,omitempty"` + ConfigurationChangeId string `protobuf:"bytes,2,opt,name=configuration_change_id,json=configurationChangeId,proto3" json:"configuration_change_id,omitempty"` + ConfigurationChangeTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=configuration_change_time,json=configurationChangeTime,proto3" json:"configuration_change_time,omitempty"` + FirstRejectionTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=first_rejection_time,json=firstRejectionTime,proto3" json:"first_rejection_time,omitempty"` + // Present only while the repair window is armed. + Deadline *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=deadline,proto3" json:"deadline,omitempty"` + TimeoutTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=timeout_time,json=timeoutTime,proto3" json:"timeout_time,omitempty"` + // Set only after both supervisor and workload compute have been reclaimed. + CleanupCompletedTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=cleanup_completed_time,json=cleanupCompletedTime,proto3" json:"cleanup_completed_time,omitempty"` + // A safe gateway-authored diagnostic; never a raw driver error. + CleanupError string `protobuf:"bytes,8,opt,name=cleanup_error,json=cleanupError,proto3" json:"cleanup_error,omitempty"` + // Durable backoff for interrupted or failed reclamation. + CleanupRetryTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=cleanup_retry_time,json=cleanupRetryTime,proto3" json:"cleanup_retry_time,omitempty"` + // Attachment edits have their own durable clock; status writes do not change it. + AttachmentChangeId string `protobuf:"bytes,10,opt,name=attachment_change_id,json=attachmentChangeId,proto3" json:"attachment_change_id,omitempty"` + AttachmentChangeTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=attachment_change_time,json=attachmentChangeTime,proto3" json:"attachment_change_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SandboxProvisioning) Reset() { + *x = SandboxProvisioning{} + mi := &file_openshell_proto_msgTypes[226] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SandboxProvisioning) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SandboxProvisioning) ProtoMessage() {} + +func (x *SandboxProvisioning) ProtoReflect() protoreflect.Message { + mi := &file_openshell_proto_msgTypes[226] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SandboxProvisioning.ProtoReflect.Descriptor instead. +func (*SandboxProvisioning) Descriptor() ([]byte, []int) { + return file_openshell_proto_rawDescGZIP(), []int{226} +} + +func (x *SandboxProvisioning) GetAttemptId() string { + if x != nil { + return x.AttemptId + } + return "" +} + +func (x *SandboxProvisioning) GetConfigurationChangeId() string { + if x != nil { + return x.ConfigurationChangeId + } + return "" +} + +func (x *SandboxProvisioning) GetConfigurationChangeTime() *timestamppb.Timestamp { + if x != nil { + return x.ConfigurationChangeTime + } + return nil +} + +func (x *SandboxProvisioning) GetFirstRejectionTime() *timestamppb.Timestamp { + if x != nil { + return x.FirstRejectionTime + } + return nil +} + +func (x *SandboxProvisioning) GetDeadline() *timestamppb.Timestamp { + if x != nil { + return x.Deadline + } + return nil +} + +func (x *SandboxProvisioning) GetTimeoutTime() *timestamppb.Timestamp { + if x != nil { + return x.TimeoutTime + } + return nil +} + +func (x *SandboxProvisioning) GetCleanupCompletedTime() *timestamppb.Timestamp { + if x != nil { + return x.CleanupCompletedTime + } + return nil +} + +func (x *SandboxProvisioning) GetCleanupError() string { + if x != nil { + return x.CleanupError + } + return "" +} + +func (x *SandboxProvisioning) GetCleanupRetryTime() *timestamppb.Timestamp { + if x != nil { + return x.CleanupRetryTime + } + return nil +} + +func (x *SandboxProvisioning) GetAttachmentChangeId() string { + if x != nil { + return x.AttachmentChangeId + } + return "" +} + +func (x *SandboxProvisioning) GetAttachmentChangeTime() *timestamppb.Timestamp { + if x != nil { + return x.AttachmentChangeTime + } + return nil +} + var File_openshell_proto protoreflect.FileDescriptor const file_openshell_proto_rawDesc = "" + @@ -16806,7 +17204,7 @@ const file_openshell_proto_rawDesc = "" + "\tmax_burst\x18\x02 \x01(\rR\bmaxBurst\"b\n" + "!SandboxWorkloadTemplateProvenance\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12)\n" + - "\x10resource_version\x18\x02 \x01(\tR\x0fresourceVersion\"\xe5\x03\n" + + "\x10resource_version\x18\x02 \x01(\tR\x0fresourceVersion\"\xec\x05\n" + "\rSandboxStatus\x12!\n" + "\fsandbox_name\x18\x01 \x01(\tR\vsandboxName\x12\x1b\n" + "\tagent_pod\x18\x02 \x01(\tR\bagentPod\x12\x19\n" + @@ -16821,9 +17219,13 @@ const file_openshell_proto_rawDesc = "" + "\x18main_process_instance_id\x18\b \x01(\tR\x15mainProcessInstanceId\x12 \n" + "\texit_code\x18\t \x01(\x05H\x00R\bexitCode\x88\x01\x01\x12I\n" + "\x11endpoint_statuses\x18\n" + - " \x03(\v2\x1c.openshell.v1.EndpointStatusR\x10endpointStatusesB\f\n" + + " \x03(\v2\x1c.openshell.v1.EndpointStatusR\x10endpointStatuses\x12d\n" + + "\x17configuration_admission\x18\v \x01(\v2+.openshell.v1.SandboxConfigurationAdmissionR\x16configurationAdmission\x12<\n" + + "\x17configuration_activated\x18\f \x01(\bH\x01R\x16configurationActivated\x88\x01\x01\x12E\n" + + "\fprovisioning\x18\r \x01(\v2!.openshell.v1.SandboxProvisioningR\fprovisioningB\f\n" + "\n" + - "_exit_code\"\xd1\x01\n" + + "_exit_codeB\x1a\n" + + "\x18_configuration_activated\"\xd1\x01\n" + "\x10SandboxCondition\x12\x12\n" + "\x04type\x18\x01 \x01(\tR\x04type\x12\x16\n" + "\x06status\x18\x02 \x01(\tR\x06status\x12\x16\n" + @@ -17566,7 +17968,23 @@ const file_openshell_proto_rawDesc = "" + "\x06status\x18\x03 \x01(\x0e2\x1a.openshell.v1.PolicyStatusR\x06status\x12\x1d\n" + "\n" + "load_error\x18\x04 \x01(\tR\tloadError\"\x1c\n" + - "\x1aReportPolicyStatusResponse\"\x9b\x04\n" + + "\x1aReportPolicyStatusResponse\"\xbc\x02\n" + + "\x1dSandboxConfigurationAdmission\x12\x1f\n" + + "\vinstance_id\x18\x01 \x01(\tR\n" + + "instanceId\x12?\n" + + "\x05state\x18\x02 \x01(\x0e2).openshell.v1.ConfigurationAdmissionStateR\x05state\x12%\n" + + "\x0epolicy_version\x18\x03 \x01(\rR\rpolicyVersion\x12\x1f\n" + + "\vpolicy_hash\x18\x04 \x01(\tR\n" + + "policyHash\x12'\n" + + "\x0fconfig_revision\x18\x05 \x01(\x04R\x0econfigRevision\x122\n" + + "\x15provider_env_revision\x18\x06 \x01(\x04R\x13providerEnvRevision\x12\x14\n" + + "\x05error\x18\a \x01(\tR\x05error\"\xbf\x01\n" + + "!ReportSandboxConfigurationRequest\x12\x1d\n" + + "\n" + + "sandbox_id\x18\x01 \x01(\tR\tsandboxId\x12I\n" + + "\tadmission\x18\x02 \x01(\v2+.openshell.v1.SandboxConfigurationAdmissionR\tadmission\x120\n" + + "\x14expected_instance_id\x18\x03 \x01(\tR\x12expectedInstanceId\"$\n" + + "\"ReportSandboxConfigurationResponse\"\x9b\x04\n" + "\x15SandboxPolicyRevision\x12\x18\n" + "\aversion\x18\x01 \x01(\rR\aversion\x12\x1f\n" + "\vpolicy_hash\x18\x02 \x01(\tR\n" + @@ -17925,7 +18343,21 @@ const file_openshell_proto_rawDesc = "" + "\x04path\x18\x04 \x01(\tR\x04path\x12=\n" + "\vlast_result\x18\x05 \x01(\x0e2\x1c.openshell.v1.EndpointResultR\n" + "lastResult\x12H\n" + - "\x12last_reported_time\x18j \x01(\v2\x1a.google.protobuf.TimestampR\x10lastReportedTimeJ\x04\b\x06\x10\aR\x10last_reported_at*\xa6\x02\n" + + "\x12last_reported_time\x18j \x01(\v2\x1a.google.protobuf.TimestampR\x10lastReportedTimeJ\x04\b\x06\x10\aR\x10last_reported_at\"\xce\x05\n" + + "\x13SandboxProvisioning\x12\x1d\n" + + "\n" + + "attempt_id\x18\x01 \x01(\tR\tattemptId\x126\n" + + "\x17configuration_change_id\x18\x02 \x01(\tR\x15configurationChangeId\x12V\n" + + "\x19configuration_change_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x17configurationChangeTime\x12L\n" + + "\x14first_rejection_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x12firstRejectionTime\x126\n" + + "\bdeadline\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\bdeadline\x12=\n" + + "\ftimeout_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\vtimeoutTime\x12P\n" + + "\x16cleanup_completed_time\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\x14cleanupCompletedTime\x12#\n" + + "\rcleanup_error\x18\b \x01(\tR\fcleanupError\x12H\n" + + "\x12cleanup_retry_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\x10cleanupRetryTime\x120\n" + + "\x14attachment_change_id\x18\n" + + " \x01(\tR\x12attachmentChangeId\x12P\n" + + "\x16attachment_change_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\x14attachmentChangeTime*\xa6\x02\n" + "\fSandboxPhase\x12\x1d\n" + "\x19SANDBOX_PHASE_UNSPECIFIED\x10\x00\x12\x1e\n" + "\x1aSANDBOX_PHASE_PROVISIONING\x10\x01\x12\x17\n" + @@ -18012,7 +18444,12 @@ const file_openshell_proto_rawDesc = "" + "(PROVIDER_PROFILE_CATEGORY_SOURCE_CONTROL\x10\x04\x12'\n" + "#PROVIDER_PROFILE_CATEGORY_MESSAGING\x10\x05\x12\"\n" + "\x1ePROVIDER_PROFILE_CATEGORY_DATA\x10\x06\x12'\n" + - "#PROVIDER_PROFILE_CATEGORY_KNOWLEDGE\x10\a*\x9a\x01\n" + + "#PROVIDER_PROFILE_CATEGORY_KNOWLEDGE\x10\a*\xcf\x01\n" + + "\x1bConfigurationAdmissionState\x12-\n" + + ")CONFIGURATION_ADMISSION_STATE_UNSPECIFIED\x10\x00\x12)\n" + + "%CONFIGURATION_ADMISSION_STATE_PENDING\x10\x01\x12*\n" + + "&CONFIGURATION_ADMISSION_STATE_ACCEPTED\x10\x02\x12*\n" + + "&CONFIGURATION_ADMISSION_STATE_REJECTED\x10\x03*\x9a\x01\n" + "\fPolicyStatus\x12\x1d\n" + "\x19POLICY_STATUS_UNSPECIFIED\x10\x00\x12\x19\n" + "\x15POLICY_STATUS_PENDING\x10\x01\x12\x18\n" + @@ -18047,7 +18484,7 @@ const file_openshell_proto_rawDesc = "" + "&ENDPOINT_RESULT_CREDENTIAL_UNAVAILABLE\x10\x04\x12\x1e\n" + "\x1aENDPOINT_RESULT_TLS_FAILED\x10\x05\x12$\n" + " ENDPOINT_RESULT_TRANSPORT_FAILED\x10\x06\x12%\n" + - "!ENDPOINT_RESULT_UPSTREAM_REJECTED\x10\a2\xb1P\n" + + "!ENDPOINT_RESULT_UPSTREAM_REJECTED\x10\a2\xc2Q\n" + "\tOpenShell\x12Z\n" + "\x06Health\x12\x1b.openshell.v1.HealthRequest\x1a\x1c.openshell.v1.HealthResponse\"\x15\x82\xb5\x18\x11\n" + "\x0funauthenticated\x12i\n" + @@ -18151,6 +18588,8 @@ const file_openshell_proto_rawDesc = "" + "\x14ReportEndpointStatus\x12).openshell.v1.ReportEndpointStatusRequest\x1a*.openshell.v1.ReportEndpointStatusResponse\"\r\x82\xb5\x18\t\n" + "\asandbox\x12\x85\x01\n" + "\x17ReportProviderReadiness\x12,.openshell.v1.ReportProviderReadinessRequest\x1a-.openshell.v1.ReportProviderReadinessResponse\"\r\x82\xb5\x18\t\n" + + "\asandbox\x12\x8e\x01\n" + + "\x1aReportSandboxConfiguration\x12/.openshell.v1.ReportSandboxConfigurationRequest\x1a0.openshell.v1.ReportSandboxConfigurationResponse\"\r\x82\xb5\x18\t\n" + "\asandbox\x12\x97\x01\n" + "\x1dGetSandboxProviderEnvironment\x122.openshell.v1.GetSandboxProviderEnvironmentRequest\x1a3.openshell.v1.GetSandboxProviderEnvironmentResponse\"\r\x82\xb5\x18\t\n" + "\asandbox\x12\x94\x01\n" + @@ -18219,8 +18658,8 @@ func file_openshell_proto_rawDescGZIP() []byte { return file_openshell_proto_rawDescData } -var file_openshell_proto_enumTypes = make([]protoimpl.EnumInfo, 16) -var file_openshell_proto_msgTypes = make([]protoimpl.MessageInfo, 244) +var file_openshell_proto_enumTypes = make([]protoimpl.EnumInfo, 17) +var file_openshell_proto_msgTypes = make([]protoimpl.MessageInfo, 248) var file_openshell_proto_goTypes = []any{ (SandboxPhase)(0), // 0: openshell.v1.SandboxPhase (ProviderMutationKind)(0), // 1: openshell.v1.ProviderMutationKind @@ -18232,722 +18671,740 @@ var file_openshell_proto_goTypes = []any{ (ProviderCredentialTokenGrantType)(0), // 7: openshell.v1.ProviderCredentialTokenGrantType (ProviderCredentialRefreshStrategy)(0), // 8: openshell.v1.ProviderCredentialRefreshStrategy (ProviderProfileCategory)(0), // 9: openshell.v1.ProviderProfileCategory - (PolicyStatus)(0), // 10: openshell.v1.PolicyStatus - (ServiceStatus)(0), // 11: openshell.v1.ServiceStatus - (WorkspaceRole)(0), // 12: openshell.v1.WorkspaceRole - (ProviderCredentialRefreshRecoveryAction)(0), // 13: openshell.v1.ProviderCredentialRefreshRecoveryAction - (DeletionOutcome)(0), // 14: openshell.v1.DeletionOutcome - (EndpointResult)(0), // 15: openshell.v1.EndpointResult - (*IssueSandboxTokenRequest)(nil), // 16: openshell.v1.IssueSandboxTokenRequest - (*IssueSandboxTokenResponse)(nil), // 17: openshell.v1.IssueSandboxTokenResponse - (*RefreshSandboxTokenRequest)(nil), // 18: openshell.v1.RefreshSandboxTokenRequest - (*RefreshSandboxTokenResponse)(nil), // 19: openshell.v1.RefreshSandboxTokenResponse - (*HealthRequest)(nil), // 20: openshell.v1.HealthRequest - (*HealthResponse)(nil), // 21: openshell.v1.HealthResponse - (*GetCurrentUserRequest)(nil), // 22: openshell.v1.GetCurrentUserRequest - (*GetCurrentUserResponse)(nil), // 23: openshell.v1.GetCurrentUserResponse - (*GetGatewayInfoRequest)(nil), // 24: openshell.v1.GetGatewayInfoRequest - (*GetGatewayInfoResponse)(nil), // 25: openshell.v1.GetGatewayInfoResponse - (*ComputeDriverInfo)(nil), // 26: openshell.v1.ComputeDriverInfo - (*ComputeDriverCapabilities)(nil), // 27: openshell.v1.ComputeDriverCapabilities - (*ResourceCapabilities)(nil), // 28: openshell.v1.ResourceCapabilities - (*CpuResourceCapabilities)(nil), // 29: openshell.v1.CpuResourceCapabilities - (*MemoryResourceCapabilities)(nil), // 30: openshell.v1.MemoryResourceCapabilities - (*GpuResourceCapabilities)(nil), // 31: openshell.v1.GpuResourceCapabilities - (*Sandbox)(nil), // 32: openshell.v1.Sandbox - (*SandboxSpec)(nil), // 33: openshell.v1.SandboxSpec - (*ResourceRequirements)(nil), // 34: openshell.v1.ResourceRequirements - (*GpuResourceRequirements)(nil), // 35: openshell.v1.GpuResourceRequirements - (*SandboxTemplate)(nil), // 36: openshell.v1.SandboxTemplate - (*SandboxWorkloadTemplate)(nil), // 37: openshell.v1.SandboxWorkloadTemplate - (*SandboxWorkloadTemplateSpec)(nil), // 38: openshell.v1.SandboxWorkloadTemplateSpec - (*SandboxWorkloadConfig)(nil), // 39: openshell.v1.SandboxWorkloadConfig - (*SandboxResources)(nil), // 40: openshell.v1.SandboxResources - (*SandboxServiceLevel)(nil), // 41: openshell.v1.SandboxServiceLevel - (*SandboxStartup)(nil), // 42: openshell.v1.SandboxStartup - (*SandboxWorkloadTemplateProvenance)(nil), // 43: openshell.v1.SandboxWorkloadTemplateProvenance - (*SandboxStatus)(nil), // 44: openshell.v1.SandboxStatus - (*SandboxCondition)(nil), // 45: openshell.v1.SandboxCondition - (*PlatformEvent)(nil), // 46: openshell.v1.PlatformEvent - (*CreateSandboxRequest)(nil), // 47: openshell.v1.CreateSandboxRequest - (*CreateSandboxTemplateRequest)(nil), // 48: openshell.v1.CreateSandboxTemplateRequest - (*GetSandboxTemplateRequest)(nil), // 49: openshell.v1.GetSandboxTemplateRequest - (*ListSandboxTemplatesRequest)(nil), // 50: openshell.v1.ListSandboxTemplatesRequest - (*DeleteSandboxTemplateRequest)(nil), // 51: openshell.v1.DeleteSandboxTemplateRequest - (*SandboxTemplateResponse)(nil), // 52: openshell.v1.SandboxTemplateResponse - (*ListSandboxTemplatesResponse)(nil), // 53: openshell.v1.ListSandboxTemplatesResponse - (*DeleteSandboxTemplateResponse)(nil), // 54: openshell.v1.DeleteSandboxTemplateResponse - (*BeginRootfsTarStagingRequest)(nil), // 55: openshell.v1.BeginRootfsTarStagingRequest - (*BeginRootfsTarStagingResponse)(nil), // 56: openshell.v1.BeginRootfsTarStagingResponse - (*GetSandboxRequest)(nil), // 57: openshell.v1.GetSandboxRequest - (*ListSandboxesRequest)(nil), // 58: openshell.v1.ListSandboxesRequest - (*ListSandboxProvidersRequest)(nil), // 59: openshell.v1.ListSandboxProvidersRequest - (*AttachSandboxProviderRequest)(nil), // 60: openshell.v1.AttachSandboxProviderRequest - (*DetachSandboxProviderRequest)(nil), // 61: openshell.v1.DetachSandboxProviderRequest - (*DeleteSandboxRequest)(nil), // 62: openshell.v1.DeleteSandboxRequest - (*StopSandboxRequest)(nil), // 63: openshell.v1.StopSandboxRequest - (*StartSandboxRequest)(nil), // 64: openshell.v1.StartSandboxRequest - (*SandboxResponse)(nil), // 65: openshell.v1.SandboxResponse - (*ListSandboxesResponse)(nil), // 66: openshell.v1.ListSandboxesResponse - (*ListSandboxProvidersResponse)(nil), // 67: openshell.v1.ListSandboxProvidersResponse - (*AttachSandboxProviderResponse)(nil), // 68: openshell.v1.AttachSandboxProviderResponse - (*DetachSandboxProviderResponse)(nil), // 69: openshell.v1.DetachSandboxProviderResponse - (*ProviderDesiredIdentity)(nil), // 70: openshell.v1.ProviderDesiredIdentity - (*ConfigSnapshotRevision)(nil), // 71: openshell.v1.ConfigSnapshotRevision - (*SandboxConfigRevision)(nil), // 72: openshell.v1.SandboxConfigRevision - (*ConfigUpdateOperation)(nil), // 73: openshell.v1.ConfigUpdateOperation - (*ProviderMutationReceipt)(nil), // 74: openshell.v1.ProviderMutationReceipt - (*ProviderReadinessObservation)(nil), // 75: openshell.v1.ProviderReadinessObservation - (*ProviderReadinessStatus)(nil), // 76: openshell.v1.ProviderReadinessStatus - (*GetSandboxProviderStatusRequest)(nil), // 77: openshell.v1.GetSandboxProviderStatusRequest - (*GetSandboxProviderStatusResponse)(nil), // 78: openshell.v1.GetSandboxProviderStatusResponse - (*ReportProviderReadinessRequest)(nil), // 79: openshell.v1.ReportProviderReadinessRequest - (*ReportProviderReadinessResponse)(nil), // 80: openshell.v1.ReportProviderReadinessResponse - (*DeleteSandboxResponse)(nil), // 81: openshell.v1.DeleteSandboxResponse - (*CreateSshSessionRequest)(nil), // 82: openshell.v1.CreateSshSessionRequest - (*CreateSshSessionResponse)(nil), // 83: openshell.v1.CreateSshSessionResponse - (*ExposeServiceRequest)(nil), // 84: openshell.v1.ExposeServiceRequest - (*GetServiceRequest)(nil), // 85: openshell.v1.GetServiceRequest - (*ListServicesRequest)(nil), // 86: openshell.v1.ListServicesRequest - (*ListServicesResponse)(nil), // 87: openshell.v1.ListServicesResponse - (*DeleteServiceRequest)(nil), // 88: openshell.v1.DeleteServiceRequest - (*DeleteServiceResponse)(nil), // 89: openshell.v1.DeleteServiceResponse - (*ServiceEndpoint)(nil), // 90: openshell.v1.ServiceEndpoint - (*ServiceEndpointResponse)(nil), // 91: openshell.v1.ServiceEndpointResponse - (*RevokeSshSessionRequest)(nil), // 92: openshell.v1.RevokeSshSessionRequest - (*RevokeSshSessionResponse)(nil), // 93: openshell.v1.RevokeSshSessionResponse - (*ExecSandboxRequest)(nil), // 94: openshell.v1.ExecSandboxRequest - (*ExecSandboxStdout)(nil), // 95: openshell.v1.ExecSandboxStdout - (*ExecSandboxStderr)(nil), // 96: openshell.v1.ExecSandboxStderr - (*ExecSandboxExit)(nil), // 97: openshell.v1.ExecSandboxExit - (*ExecSandboxEvent)(nil), // 98: openshell.v1.ExecSandboxEvent - (*TcpForwardInit)(nil), // 99: openshell.v1.TcpForwardInit - (*TcpForwardFrame)(nil), // 100: openshell.v1.TcpForwardFrame - (*ExecSandboxInput)(nil), // 101: openshell.v1.ExecSandboxInput - (*ExecSandboxWindowResize)(nil), // 102: openshell.v1.ExecSandboxWindowResize - (*SshSession)(nil), // 103: openshell.v1.SshSession - (*WatchSandboxRequest)(nil), // 104: openshell.v1.WatchSandboxRequest - (*SandboxStreamEvent)(nil), // 105: openshell.v1.SandboxStreamEvent - (*SandboxLogLine)(nil), // 106: openshell.v1.SandboxLogLine - (*SandboxStreamWarning)(nil), // 107: openshell.v1.SandboxStreamWarning - (*CreateProviderRequest)(nil), // 108: openshell.v1.CreateProviderRequest - (*GetProviderRequest)(nil), // 109: openshell.v1.GetProviderRequest - (*ListProvidersRequest)(nil), // 110: openshell.v1.ListProvidersRequest - (*UpdateProviderRequest)(nil), // 111: openshell.v1.UpdateProviderRequest - (*DeleteProviderRequest)(nil), // 112: openshell.v1.DeleteProviderRequest - (*ProviderResponse)(nil), // 113: openshell.v1.ProviderResponse - (*ListProvidersResponse)(nil), // 114: openshell.v1.ListProvidersResponse - (*ListProviderProfilesRequest)(nil), // 115: openshell.v1.ListProviderProfilesRequest - (*GetProviderProfileRequest)(nil), // 116: openshell.v1.GetProviderProfileRequest - (*ProviderProfileImportItem)(nil), // 117: openshell.v1.ProviderProfileImportItem - (*ProviderProfileDiagnostic)(nil), // 118: openshell.v1.ProviderProfileDiagnostic - (*ProviderCredentialTokenGrantAudienceOverride)(nil), // 119: openshell.v1.ProviderCredentialTokenGrantAudienceOverride - (*ProviderCredentialTokenGrantSubjectToken)(nil), // 120: openshell.v1.ProviderCredentialTokenGrantSubjectToken - (*ProviderCredentialTokenGrant)(nil), // 121: openshell.v1.ProviderCredentialTokenGrant - (*ProviderProfileCredential)(nil), // 122: openshell.v1.ProviderProfileCredential - (*ProviderCredentialRefreshMaterial)(nil), // 123: openshell.v1.ProviderCredentialRefreshMaterial - (*ProviderCredentialRefreshOutput)(nil), // 124: openshell.v1.ProviderCredentialRefreshOutput - (*ProviderCredentialRefresh)(nil), // 125: openshell.v1.ProviderCredentialRefresh - (*ProviderCredentialRefreshStatus)(nil), // 126: openshell.v1.ProviderCredentialRefreshStatus - (*ProviderProfileDiscovery)(nil), // 127: openshell.v1.ProviderProfileDiscovery - (*GetProviderRefreshStatusRequest)(nil), // 128: openshell.v1.GetProviderRefreshStatusRequest - (*GetProviderRefreshStatusResponse)(nil), // 129: openshell.v1.GetProviderRefreshStatusResponse - (*ConfigureProviderRefreshRequest)(nil), // 130: openshell.v1.ConfigureProviderRefreshRequest - (*ConfigureProviderRefreshResponse)(nil), // 131: openshell.v1.ConfigureProviderRefreshResponse - (*RotateProviderCredentialRequest)(nil), // 132: openshell.v1.RotateProviderCredentialRequest - (*RotateProviderCredentialResponse)(nil), // 133: openshell.v1.RotateProviderCredentialResponse - (*DeleteProviderRefreshRequest)(nil), // 134: openshell.v1.DeleteProviderRefreshRequest - (*DeleteProviderRefreshResponse)(nil), // 135: openshell.v1.DeleteProviderRefreshResponse - (*ProviderProfile)(nil), // 136: openshell.v1.ProviderProfile - (*ProviderProfileResponse)(nil), // 137: openshell.v1.ProviderProfileResponse - (*ListProviderProfilesResponse)(nil), // 138: openshell.v1.ListProviderProfilesResponse - (*ImportProviderProfilesRequest)(nil), // 139: openshell.v1.ImportProviderProfilesRequest - (*ImportProviderProfilesResponse)(nil), // 140: openshell.v1.ImportProviderProfilesResponse - (*UpdateProviderProfilesRequest)(nil), // 141: openshell.v1.UpdateProviderProfilesRequest - (*UpdateProviderProfilesResponse)(nil), // 142: openshell.v1.UpdateProviderProfilesResponse - (*LintProviderProfilesRequest)(nil), // 143: openshell.v1.LintProviderProfilesRequest - (*LintProviderProfilesResponse)(nil), // 144: openshell.v1.LintProviderProfilesResponse - (*DeleteProviderResponse)(nil), // 145: openshell.v1.DeleteProviderResponse - (*DeleteProviderProfileRequest)(nil), // 146: openshell.v1.DeleteProviderProfileRequest - (*DeleteProviderProfileResponse)(nil), // 147: openshell.v1.DeleteProviderProfileResponse - (*GetSandboxProviderEnvironmentRequest)(nil), // 148: openshell.v1.GetSandboxProviderEnvironmentRequest - (*StaticCredentialEndpointBinding)(nil), // 149: openshell.v1.StaticCredentialEndpointBinding - (*StaticCredentialBinding)(nil), // 150: openshell.v1.StaticCredentialBinding - (*GetSandboxProviderEnvironmentResponse)(nil), // 151: openshell.v1.GetSandboxProviderEnvironmentResponse - (*ExchangeProviderSubjectTokenRequest)(nil), // 152: openshell.v1.ExchangeProviderSubjectTokenRequest - (*ExchangeProviderSubjectTokenResponse)(nil), // 153: openshell.v1.ExchangeProviderSubjectTokenResponse - (*UpdateConfigRequest)(nil), // 154: openshell.v1.UpdateConfigRequest - (*PolicyMergeOperation)(nil), // 155: openshell.v1.PolicyMergeOperation - (*AddNetworkRule)(nil), // 156: openshell.v1.AddNetworkRule - (*RemoveNetworkEndpoint)(nil), // 157: openshell.v1.RemoveNetworkEndpoint - (*RemoveNetworkRule)(nil), // 158: openshell.v1.RemoveNetworkRule - (*L7RuleTarget)(nil), // 159: openshell.v1.L7RuleTarget - (*AddDenyRules)(nil), // 160: openshell.v1.AddDenyRules - (*AddAllowRules)(nil), // 161: openshell.v1.AddAllowRules - (*RemoveNetworkBinary)(nil), // 162: openshell.v1.RemoveNetworkBinary - (*UpdateConfigResponse)(nil), // 163: openshell.v1.UpdateConfigResponse - (*GetSandboxPolicyStatusRequest)(nil), // 164: openshell.v1.GetSandboxPolicyStatusRequest - (*GetSandboxPolicyStatusResponse)(nil), // 165: openshell.v1.GetSandboxPolicyStatusResponse - (*ListSandboxPoliciesRequest)(nil), // 166: openshell.v1.ListSandboxPoliciesRequest - (*ListSandboxPoliciesResponse)(nil), // 167: openshell.v1.ListSandboxPoliciesResponse - (*ReportPolicyStatusRequest)(nil), // 168: openshell.v1.ReportPolicyStatusRequest - (*ReportPolicyStatusResponse)(nil), // 169: openshell.v1.ReportPolicyStatusResponse - (*SandboxPolicyRevision)(nil), // 170: openshell.v1.SandboxPolicyRevision - (*GetSandboxLogsRequest)(nil), // 171: openshell.v1.GetSandboxLogsRequest - (*PushSandboxLogsRequest)(nil), // 172: openshell.v1.PushSandboxLogsRequest - (*PushSandboxLogsResponse)(nil), // 173: openshell.v1.PushSandboxLogsResponse - (*GetSandboxLogsResponse)(nil), // 174: openshell.v1.GetSandboxLogsResponse - (*SupervisorMessage)(nil), // 175: openshell.v1.SupervisorMessage - (*GatewayMessage)(nil), // 176: openshell.v1.GatewayMessage - (*SupervisorHello)(nil), // 177: openshell.v1.SupervisorHello - (*SessionAccepted)(nil), // 178: openshell.v1.SessionAccepted - (*SessionRejected)(nil), // 179: openshell.v1.SessionRejected - (*SupervisorHeartbeat)(nil), // 180: openshell.v1.SupervisorHeartbeat - (*GatewayHeartbeat)(nil), // 181: openshell.v1.GatewayHeartbeat - (*ReportMainProcessExitRequest)(nil), // 182: openshell.v1.ReportMainProcessExitRequest - (*ReportMainProcessExitResponse)(nil), // 183: openshell.v1.ReportMainProcessExitResponse - (*FinalizeMainProcessExitRequest)(nil), // 184: openshell.v1.FinalizeMainProcessExitRequest - (*FinalizeMainProcessExitResponse)(nil), // 185: openshell.v1.FinalizeMainProcessExitResponse - (*RelayOpen)(nil), // 186: openshell.v1.RelayOpen - (*SshRelayTarget)(nil), // 187: openshell.v1.SshRelayTarget - (*TcpRelayTarget)(nil), // 188: openshell.v1.TcpRelayTarget - (*RelayInit)(nil), // 189: openshell.v1.RelayInit - (*RelayFrame)(nil), // 190: openshell.v1.RelayFrame - (*RelayOpenResult)(nil), // 191: openshell.v1.RelayOpenResult - (*RelayClose)(nil), // 192: openshell.v1.RelayClose - (*L7RequestSample)(nil), // 193: openshell.v1.L7RequestSample - (*DenialSummary)(nil), // 194: openshell.v1.DenialSummary - (*DenialGroupCount)(nil), // 195: openshell.v1.DenialGroupCount - (*NetworkActivitySummary)(nil), // 196: openshell.v1.NetworkActivitySummary - (*PolicyChunk)(nil), // 197: openshell.v1.PolicyChunk - (*DraftPolicyUpdate)(nil), // 198: openshell.v1.DraftPolicyUpdate - (*SubmitPolicyAnalysisRequest)(nil), // 199: openshell.v1.SubmitPolicyAnalysisRequest - (*SubmitPolicyAnalysisResponse)(nil), // 200: openshell.v1.SubmitPolicyAnalysisResponse - (*GetDraftPolicyRequest)(nil), // 201: openshell.v1.GetDraftPolicyRequest - (*GetDraftPolicyResponse)(nil), // 202: openshell.v1.GetDraftPolicyResponse - (*ApproveDraftChunkRequest)(nil), // 203: openshell.v1.ApproveDraftChunkRequest - (*ApproveDraftChunkResponse)(nil), // 204: openshell.v1.ApproveDraftChunkResponse - (*RejectDraftChunkRequest)(nil), // 205: openshell.v1.RejectDraftChunkRequest - (*RejectDraftChunkResponse)(nil), // 206: openshell.v1.RejectDraftChunkResponse - (*DraftChunkApproval)(nil), // 207: openshell.v1.DraftChunkApproval - (*ApproveAllDraftChunksRequest)(nil), // 208: openshell.v1.ApproveAllDraftChunksRequest - (*ApproveAllDraftChunksResponse)(nil), // 209: openshell.v1.ApproveAllDraftChunksResponse - (*EditDraftChunkRequest)(nil), // 210: openshell.v1.EditDraftChunkRequest - (*EditDraftChunkResponse)(nil), // 211: openshell.v1.EditDraftChunkResponse - (*UndoDraftChunkRequest)(nil), // 212: openshell.v1.UndoDraftChunkRequest - (*UndoDraftChunkResponse)(nil), // 213: openshell.v1.UndoDraftChunkResponse - (*ClearDraftChunksRequest)(nil), // 214: openshell.v1.ClearDraftChunksRequest - (*ClearDraftChunksResponse)(nil), // 215: openshell.v1.ClearDraftChunksResponse - (*GetDraftHistoryRequest)(nil), // 216: openshell.v1.GetDraftHistoryRequest - (*DraftHistoryEntry)(nil), // 217: openshell.v1.DraftHistoryEntry - (*GetDraftHistoryResponse)(nil), // 218: openshell.v1.GetDraftHistoryResponse - (*CreateWorkspaceRequest)(nil), // 219: openshell.v1.CreateWorkspaceRequest - (*CreateWorkspaceResponse)(nil), // 220: openshell.v1.CreateWorkspaceResponse - (*GetWorkspaceRequest)(nil), // 221: openshell.v1.GetWorkspaceRequest - (*GetWorkspaceResponse)(nil), // 222: openshell.v1.GetWorkspaceResponse - (*ListWorkspacesRequest)(nil), // 223: openshell.v1.ListWorkspacesRequest - (*ListWorkspacesResponse)(nil), // 224: openshell.v1.ListWorkspacesResponse - (*DeleteWorkspaceRequest)(nil), // 225: openshell.v1.DeleteWorkspaceRequest - (*DeleteWorkspaceResponse)(nil), // 226: openshell.v1.DeleteWorkspaceResponse - (*WorkspaceMember)(nil), // 227: openshell.v1.WorkspaceMember - (*AddWorkspaceMemberRequest)(nil), // 228: openshell.v1.AddWorkspaceMemberRequest - (*AddWorkspaceMemberResponse)(nil), // 229: openshell.v1.AddWorkspaceMemberResponse - (*RemoveWorkspaceMemberRequest)(nil), // 230: openshell.v1.RemoveWorkspaceMemberRequest - (*RemoveWorkspaceMemberResponse)(nil), // 231: openshell.v1.RemoveWorkspaceMemberResponse - (*ListWorkspaceMembersRequest)(nil), // 232: openshell.v1.ListWorkspaceMembersRequest - (*ListWorkspaceMembersResponse)(nil), // 233: openshell.v1.ListWorkspaceMembersResponse - (*ExtensionServiceCredential)(nil), // 234: openshell.v1.ExtensionServiceCredential - (*EndpointObservation)(nil), // 235: openshell.v1.EndpointObservation - (*ReportEndpointStatusRequest)(nil), // 236: openshell.v1.ReportEndpointStatusRequest - (*ReportEndpointStatusResponse)(nil), // 237: openshell.v1.ReportEndpointStatusResponse - (*EndpointStatus)(nil), // 238: openshell.v1.EndpointStatus - nil, // 239: openshell.v1.SandboxSpec.EnvironmentEntry - nil, // 240: openshell.v1.SandboxTemplate.LabelsEntry - nil, // 241: openshell.v1.SandboxTemplate.AnnotationsEntry - nil, // 242: openshell.v1.SandboxTemplate.EnvironmentEntry - nil, // 243: openshell.v1.SandboxWorkloadConfig.EnvironmentEntry - nil, // 244: openshell.v1.PlatformEvent.MetadataEntry - nil, // 245: openshell.v1.CreateSandboxRequest.LabelsEntry - nil, // 246: openshell.v1.CreateSandboxRequest.AnnotationsEntry - nil, // 247: openshell.v1.ExecSandboxRequest.EnvironmentEntry - nil, // 248: openshell.v1.SandboxLogLine.FieldsEntry - nil, // 249: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry - nil, // 250: openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry - nil, // 251: openshell.v1.ProviderProfile.AnnotationsEntry - nil, // 252: openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry - nil, // 253: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry - nil, // 254: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry - nil, // 255: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry - nil, // 256: openshell.v1.UpdateConfigRequest.AnnotationsEntry - nil, // 257: openshell.v1.UpdateConfigResponse.AnnotationsEntry - nil, // 258: openshell.v1.SandboxPolicyRevision.ProvenanceEntry - nil, // 259: openshell.v1.CreateWorkspaceRequest.LabelsEntry - (*timestamppb.Timestamp)(nil), // 260: google.protobuf.Timestamp - (*datamodelv1.ObjectMeta)(nil), // 261: openshell.datamodel.v1.ObjectMeta - (*sandboxv1.SandboxPolicy)(nil), // 262: openshell.sandbox.v1.SandboxPolicy - (*structpb.Struct)(nil), // 263: google.protobuf.Struct - (*durationpb.Duration)(nil), // 264: google.protobuf.Duration - (*datamodelv1.WorkspaceSelector)(nil), // 265: openshell.datamodel.v1.WorkspaceSelector - (*datamodelv1.Provider)(nil), // 266: openshell.datamodel.v1.Provider - (sandboxv1.PolicySource)(0), // 267: openshell.sandbox.v1.PolicySource - (*sandboxv1.NetworkEndpoint)(nil), // 268: openshell.sandbox.v1.NetworkEndpoint - (*sandboxv1.NetworkBinary)(nil), // 269: openshell.sandbox.v1.NetworkBinary - (*sandboxv1.SettingValue)(nil), // 270: openshell.sandbox.v1.SettingValue - (*sandboxv1.NetworkPolicyRule)(nil), // 271: openshell.sandbox.v1.NetworkPolicyRule - (*sandboxv1.L7DenyRule)(nil), // 272: openshell.sandbox.v1.L7DenyRule - (*sandboxv1.L7Rule)(nil), // 273: openshell.sandbox.v1.L7Rule - (*datamodelv1.Workspace)(nil), // 274: openshell.datamodel.v1.Workspace - (*sandboxv1.GetSandboxConfigRequest)(nil), // 275: openshell.sandbox.v1.GetSandboxConfigRequest - (*sandboxv1.GetGatewayConfigRequest)(nil), // 276: openshell.sandbox.v1.GetGatewayConfigRequest - (*sandboxv1.GetSandboxConfigResponse)(nil), // 277: openshell.sandbox.v1.GetSandboxConfigResponse - (*sandboxv1.GetGatewayConfigResponse)(nil), // 278: openshell.sandbox.v1.GetGatewayConfigResponse + (ConfigurationAdmissionState)(0), // 10: openshell.v1.ConfigurationAdmissionState + (PolicyStatus)(0), // 11: openshell.v1.PolicyStatus + (ServiceStatus)(0), // 12: openshell.v1.ServiceStatus + (WorkspaceRole)(0), // 13: openshell.v1.WorkspaceRole + (ProviderCredentialRefreshRecoveryAction)(0), // 14: openshell.v1.ProviderCredentialRefreshRecoveryAction + (DeletionOutcome)(0), // 15: openshell.v1.DeletionOutcome + (EndpointResult)(0), // 16: openshell.v1.EndpointResult + (*IssueSandboxTokenRequest)(nil), // 17: openshell.v1.IssueSandboxTokenRequest + (*IssueSandboxTokenResponse)(nil), // 18: openshell.v1.IssueSandboxTokenResponse + (*RefreshSandboxTokenRequest)(nil), // 19: openshell.v1.RefreshSandboxTokenRequest + (*RefreshSandboxTokenResponse)(nil), // 20: openshell.v1.RefreshSandboxTokenResponse + (*HealthRequest)(nil), // 21: openshell.v1.HealthRequest + (*HealthResponse)(nil), // 22: openshell.v1.HealthResponse + (*GetCurrentUserRequest)(nil), // 23: openshell.v1.GetCurrentUserRequest + (*GetCurrentUserResponse)(nil), // 24: openshell.v1.GetCurrentUserResponse + (*GetGatewayInfoRequest)(nil), // 25: openshell.v1.GetGatewayInfoRequest + (*GetGatewayInfoResponse)(nil), // 26: openshell.v1.GetGatewayInfoResponse + (*ComputeDriverInfo)(nil), // 27: openshell.v1.ComputeDriverInfo + (*ComputeDriverCapabilities)(nil), // 28: openshell.v1.ComputeDriverCapabilities + (*ResourceCapabilities)(nil), // 29: openshell.v1.ResourceCapabilities + (*CpuResourceCapabilities)(nil), // 30: openshell.v1.CpuResourceCapabilities + (*MemoryResourceCapabilities)(nil), // 31: openshell.v1.MemoryResourceCapabilities + (*GpuResourceCapabilities)(nil), // 32: openshell.v1.GpuResourceCapabilities + (*Sandbox)(nil), // 33: openshell.v1.Sandbox + (*SandboxSpec)(nil), // 34: openshell.v1.SandboxSpec + (*ResourceRequirements)(nil), // 35: openshell.v1.ResourceRequirements + (*GpuResourceRequirements)(nil), // 36: openshell.v1.GpuResourceRequirements + (*SandboxTemplate)(nil), // 37: openshell.v1.SandboxTemplate + (*SandboxWorkloadTemplate)(nil), // 38: openshell.v1.SandboxWorkloadTemplate + (*SandboxWorkloadTemplateSpec)(nil), // 39: openshell.v1.SandboxWorkloadTemplateSpec + (*SandboxWorkloadConfig)(nil), // 40: openshell.v1.SandboxWorkloadConfig + (*SandboxResources)(nil), // 41: openshell.v1.SandboxResources + (*SandboxServiceLevel)(nil), // 42: openshell.v1.SandboxServiceLevel + (*SandboxStartup)(nil), // 43: openshell.v1.SandboxStartup + (*SandboxWorkloadTemplateProvenance)(nil), // 44: openshell.v1.SandboxWorkloadTemplateProvenance + (*SandboxStatus)(nil), // 45: openshell.v1.SandboxStatus + (*SandboxCondition)(nil), // 46: openshell.v1.SandboxCondition + (*PlatformEvent)(nil), // 47: openshell.v1.PlatformEvent + (*CreateSandboxRequest)(nil), // 48: openshell.v1.CreateSandboxRequest + (*CreateSandboxTemplateRequest)(nil), // 49: openshell.v1.CreateSandboxTemplateRequest + (*GetSandboxTemplateRequest)(nil), // 50: openshell.v1.GetSandboxTemplateRequest + (*ListSandboxTemplatesRequest)(nil), // 51: openshell.v1.ListSandboxTemplatesRequest + (*DeleteSandboxTemplateRequest)(nil), // 52: openshell.v1.DeleteSandboxTemplateRequest + (*SandboxTemplateResponse)(nil), // 53: openshell.v1.SandboxTemplateResponse + (*ListSandboxTemplatesResponse)(nil), // 54: openshell.v1.ListSandboxTemplatesResponse + (*DeleteSandboxTemplateResponse)(nil), // 55: openshell.v1.DeleteSandboxTemplateResponse + (*BeginRootfsTarStagingRequest)(nil), // 56: openshell.v1.BeginRootfsTarStagingRequest + (*BeginRootfsTarStagingResponse)(nil), // 57: openshell.v1.BeginRootfsTarStagingResponse + (*GetSandboxRequest)(nil), // 58: openshell.v1.GetSandboxRequest + (*ListSandboxesRequest)(nil), // 59: openshell.v1.ListSandboxesRequest + (*ListSandboxProvidersRequest)(nil), // 60: openshell.v1.ListSandboxProvidersRequest + (*AttachSandboxProviderRequest)(nil), // 61: openshell.v1.AttachSandboxProviderRequest + (*DetachSandboxProviderRequest)(nil), // 62: openshell.v1.DetachSandboxProviderRequest + (*DeleteSandboxRequest)(nil), // 63: openshell.v1.DeleteSandboxRequest + (*StopSandboxRequest)(nil), // 64: openshell.v1.StopSandboxRequest + (*StartSandboxRequest)(nil), // 65: openshell.v1.StartSandboxRequest + (*SandboxResponse)(nil), // 66: openshell.v1.SandboxResponse + (*ListSandboxesResponse)(nil), // 67: openshell.v1.ListSandboxesResponse + (*ListSandboxProvidersResponse)(nil), // 68: openshell.v1.ListSandboxProvidersResponse + (*AttachSandboxProviderResponse)(nil), // 69: openshell.v1.AttachSandboxProviderResponse + (*DetachSandboxProviderResponse)(nil), // 70: openshell.v1.DetachSandboxProviderResponse + (*ProviderDesiredIdentity)(nil), // 71: openshell.v1.ProviderDesiredIdentity + (*ConfigSnapshotRevision)(nil), // 72: openshell.v1.ConfigSnapshotRevision + (*SandboxConfigRevision)(nil), // 73: openshell.v1.SandboxConfigRevision + (*ConfigUpdateOperation)(nil), // 74: openshell.v1.ConfigUpdateOperation + (*ProviderMutationReceipt)(nil), // 75: openshell.v1.ProviderMutationReceipt + (*ProviderReadinessObservation)(nil), // 76: openshell.v1.ProviderReadinessObservation + (*ProviderReadinessStatus)(nil), // 77: openshell.v1.ProviderReadinessStatus + (*GetSandboxProviderStatusRequest)(nil), // 78: openshell.v1.GetSandboxProviderStatusRequest + (*GetSandboxProviderStatusResponse)(nil), // 79: openshell.v1.GetSandboxProviderStatusResponse + (*ReportProviderReadinessRequest)(nil), // 80: openshell.v1.ReportProviderReadinessRequest + (*ReportProviderReadinessResponse)(nil), // 81: openshell.v1.ReportProviderReadinessResponse + (*DeleteSandboxResponse)(nil), // 82: openshell.v1.DeleteSandboxResponse + (*CreateSshSessionRequest)(nil), // 83: openshell.v1.CreateSshSessionRequest + (*CreateSshSessionResponse)(nil), // 84: openshell.v1.CreateSshSessionResponse + (*ExposeServiceRequest)(nil), // 85: openshell.v1.ExposeServiceRequest + (*GetServiceRequest)(nil), // 86: openshell.v1.GetServiceRequest + (*ListServicesRequest)(nil), // 87: openshell.v1.ListServicesRequest + (*ListServicesResponse)(nil), // 88: openshell.v1.ListServicesResponse + (*DeleteServiceRequest)(nil), // 89: openshell.v1.DeleteServiceRequest + (*DeleteServiceResponse)(nil), // 90: openshell.v1.DeleteServiceResponse + (*ServiceEndpoint)(nil), // 91: openshell.v1.ServiceEndpoint + (*ServiceEndpointResponse)(nil), // 92: openshell.v1.ServiceEndpointResponse + (*RevokeSshSessionRequest)(nil), // 93: openshell.v1.RevokeSshSessionRequest + (*RevokeSshSessionResponse)(nil), // 94: openshell.v1.RevokeSshSessionResponse + (*ExecSandboxRequest)(nil), // 95: openshell.v1.ExecSandboxRequest + (*ExecSandboxStdout)(nil), // 96: openshell.v1.ExecSandboxStdout + (*ExecSandboxStderr)(nil), // 97: openshell.v1.ExecSandboxStderr + (*ExecSandboxExit)(nil), // 98: openshell.v1.ExecSandboxExit + (*ExecSandboxEvent)(nil), // 99: openshell.v1.ExecSandboxEvent + (*TcpForwardInit)(nil), // 100: openshell.v1.TcpForwardInit + (*TcpForwardFrame)(nil), // 101: openshell.v1.TcpForwardFrame + (*ExecSandboxInput)(nil), // 102: openshell.v1.ExecSandboxInput + (*ExecSandboxWindowResize)(nil), // 103: openshell.v1.ExecSandboxWindowResize + (*SshSession)(nil), // 104: openshell.v1.SshSession + (*WatchSandboxRequest)(nil), // 105: openshell.v1.WatchSandboxRequest + (*SandboxStreamEvent)(nil), // 106: openshell.v1.SandboxStreamEvent + (*SandboxLogLine)(nil), // 107: openshell.v1.SandboxLogLine + (*SandboxStreamWarning)(nil), // 108: openshell.v1.SandboxStreamWarning + (*CreateProviderRequest)(nil), // 109: openshell.v1.CreateProviderRequest + (*GetProviderRequest)(nil), // 110: openshell.v1.GetProviderRequest + (*ListProvidersRequest)(nil), // 111: openshell.v1.ListProvidersRequest + (*UpdateProviderRequest)(nil), // 112: openshell.v1.UpdateProviderRequest + (*DeleteProviderRequest)(nil), // 113: openshell.v1.DeleteProviderRequest + (*ProviderResponse)(nil), // 114: openshell.v1.ProviderResponse + (*ListProvidersResponse)(nil), // 115: openshell.v1.ListProvidersResponse + (*ListProviderProfilesRequest)(nil), // 116: openshell.v1.ListProviderProfilesRequest + (*GetProviderProfileRequest)(nil), // 117: openshell.v1.GetProviderProfileRequest + (*ProviderProfileImportItem)(nil), // 118: openshell.v1.ProviderProfileImportItem + (*ProviderProfileDiagnostic)(nil), // 119: openshell.v1.ProviderProfileDiagnostic + (*ProviderCredentialTokenGrantAudienceOverride)(nil), // 120: openshell.v1.ProviderCredentialTokenGrantAudienceOverride + (*ProviderCredentialTokenGrantSubjectToken)(nil), // 121: openshell.v1.ProviderCredentialTokenGrantSubjectToken + (*ProviderCredentialTokenGrant)(nil), // 122: openshell.v1.ProviderCredentialTokenGrant + (*ProviderProfileCredential)(nil), // 123: openshell.v1.ProviderProfileCredential + (*ProviderCredentialRefreshMaterial)(nil), // 124: openshell.v1.ProviderCredentialRefreshMaterial + (*ProviderCredentialRefreshOutput)(nil), // 125: openshell.v1.ProviderCredentialRefreshOutput + (*ProviderCredentialRefresh)(nil), // 126: openshell.v1.ProviderCredentialRefresh + (*ProviderCredentialRefreshStatus)(nil), // 127: openshell.v1.ProviderCredentialRefreshStatus + (*ProviderProfileDiscovery)(nil), // 128: openshell.v1.ProviderProfileDiscovery + (*GetProviderRefreshStatusRequest)(nil), // 129: openshell.v1.GetProviderRefreshStatusRequest + (*GetProviderRefreshStatusResponse)(nil), // 130: openshell.v1.GetProviderRefreshStatusResponse + (*ConfigureProviderRefreshRequest)(nil), // 131: openshell.v1.ConfigureProviderRefreshRequest + (*ConfigureProviderRefreshResponse)(nil), // 132: openshell.v1.ConfigureProviderRefreshResponse + (*RotateProviderCredentialRequest)(nil), // 133: openshell.v1.RotateProviderCredentialRequest + (*RotateProviderCredentialResponse)(nil), // 134: openshell.v1.RotateProviderCredentialResponse + (*DeleteProviderRefreshRequest)(nil), // 135: openshell.v1.DeleteProviderRefreshRequest + (*DeleteProviderRefreshResponse)(nil), // 136: openshell.v1.DeleteProviderRefreshResponse + (*ProviderProfile)(nil), // 137: openshell.v1.ProviderProfile + (*ProviderProfileResponse)(nil), // 138: openshell.v1.ProviderProfileResponse + (*ListProviderProfilesResponse)(nil), // 139: openshell.v1.ListProviderProfilesResponse + (*ImportProviderProfilesRequest)(nil), // 140: openshell.v1.ImportProviderProfilesRequest + (*ImportProviderProfilesResponse)(nil), // 141: openshell.v1.ImportProviderProfilesResponse + (*UpdateProviderProfilesRequest)(nil), // 142: openshell.v1.UpdateProviderProfilesRequest + (*UpdateProviderProfilesResponse)(nil), // 143: openshell.v1.UpdateProviderProfilesResponse + (*LintProviderProfilesRequest)(nil), // 144: openshell.v1.LintProviderProfilesRequest + (*LintProviderProfilesResponse)(nil), // 145: openshell.v1.LintProviderProfilesResponse + (*DeleteProviderResponse)(nil), // 146: openshell.v1.DeleteProviderResponse + (*DeleteProviderProfileRequest)(nil), // 147: openshell.v1.DeleteProviderProfileRequest + (*DeleteProviderProfileResponse)(nil), // 148: openshell.v1.DeleteProviderProfileResponse + (*GetSandboxProviderEnvironmentRequest)(nil), // 149: openshell.v1.GetSandboxProviderEnvironmentRequest + (*StaticCredentialEndpointBinding)(nil), // 150: openshell.v1.StaticCredentialEndpointBinding + (*StaticCredentialBinding)(nil), // 151: openshell.v1.StaticCredentialBinding + (*GetSandboxProviderEnvironmentResponse)(nil), // 152: openshell.v1.GetSandboxProviderEnvironmentResponse + (*ExchangeProviderSubjectTokenRequest)(nil), // 153: openshell.v1.ExchangeProviderSubjectTokenRequest + (*ExchangeProviderSubjectTokenResponse)(nil), // 154: openshell.v1.ExchangeProviderSubjectTokenResponse + (*UpdateConfigRequest)(nil), // 155: openshell.v1.UpdateConfigRequest + (*PolicyMergeOperation)(nil), // 156: openshell.v1.PolicyMergeOperation + (*AddNetworkRule)(nil), // 157: openshell.v1.AddNetworkRule + (*RemoveNetworkEndpoint)(nil), // 158: openshell.v1.RemoveNetworkEndpoint + (*RemoveNetworkRule)(nil), // 159: openshell.v1.RemoveNetworkRule + (*L7RuleTarget)(nil), // 160: openshell.v1.L7RuleTarget + (*AddDenyRules)(nil), // 161: openshell.v1.AddDenyRules + (*AddAllowRules)(nil), // 162: openshell.v1.AddAllowRules + (*RemoveNetworkBinary)(nil), // 163: openshell.v1.RemoveNetworkBinary + (*UpdateConfigResponse)(nil), // 164: openshell.v1.UpdateConfigResponse + (*GetSandboxPolicyStatusRequest)(nil), // 165: openshell.v1.GetSandboxPolicyStatusRequest + (*GetSandboxPolicyStatusResponse)(nil), // 166: openshell.v1.GetSandboxPolicyStatusResponse + (*ListSandboxPoliciesRequest)(nil), // 167: openshell.v1.ListSandboxPoliciesRequest + (*ListSandboxPoliciesResponse)(nil), // 168: openshell.v1.ListSandboxPoliciesResponse + (*ReportPolicyStatusRequest)(nil), // 169: openshell.v1.ReportPolicyStatusRequest + (*ReportPolicyStatusResponse)(nil), // 170: openshell.v1.ReportPolicyStatusResponse + (*SandboxConfigurationAdmission)(nil), // 171: openshell.v1.SandboxConfigurationAdmission + (*ReportSandboxConfigurationRequest)(nil), // 172: openshell.v1.ReportSandboxConfigurationRequest + (*ReportSandboxConfigurationResponse)(nil), // 173: openshell.v1.ReportSandboxConfigurationResponse + (*SandboxPolicyRevision)(nil), // 174: openshell.v1.SandboxPolicyRevision + (*GetSandboxLogsRequest)(nil), // 175: openshell.v1.GetSandboxLogsRequest + (*PushSandboxLogsRequest)(nil), // 176: openshell.v1.PushSandboxLogsRequest + (*PushSandboxLogsResponse)(nil), // 177: openshell.v1.PushSandboxLogsResponse + (*GetSandboxLogsResponse)(nil), // 178: openshell.v1.GetSandboxLogsResponse + (*SupervisorMessage)(nil), // 179: openshell.v1.SupervisorMessage + (*GatewayMessage)(nil), // 180: openshell.v1.GatewayMessage + (*SupervisorHello)(nil), // 181: openshell.v1.SupervisorHello + (*SessionAccepted)(nil), // 182: openshell.v1.SessionAccepted + (*SessionRejected)(nil), // 183: openshell.v1.SessionRejected + (*SupervisorHeartbeat)(nil), // 184: openshell.v1.SupervisorHeartbeat + (*GatewayHeartbeat)(nil), // 185: openshell.v1.GatewayHeartbeat + (*ReportMainProcessExitRequest)(nil), // 186: openshell.v1.ReportMainProcessExitRequest + (*ReportMainProcessExitResponse)(nil), // 187: openshell.v1.ReportMainProcessExitResponse + (*FinalizeMainProcessExitRequest)(nil), // 188: openshell.v1.FinalizeMainProcessExitRequest + (*FinalizeMainProcessExitResponse)(nil), // 189: openshell.v1.FinalizeMainProcessExitResponse + (*RelayOpen)(nil), // 190: openshell.v1.RelayOpen + (*SshRelayTarget)(nil), // 191: openshell.v1.SshRelayTarget + (*TcpRelayTarget)(nil), // 192: openshell.v1.TcpRelayTarget + (*RelayInit)(nil), // 193: openshell.v1.RelayInit + (*RelayFrame)(nil), // 194: openshell.v1.RelayFrame + (*RelayOpenResult)(nil), // 195: openshell.v1.RelayOpenResult + (*RelayClose)(nil), // 196: openshell.v1.RelayClose + (*L7RequestSample)(nil), // 197: openshell.v1.L7RequestSample + (*DenialSummary)(nil), // 198: openshell.v1.DenialSummary + (*DenialGroupCount)(nil), // 199: openshell.v1.DenialGroupCount + (*NetworkActivitySummary)(nil), // 200: openshell.v1.NetworkActivitySummary + (*PolicyChunk)(nil), // 201: openshell.v1.PolicyChunk + (*DraftPolicyUpdate)(nil), // 202: openshell.v1.DraftPolicyUpdate + (*SubmitPolicyAnalysisRequest)(nil), // 203: openshell.v1.SubmitPolicyAnalysisRequest + (*SubmitPolicyAnalysisResponse)(nil), // 204: openshell.v1.SubmitPolicyAnalysisResponse + (*GetDraftPolicyRequest)(nil), // 205: openshell.v1.GetDraftPolicyRequest + (*GetDraftPolicyResponse)(nil), // 206: openshell.v1.GetDraftPolicyResponse + (*ApproveDraftChunkRequest)(nil), // 207: openshell.v1.ApproveDraftChunkRequest + (*ApproveDraftChunkResponse)(nil), // 208: openshell.v1.ApproveDraftChunkResponse + (*RejectDraftChunkRequest)(nil), // 209: openshell.v1.RejectDraftChunkRequest + (*RejectDraftChunkResponse)(nil), // 210: openshell.v1.RejectDraftChunkResponse + (*DraftChunkApproval)(nil), // 211: openshell.v1.DraftChunkApproval + (*ApproveAllDraftChunksRequest)(nil), // 212: openshell.v1.ApproveAllDraftChunksRequest + (*ApproveAllDraftChunksResponse)(nil), // 213: openshell.v1.ApproveAllDraftChunksResponse + (*EditDraftChunkRequest)(nil), // 214: openshell.v1.EditDraftChunkRequest + (*EditDraftChunkResponse)(nil), // 215: openshell.v1.EditDraftChunkResponse + (*UndoDraftChunkRequest)(nil), // 216: openshell.v1.UndoDraftChunkRequest + (*UndoDraftChunkResponse)(nil), // 217: openshell.v1.UndoDraftChunkResponse + (*ClearDraftChunksRequest)(nil), // 218: openshell.v1.ClearDraftChunksRequest + (*ClearDraftChunksResponse)(nil), // 219: openshell.v1.ClearDraftChunksResponse + (*GetDraftHistoryRequest)(nil), // 220: openshell.v1.GetDraftHistoryRequest + (*DraftHistoryEntry)(nil), // 221: openshell.v1.DraftHistoryEntry + (*GetDraftHistoryResponse)(nil), // 222: openshell.v1.GetDraftHistoryResponse + (*CreateWorkspaceRequest)(nil), // 223: openshell.v1.CreateWorkspaceRequest + (*CreateWorkspaceResponse)(nil), // 224: openshell.v1.CreateWorkspaceResponse + (*GetWorkspaceRequest)(nil), // 225: openshell.v1.GetWorkspaceRequest + (*GetWorkspaceResponse)(nil), // 226: openshell.v1.GetWorkspaceResponse + (*ListWorkspacesRequest)(nil), // 227: openshell.v1.ListWorkspacesRequest + (*ListWorkspacesResponse)(nil), // 228: openshell.v1.ListWorkspacesResponse + (*DeleteWorkspaceRequest)(nil), // 229: openshell.v1.DeleteWorkspaceRequest + (*DeleteWorkspaceResponse)(nil), // 230: openshell.v1.DeleteWorkspaceResponse + (*WorkspaceMember)(nil), // 231: openshell.v1.WorkspaceMember + (*AddWorkspaceMemberRequest)(nil), // 232: openshell.v1.AddWorkspaceMemberRequest + (*AddWorkspaceMemberResponse)(nil), // 233: openshell.v1.AddWorkspaceMemberResponse + (*RemoveWorkspaceMemberRequest)(nil), // 234: openshell.v1.RemoveWorkspaceMemberRequest + (*RemoveWorkspaceMemberResponse)(nil), // 235: openshell.v1.RemoveWorkspaceMemberResponse + (*ListWorkspaceMembersRequest)(nil), // 236: openshell.v1.ListWorkspaceMembersRequest + (*ListWorkspaceMembersResponse)(nil), // 237: openshell.v1.ListWorkspaceMembersResponse + (*ExtensionServiceCredential)(nil), // 238: openshell.v1.ExtensionServiceCredential + (*EndpointObservation)(nil), // 239: openshell.v1.EndpointObservation + (*ReportEndpointStatusRequest)(nil), // 240: openshell.v1.ReportEndpointStatusRequest + (*ReportEndpointStatusResponse)(nil), // 241: openshell.v1.ReportEndpointStatusResponse + (*EndpointStatus)(nil), // 242: openshell.v1.EndpointStatus + (*SandboxProvisioning)(nil), // 243: openshell.v1.SandboxProvisioning + nil, // 244: openshell.v1.SandboxSpec.EnvironmentEntry + nil, // 245: openshell.v1.SandboxTemplate.LabelsEntry + nil, // 246: openshell.v1.SandboxTemplate.AnnotationsEntry + nil, // 247: openshell.v1.SandboxTemplate.EnvironmentEntry + nil, // 248: openshell.v1.SandboxWorkloadConfig.EnvironmentEntry + nil, // 249: openshell.v1.PlatformEvent.MetadataEntry + nil, // 250: openshell.v1.CreateSandboxRequest.LabelsEntry + nil, // 251: openshell.v1.CreateSandboxRequest.AnnotationsEntry + nil, // 252: openshell.v1.ExecSandboxRequest.EnvironmentEntry + nil, // 253: openshell.v1.SandboxLogLine.FieldsEntry + nil, // 254: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry + nil, // 255: openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry + nil, // 256: openshell.v1.ProviderProfile.AnnotationsEntry + nil, // 257: openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry + nil, // 258: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry + nil, // 259: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry + nil, // 260: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry + nil, // 261: openshell.v1.UpdateConfigRequest.AnnotationsEntry + nil, // 262: openshell.v1.UpdateConfigResponse.AnnotationsEntry + nil, // 263: openshell.v1.SandboxPolicyRevision.ProvenanceEntry + nil, // 264: openshell.v1.CreateWorkspaceRequest.LabelsEntry + (*timestamppb.Timestamp)(nil), // 265: google.protobuf.Timestamp + (*datamodelv1.ObjectMeta)(nil), // 266: openshell.datamodel.v1.ObjectMeta + (*sandboxv1.SandboxPolicy)(nil), // 267: openshell.sandbox.v1.SandboxPolicy + (*structpb.Struct)(nil), // 268: google.protobuf.Struct + (*durationpb.Duration)(nil), // 269: google.protobuf.Duration + (*datamodelv1.WorkspaceSelector)(nil), // 270: openshell.datamodel.v1.WorkspaceSelector + (*datamodelv1.Provider)(nil), // 271: openshell.datamodel.v1.Provider + (sandboxv1.PolicySource)(0), // 272: openshell.sandbox.v1.PolicySource + (*sandboxv1.NetworkEndpoint)(nil), // 273: openshell.sandbox.v1.NetworkEndpoint + (*sandboxv1.NetworkBinary)(nil), // 274: openshell.sandbox.v1.NetworkBinary + (*sandboxv1.SettingValue)(nil), // 275: openshell.sandbox.v1.SettingValue + (*sandboxv1.NetworkPolicyRule)(nil), // 276: openshell.sandbox.v1.NetworkPolicyRule + (*sandboxv1.L7DenyRule)(nil), // 277: openshell.sandbox.v1.L7DenyRule + (*sandboxv1.L7Rule)(nil), // 278: openshell.sandbox.v1.L7Rule + (*datamodelv1.Workspace)(nil), // 279: openshell.datamodel.v1.Workspace + (*sandboxv1.GetSandboxConfigRequest)(nil), // 280: openshell.sandbox.v1.GetSandboxConfigRequest + (*sandboxv1.GetGatewayConfigRequest)(nil), // 281: openshell.sandbox.v1.GetGatewayConfigRequest + (*sandboxv1.GetSandboxConfigResponse)(nil), // 282: openshell.sandbox.v1.GetSandboxConfigResponse + (*sandboxv1.GetGatewayConfigResponse)(nil), // 283: openshell.sandbox.v1.GetGatewayConfigResponse } var file_openshell_proto_depIdxs = []int32{ - 260, // 0: openshell.v1.IssueSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp - 260, // 1: openshell.v1.RefreshSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp - 234, // 2: openshell.v1.RefreshSandboxTokenResponse.extension_credentials:type_name -> openshell.v1.ExtensionServiceCredential - 260, // 3: openshell.v1.RefreshSandboxTokenResponse.sandbox_expiration_time:type_name -> google.protobuf.Timestamp - 11, // 4: openshell.v1.HealthResponse.status:type_name -> openshell.v1.ServiceStatus - 11, // 5: openshell.v1.GetGatewayInfoResponse.status:type_name -> openshell.v1.ServiceStatus - 26, // 6: openshell.v1.GetGatewayInfoResponse.compute_drivers:type_name -> openshell.v1.ComputeDriverInfo - 27, // 7: openshell.v1.ComputeDriverInfo.capabilities:type_name -> openshell.v1.ComputeDriverCapabilities - 28, // 8: openshell.v1.ComputeDriverCapabilities.resource_capabilities:type_name -> openshell.v1.ResourceCapabilities - 29, // 9: openshell.v1.ResourceCapabilities.cpu:type_name -> openshell.v1.CpuResourceCapabilities - 30, // 10: openshell.v1.ResourceCapabilities.memory:type_name -> openshell.v1.MemoryResourceCapabilities - 31, // 11: openshell.v1.ResourceCapabilities.gpu:type_name -> openshell.v1.GpuResourceCapabilities - 261, // 12: openshell.v1.Sandbox.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 33, // 13: openshell.v1.Sandbox.spec:type_name -> openshell.v1.SandboxSpec - 44, // 14: openshell.v1.Sandbox.status:type_name -> openshell.v1.SandboxStatus - 43, // 15: openshell.v1.Sandbox.created_from_workload_template:type_name -> openshell.v1.SandboxWorkloadTemplateProvenance - 239, // 16: openshell.v1.SandboxSpec.environment:type_name -> openshell.v1.SandboxSpec.EnvironmentEntry - 36, // 17: openshell.v1.SandboxSpec.template:type_name -> openshell.v1.SandboxTemplate - 262, // 18: openshell.v1.SandboxSpec.policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 34, // 19: openshell.v1.SandboxSpec.resource_requirements:type_name -> openshell.v1.ResourceRequirements - 35, // 20: openshell.v1.ResourceRequirements.gpu:type_name -> openshell.v1.GpuResourceRequirements - 240, // 21: openshell.v1.SandboxTemplate.labels:type_name -> openshell.v1.SandboxTemplate.LabelsEntry - 241, // 22: openshell.v1.SandboxTemplate.annotations:type_name -> openshell.v1.SandboxTemplate.AnnotationsEntry - 242, // 23: openshell.v1.SandboxTemplate.environment:type_name -> openshell.v1.SandboxTemplate.EnvironmentEntry - 263, // 24: openshell.v1.SandboxTemplate.resources:type_name -> google.protobuf.Struct - 263, // 25: openshell.v1.SandboxTemplate.driver_config:type_name -> google.protobuf.Struct - 261, // 26: openshell.v1.SandboxWorkloadTemplate.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 38, // 27: openshell.v1.SandboxWorkloadTemplate.spec:type_name -> openshell.v1.SandboxWorkloadTemplateSpec - 39, // 28: openshell.v1.SandboxWorkloadTemplateSpec.workload:type_name -> openshell.v1.SandboxWorkloadConfig - 263, // 29: openshell.v1.SandboxWorkloadTemplateSpec.driver_config:type_name -> google.protobuf.Struct - 41, // 30: openshell.v1.SandboxWorkloadTemplateSpec.desired_service_level:type_name -> openshell.v1.SandboxServiceLevel - 243, // 31: openshell.v1.SandboxWorkloadConfig.environment:type_name -> openshell.v1.SandboxWorkloadConfig.EnvironmentEntry - 40, // 32: openshell.v1.SandboxWorkloadConfig.resources:type_name -> openshell.v1.SandboxResources - 35, // 33: openshell.v1.SandboxResources.gpu:type_name -> openshell.v1.GpuResourceRequirements - 42, // 34: openshell.v1.SandboxServiceLevel.startup:type_name -> openshell.v1.SandboxStartup - 264, // 35: openshell.v1.SandboxStartup.ready_within:type_name -> google.protobuf.Duration - 45, // 36: openshell.v1.SandboxStatus.conditions:type_name -> openshell.v1.SandboxCondition + 265, // 0: openshell.v1.IssueSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 1: openshell.v1.RefreshSandboxTokenResponse.expiration_time:type_name -> google.protobuf.Timestamp + 238, // 2: openshell.v1.RefreshSandboxTokenResponse.extension_credentials:type_name -> openshell.v1.ExtensionServiceCredential + 265, // 3: openshell.v1.RefreshSandboxTokenResponse.sandbox_expiration_time:type_name -> google.protobuf.Timestamp + 12, // 4: openshell.v1.HealthResponse.status:type_name -> openshell.v1.ServiceStatus + 12, // 5: openshell.v1.GetGatewayInfoResponse.status:type_name -> openshell.v1.ServiceStatus + 27, // 6: openshell.v1.GetGatewayInfoResponse.compute_drivers:type_name -> openshell.v1.ComputeDriverInfo + 28, // 7: openshell.v1.ComputeDriverInfo.capabilities:type_name -> openshell.v1.ComputeDriverCapabilities + 29, // 8: openshell.v1.ComputeDriverCapabilities.resource_capabilities:type_name -> openshell.v1.ResourceCapabilities + 30, // 9: openshell.v1.ResourceCapabilities.cpu:type_name -> openshell.v1.CpuResourceCapabilities + 31, // 10: openshell.v1.ResourceCapabilities.memory:type_name -> openshell.v1.MemoryResourceCapabilities + 32, // 11: openshell.v1.ResourceCapabilities.gpu:type_name -> openshell.v1.GpuResourceCapabilities + 266, // 12: openshell.v1.Sandbox.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 34, // 13: openshell.v1.Sandbox.spec:type_name -> openshell.v1.SandboxSpec + 45, // 14: openshell.v1.Sandbox.status:type_name -> openshell.v1.SandboxStatus + 44, // 15: openshell.v1.Sandbox.created_from_workload_template:type_name -> openshell.v1.SandboxWorkloadTemplateProvenance + 244, // 16: openshell.v1.SandboxSpec.environment:type_name -> openshell.v1.SandboxSpec.EnvironmentEntry + 37, // 17: openshell.v1.SandboxSpec.template:type_name -> openshell.v1.SandboxTemplate + 267, // 18: openshell.v1.SandboxSpec.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 35, // 19: openshell.v1.SandboxSpec.resource_requirements:type_name -> openshell.v1.ResourceRequirements + 36, // 20: openshell.v1.ResourceRequirements.gpu:type_name -> openshell.v1.GpuResourceRequirements + 245, // 21: openshell.v1.SandboxTemplate.labels:type_name -> openshell.v1.SandboxTemplate.LabelsEntry + 246, // 22: openshell.v1.SandboxTemplate.annotations:type_name -> openshell.v1.SandboxTemplate.AnnotationsEntry + 247, // 23: openshell.v1.SandboxTemplate.environment:type_name -> openshell.v1.SandboxTemplate.EnvironmentEntry + 268, // 24: openshell.v1.SandboxTemplate.resources:type_name -> google.protobuf.Struct + 268, // 25: openshell.v1.SandboxTemplate.driver_config:type_name -> google.protobuf.Struct + 266, // 26: openshell.v1.SandboxWorkloadTemplate.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 39, // 27: openshell.v1.SandboxWorkloadTemplate.spec:type_name -> openshell.v1.SandboxWorkloadTemplateSpec + 40, // 28: openshell.v1.SandboxWorkloadTemplateSpec.workload:type_name -> openshell.v1.SandboxWorkloadConfig + 268, // 29: openshell.v1.SandboxWorkloadTemplateSpec.driver_config:type_name -> google.protobuf.Struct + 42, // 30: openshell.v1.SandboxWorkloadTemplateSpec.desired_service_level:type_name -> openshell.v1.SandboxServiceLevel + 248, // 31: openshell.v1.SandboxWorkloadConfig.environment:type_name -> openshell.v1.SandboxWorkloadConfig.EnvironmentEntry + 41, // 32: openshell.v1.SandboxWorkloadConfig.resources:type_name -> openshell.v1.SandboxResources + 36, // 33: openshell.v1.SandboxResources.gpu:type_name -> openshell.v1.GpuResourceRequirements + 43, // 34: openshell.v1.SandboxServiceLevel.startup:type_name -> openshell.v1.SandboxStartup + 269, // 35: openshell.v1.SandboxStartup.ready_within:type_name -> google.protobuf.Duration + 46, // 36: openshell.v1.SandboxStatus.conditions:type_name -> openshell.v1.SandboxCondition 0, // 37: openshell.v1.SandboxStatus.phase:type_name -> openshell.v1.SandboxPhase - 238, // 38: openshell.v1.SandboxStatus.endpoint_statuses:type_name -> openshell.v1.EndpointStatus - 260, // 39: openshell.v1.SandboxCondition.transition_time:type_name -> google.protobuf.Timestamp - 260, // 40: openshell.v1.PlatformEvent.event_time:type_name -> google.protobuf.Timestamp - 244, // 41: openshell.v1.PlatformEvent.metadata:type_name -> openshell.v1.PlatformEvent.MetadataEntry - 33, // 42: openshell.v1.CreateSandboxRequest.spec:type_name -> openshell.v1.SandboxSpec - 245, // 43: openshell.v1.CreateSandboxRequest.labels:type_name -> openshell.v1.CreateSandboxRequest.LabelsEntry - 246, // 44: openshell.v1.CreateSandboxRequest.annotations:type_name -> openshell.v1.CreateSandboxRequest.AnnotationsEntry - 265, // 45: openshell.v1.CreateSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 37, // 46: openshell.v1.CreateSandboxTemplateRequest.template:type_name -> openshell.v1.SandboxWorkloadTemplate - 265, // 47: openshell.v1.CreateSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 48: openshell.v1.GetSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 49: openshell.v1.ListSandboxTemplatesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 50: openshell.v1.DeleteSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 37, // 51: openshell.v1.SandboxTemplateResponse.template:type_name -> openshell.v1.SandboxWorkloadTemplate - 37, // 52: openshell.v1.ListSandboxTemplatesResponse.templates:type_name -> openshell.v1.SandboxWorkloadTemplate - 14, // 53: openshell.v1.DeleteSandboxTemplateResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 265, // 54: openshell.v1.BeginRootfsTarStagingRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 260, // 55: openshell.v1.BeginRootfsTarStagingResponse.expiration_time:type_name -> google.protobuf.Timestamp - 265, // 56: openshell.v1.GetSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 57: openshell.v1.ListSandboxesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 58: openshell.v1.ListSandboxProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 59: openshell.v1.AttachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 60: openshell.v1.DetachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 61: openshell.v1.DeleteSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 62: openshell.v1.StopSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 63: openshell.v1.StartSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 32, // 64: openshell.v1.SandboxResponse.sandbox:type_name -> openshell.v1.Sandbox - 32, // 65: openshell.v1.ListSandboxesResponse.sandboxes:type_name -> openshell.v1.Sandbox - 266, // 66: openshell.v1.ListSandboxProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider - 32, // 67: openshell.v1.AttachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox - 74, // 68: openshell.v1.AttachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt - 32, // 69: openshell.v1.DetachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox - 74, // 70: openshell.v1.DetachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt - 72, // 71: openshell.v1.ConfigSnapshotRevision.sandbox_config:type_name -> openshell.v1.SandboxConfigRevision - 70, // 72: openshell.v1.ConfigSnapshotRevision.provider_target:type_name -> openshell.v1.ProviderDesiredIdentity - 267, // 73: openshell.v1.SandboxConfigRevision.policy_source:type_name -> openshell.sandbox.v1.PolicySource - 4, // 74: openshell.v1.ConfigUpdateOperation.component:type_name -> openshell.v1.ConfigComponent - 71, // 75: openshell.v1.ConfigUpdateOperation.target_revision:type_name -> openshell.v1.ConfigSnapshotRevision - 6, // 76: openshell.v1.ConfigUpdateOperation.state:type_name -> openshell.v1.ConfigUpdateOperationState - 5, // 77: openshell.v1.ConfigUpdateOperation.outcome:type_name -> openshell.v1.ConfigApplyOutcome - 260, // 78: openshell.v1.ConfigUpdateOperation.created_time:type_name -> google.protobuf.Timestamp - 260, // 79: openshell.v1.ConfigUpdateOperation.updated_time:type_name -> google.protobuf.Timestamp - 260, // 80: openshell.v1.ConfigUpdateOperation.completed_time:type_name -> google.protobuf.Timestamp - 1, // 81: openshell.v1.ProviderMutationReceipt.kind:type_name -> openshell.v1.ProviderMutationKind - 70, // 82: openshell.v1.ProviderMutationReceipt.desired:type_name -> openshell.v1.ProviderDesiredIdentity - 260, // 83: openshell.v1.ProviderMutationReceipt.persisted_time:type_name -> google.protobuf.Timestamp - 3, // 84: openshell.v1.ProviderReadinessObservation.reason:type_name -> openshell.v1.ProviderReadinessReason - 74, // 85: openshell.v1.ProviderReadinessStatus.receipt:type_name -> openshell.v1.ProviderMutationReceipt - 2, // 86: openshell.v1.ProviderReadinessStatus.state:type_name -> openshell.v1.ProviderReadinessState - 3, // 87: openshell.v1.ProviderReadinessStatus.reason:type_name -> openshell.v1.ProviderReadinessReason - 75, // 88: openshell.v1.ProviderReadinessStatus.observed:type_name -> openshell.v1.ProviderReadinessObservation - 260, // 89: openshell.v1.ProviderReadinessStatus.observed_time:type_name -> google.protobuf.Timestamp - 260, // 90: openshell.v1.ProviderReadinessStatus.evaluated_time:type_name -> google.protobuf.Timestamp - 73, // 91: openshell.v1.ProviderReadinessStatus.operation:type_name -> openshell.v1.ConfigUpdateOperation - 265, // 92: openshell.v1.GetSandboxProviderStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 76, // 93: openshell.v1.GetSandboxProviderStatusResponse.status:type_name -> openshell.v1.ProviderReadinessStatus - 75, // 94: openshell.v1.ReportProviderReadinessRequest.observation:type_name -> openshell.v1.ProviderReadinessObservation - 264, // 95: openshell.v1.ReportProviderReadinessResponse.report_interval:type_name -> google.protobuf.Duration - 264, // 96: openshell.v1.ReportProviderReadinessResponse.observation_ttl:type_name -> google.protobuf.Duration - 14, // 97: openshell.v1.DeleteSandboxResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 260, // 98: openshell.v1.CreateSshSessionResponse.expiration_time:type_name -> google.protobuf.Timestamp - 265, // 99: openshell.v1.ExposeServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 100: openshell.v1.GetServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 101: openshell.v1.ListServicesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 91, // 102: openshell.v1.ListServicesResponse.services:type_name -> openshell.v1.ServiceEndpointResponse - 265, // 103: openshell.v1.DeleteServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 14, // 104: openshell.v1.DeleteServiceResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 261, // 105: openshell.v1.ServiceEndpoint.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 90, // 106: openshell.v1.ServiceEndpointResponse.endpoint:type_name -> openshell.v1.ServiceEndpoint - 14, // 107: openshell.v1.RevokeSshSessionResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 247, // 108: openshell.v1.ExecSandboxRequest.environment:type_name -> openshell.v1.ExecSandboxRequest.EnvironmentEntry - 264, // 109: openshell.v1.ExecSandboxRequest.execution_timeout:type_name -> google.protobuf.Duration - 95, // 110: openshell.v1.ExecSandboxEvent.stdout:type_name -> openshell.v1.ExecSandboxStdout - 96, // 111: openshell.v1.ExecSandboxEvent.stderr:type_name -> openshell.v1.ExecSandboxStderr - 97, // 112: openshell.v1.ExecSandboxEvent.exit:type_name -> openshell.v1.ExecSandboxExit - 187, // 113: openshell.v1.TcpForwardInit.ssh:type_name -> openshell.v1.SshRelayTarget - 188, // 114: openshell.v1.TcpForwardInit.tcp:type_name -> openshell.v1.TcpRelayTarget - 99, // 115: openshell.v1.TcpForwardFrame.init:type_name -> openshell.v1.TcpForwardInit - 94, // 116: openshell.v1.ExecSandboxInput.start:type_name -> openshell.v1.ExecSandboxRequest - 102, // 117: openshell.v1.ExecSandboxInput.resize:type_name -> openshell.v1.ExecSandboxWindowResize - 261, // 118: openshell.v1.SshSession.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 260, // 119: openshell.v1.SshSession.expiration_time:type_name -> google.protobuf.Timestamp - 260, // 120: openshell.v1.WatchSandboxRequest.since_time:type_name -> google.protobuf.Timestamp - 32, // 121: openshell.v1.SandboxStreamEvent.sandbox:type_name -> openshell.v1.Sandbox - 106, // 122: openshell.v1.SandboxStreamEvent.log:type_name -> openshell.v1.SandboxLogLine - 46, // 123: openshell.v1.SandboxStreamEvent.event:type_name -> openshell.v1.PlatformEvent - 107, // 124: openshell.v1.SandboxStreamEvent.warning:type_name -> openshell.v1.SandboxStreamWarning - 198, // 125: openshell.v1.SandboxStreamEvent.draft_policy_update:type_name -> openshell.v1.DraftPolicyUpdate - 260, // 126: openshell.v1.SandboxLogLine.event_time:type_name -> google.protobuf.Timestamp - 248, // 127: openshell.v1.SandboxLogLine.fields:type_name -> openshell.v1.SandboxLogLine.FieldsEntry - 266, // 128: openshell.v1.CreateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider - 265, // 129: openshell.v1.CreateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 130: openshell.v1.GetProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 131: openshell.v1.ListProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 266, // 132: openshell.v1.UpdateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider - 249, // 133: openshell.v1.UpdateProviderRequest.credential_expiration_times:type_name -> openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry - 265, // 134: openshell.v1.UpdateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 135: openshell.v1.DeleteProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 266, // 136: openshell.v1.ProviderResponse.provider:type_name -> openshell.datamodel.v1.Provider - 74, // 137: openshell.v1.ProviderResponse.target_receipts:type_name -> openshell.v1.ProviderMutationReceipt - 266, // 138: openshell.v1.ListProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider - 136, // 139: openshell.v1.ProviderProfileImportItem.profile:type_name -> openshell.v1.ProviderProfile - 264, // 140: openshell.v1.ProviderCredentialTokenGrant.cache_ttl:type_name -> google.protobuf.Duration - 119, // 141: openshell.v1.ProviderCredentialTokenGrant.audience_overrides:type_name -> openshell.v1.ProviderCredentialTokenGrantAudienceOverride - 7, // 142: openshell.v1.ProviderCredentialTokenGrant.grant_type:type_name -> openshell.v1.ProviderCredentialTokenGrantType - 120, // 143: openshell.v1.ProviderCredentialTokenGrant.subject_token:type_name -> openshell.v1.ProviderCredentialTokenGrantSubjectToken - 125, // 144: openshell.v1.ProviderProfileCredential.refresh:type_name -> openshell.v1.ProviderCredentialRefresh - 121, // 145: openshell.v1.ProviderProfileCredential.token_grant:type_name -> openshell.v1.ProviderCredentialTokenGrant - 8, // 146: openshell.v1.ProviderCredentialRefresh.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 264, // 147: openshell.v1.ProviderCredentialRefresh.refresh_before:type_name -> google.protobuf.Duration - 264, // 148: openshell.v1.ProviderCredentialRefresh.max_lifetime:type_name -> google.protobuf.Duration - 123, // 149: openshell.v1.ProviderCredentialRefresh.material:type_name -> openshell.v1.ProviderCredentialRefreshMaterial - 124, // 150: openshell.v1.ProviderCredentialRefresh.additional_outputs:type_name -> openshell.v1.ProviderCredentialRefreshOutput - 8, // 151: openshell.v1.ProviderCredentialRefreshStatus.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 260, // 152: openshell.v1.ProviderCredentialRefreshStatus.expiration_time:type_name -> google.protobuf.Timestamp - 260, // 153: openshell.v1.ProviderCredentialRefreshStatus.next_refresh_time:type_name -> google.protobuf.Timestamp - 260, // 154: openshell.v1.ProviderCredentialRefreshStatus.last_refresh_time:type_name -> google.protobuf.Timestamp - 13, // 155: openshell.v1.ProviderCredentialRefreshStatus.recovery_action:type_name -> openshell.v1.ProviderCredentialRefreshRecoveryAction - 260, // 156: openshell.v1.ProviderCredentialRefreshStatus.last_error_time:type_name -> google.protobuf.Timestamp - 265, // 157: openshell.v1.GetProviderRefreshStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 126, // 158: openshell.v1.GetProviderRefreshStatusResponse.credentials:type_name -> openshell.v1.ProviderCredentialRefreshStatus - 8, // 159: openshell.v1.ConfigureProviderRefreshRequest.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy - 250, // 160: openshell.v1.ConfigureProviderRefreshRequest.material:type_name -> openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry - 260, // 161: openshell.v1.ConfigureProviderRefreshRequest.expiration_time:type_name -> google.protobuf.Timestamp - 265, // 162: openshell.v1.ConfigureProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 126, // 163: openshell.v1.ConfigureProviderRefreshResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus - 265, // 164: openshell.v1.RotateProviderCredentialRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 126, // 165: openshell.v1.RotateProviderCredentialResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus - 265, // 166: openshell.v1.DeleteProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 14, // 167: openshell.v1.DeleteProviderRefreshResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 9, // 168: openshell.v1.ProviderProfile.category:type_name -> openshell.v1.ProviderProfileCategory - 122, // 169: openshell.v1.ProviderProfile.credentials:type_name -> openshell.v1.ProviderProfileCredential - 268, // 170: openshell.v1.ProviderProfile.endpoints:type_name -> openshell.sandbox.v1.NetworkEndpoint - 269, // 171: openshell.v1.ProviderProfile.binaries:type_name -> openshell.sandbox.v1.NetworkBinary - 127, // 172: openshell.v1.ProviderProfile.discovery:type_name -> openshell.v1.ProviderProfileDiscovery - 251, // 173: openshell.v1.ProviderProfile.annotations:type_name -> openshell.v1.ProviderProfile.AnnotationsEntry - 136, // 174: openshell.v1.ProviderProfileResponse.profile:type_name -> openshell.v1.ProviderProfile - 136, // 175: openshell.v1.ListProviderProfilesResponse.profiles:type_name -> openshell.v1.ProviderProfile - 117, // 176: openshell.v1.ImportProviderProfilesRequest.profiles:type_name -> openshell.v1.ProviderProfileImportItem - 118, // 177: openshell.v1.ImportProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic - 136, // 178: openshell.v1.ImportProviderProfilesResponse.profiles:type_name -> openshell.v1.ProviderProfile - 117, // 179: openshell.v1.UpdateProviderProfilesRequest.profile:type_name -> openshell.v1.ProviderProfileImportItem - 118, // 180: openshell.v1.UpdateProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic - 136, // 181: openshell.v1.UpdateProviderProfilesResponse.profile:type_name -> openshell.v1.ProviderProfile - 117, // 182: openshell.v1.LintProviderProfilesRequest.profiles:type_name -> openshell.v1.ProviderProfileImportItem - 118, // 183: openshell.v1.LintProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic - 14, // 184: openshell.v1.DeleteProviderResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 14, // 185: openshell.v1.DeleteProviderProfileResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 149, // 186: openshell.v1.StaticCredentialBinding.endpoints:type_name -> openshell.v1.StaticCredentialEndpointBinding - 252, // 187: openshell.v1.GetSandboxProviderEnvironmentResponse.environment:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry - 253, // 188: openshell.v1.GetSandboxProviderEnvironmentResponse.credential_expiration_times:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry - 254, // 189: openshell.v1.GetSandboxProviderEnvironmentResponse.dynamic_credentials:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry - 255, // 190: openshell.v1.GetSandboxProviderEnvironmentResponse.static_credential_bindings:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry - 3, // 191: openshell.v1.GetSandboxProviderEnvironmentResponse.readiness_reason:type_name -> openshell.v1.ProviderReadinessReason - 264, // 192: openshell.v1.ExchangeProviderSubjectTokenResponse.expires_after:type_name -> google.protobuf.Duration - 262, // 193: openshell.v1.UpdateConfigRequest.policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 270, // 194: openshell.v1.UpdateConfigRequest.setting_value:type_name -> openshell.sandbox.v1.SettingValue - 155, // 195: openshell.v1.UpdateConfigRequest.merge_operations:type_name -> openshell.v1.PolicyMergeOperation - 256, // 196: openshell.v1.UpdateConfigRequest.annotations:type_name -> openshell.v1.UpdateConfigRequest.AnnotationsEntry - 265, // 197: openshell.v1.UpdateConfigRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 156, // 198: openshell.v1.PolicyMergeOperation.add_rule:type_name -> openshell.v1.AddNetworkRule - 157, // 199: openshell.v1.PolicyMergeOperation.remove_endpoint:type_name -> openshell.v1.RemoveNetworkEndpoint - 158, // 200: openshell.v1.PolicyMergeOperation.remove_rule:type_name -> openshell.v1.RemoveNetworkRule - 160, // 201: openshell.v1.PolicyMergeOperation.add_deny_rules:type_name -> openshell.v1.AddDenyRules - 161, // 202: openshell.v1.PolicyMergeOperation.add_allow_rules:type_name -> openshell.v1.AddAllowRules - 162, // 203: openshell.v1.PolicyMergeOperation.remove_binary:type_name -> openshell.v1.RemoveNetworkBinary - 271, // 204: openshell.v1.AddNetworkRule.rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 269, // 205: openshell.v1.L7RuleTarget.binaries:type_name -> openshell.sandbox.v1.NetworkBinary - 272, // 206: openshell.v1.AddDenyRules.deny_rules:type_name -> openshell.sandbox.v1.L7DenyRule - 159, // 207: openshell.v1.AddDenyRules.target:type_name -> openshell.v1.L7RuleTarget - 273, // 208: openshell.v1.AddAllowRules.rules:type_name -> openshell.sandbox.v1.L7Rule - 159, // 209: openshell.v1.AddAllowRules.target:type_name -> openshell.v1.L7RuleTarget - 257, // 210: openshell.v1.UpdateConfigResponse.annotations:type_name -> openshell.v1.UpdateConfigResponse.AnnotationsEntry - 265, // 211: openshell.v1.GetSandboxPolicyStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 170, // 212: openshell.v1.GetSandboxPolicyStatusResponse.revision:type_name -> openshell.v1.SandboxPolicyRevision - 265, // 213: openshell.v1.ListSandboxPoliciesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 170, // 214: openshell.v1.ListSandboxPoliciesResponse.revisions:type_name -> openshell.v1.SandboxPolicyRevision - 10, // 215: openshell.v1.ReportPolicyStatusRequest.status:type_name -> openshell.v1.PolicyStatus - 10, // 216: openshell.v1.SandboxPolicyRevision.status:type_name -> openshell.v1.PolicyStatus - 260, // 217: openshell.v1.SandboxPolicyRevision.created_time:type_name -> google.protobuf.Timestamp - 260, // 218: openshell.v1.SandboxPolicyRevision.loaded_time:type_name -> google.protobuf.Timestamp - 262, // 219: openshell.v1.SandboxPolicyRevision.policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 258, // 220: openshell.v1.SandboxPolicyRevision.provenance:type_name -> openshell.v1.SandboxPolicyRevision.ProvenanceEntry - 260, // 221: openshell.v1.GetSandboxLogsRequest.since_time:type_name -> google.protobuf.Timestamp - 265, // 222: openshell.v1.GetSandboxLogsRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 106, // 223: openshell.v1.PushSandboxLogsRequest.logs:type_name -> openshell.v1.SandboxLogLine - 106, // 224: openshell.v1.GetSandboxLogsResponse.logs:type_name -> openshell.v1.SandboxLogLine - 177, // 225: openshell.v1.SupervisorMessage.hello:type_name -> openshell.v1.SupervisorHello - 180, // 226: openshell.v1.SupervisorMessage.heartbeat:type_name -> openshell.v1.SupervisorHeartbeat - 191, // 227: openshell.v1.SupervisorMessage.relay_open_result:type_name -> openshell.v1.RelayOpenResult - 192, // 228: openshell.v1.SupervisorMessage.relay_close:type_name -> openshell.v1.RelayClose - 178, // 229: openshell.v1.GatewayMessage.session_accepted:type_name -> openshell.v1.SessionAccepted - 179, // 230: openshell.v1.GatewayMessage.session_rejected:type_name -> openshell.v1.SessionRejected - 181, // 231: openshell.v1.GatewayMessage.heartbeat:type_name -> openshell.v1.GatewayHeartbeat - 186, // 232: openshell.v1.GatewayMessage.relay_open:type_name -> openshell.v1.RelayOpen - 192, // 233: openshell.v1.GatewayMessage.relay_close:type_name -> openshell.v1.RelayClose - 264, // 234: openshell.v1.SessionAccepted.heartbeat_interval:type_name -> google.protobuf.Duration - 187, // 235: openshell.v1.RelayOpen.ssh:type_name -> openshell.v1.SshRelayTarget - 188, // 236: openshell.v1.RelayOpen.tcp:type_name -> openshell.v1.TcpRelayTarget - 189, // 237: openshell.v1.RelayFrame.init:type_name -> openshell.v1.RelayInit - 260, // 238: openshell.v1.DenialSummary.first_seen_time:type_name -> google.protobuf.Timestamp - 260, // 239: openshell.v1.DenialSummary.last_seen_time:type_name -> google.protobuf.Timestamp - 193, // 240: openshell.v1.DenialSummary.l7_request_samples:type_name -> openshell.v1.L7RequestSample - 195, // 241: openshell.v1.NetworkActivitySummary.denials_by_group:type_name -> openshell.v1.DenialGroupCount - 271, // 242: openshell.v1.PolicyChunk.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 260, // 243: openshell.v1.PolicyChunk.created_time:type_name -> google.protobuf.Timestamp - 260, // 244: openshell.v1.PolicyChunk.decided_time:type_name -> google.protobuf.Timestamp - 260, // 245: openshell.v1.PolicyChunk.first_seen_time:type_name -> google.protobuf.Timestamp - 260, // 246: openshell.v1.PolicyChunk.last_seen_time:type_name -> google.protobuf.Timestamp - 262, // 247: openshell.v1.PolicyChunk.current_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 262, // 248: openshell.v1.PolicyChunk.candidate_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy - 194, // 249: openshell.v1.SubmitPolicyAnalysisRequest.summaries:type_name -> openshell.v1.DenialSummary - 197, // 250: openshell.v1.SubmitPolicyAnalysisRequest.proposed_chunks:type_name -> openshell.v1.PolicyChunk - 196, // 251: openshell.v1.SubmitPolicyAnalysisRequest.network_activity_summaries:type_name -> openshell.v1.NetworkActivitySummary - 265, // 252: openshell.v1.GetDraftPolicyRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 197, // 253: openshell.v1.GetDraftPolicyResponse.chunks:type_name -> openshell.v1.PolicyChunk - 260, // 254: openshell.v1.GetDraftPolicyResponse.last_analyzed_time:type_name -> google.protobuf.Timestamp - 265, // 255: openshell.v1.ApproveDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 256: openshell.v1.RejectDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 207, // 257: openshell.v1.ApproveAllDraftChunksRequest.approvals:type_name -> openshell.v1.DraftChunkApproval - 265, // 258: openshell.v1.ApproveAllDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 271, // 259: openshell.v1.EditDraftChunkRequest.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule - 265, // 260: openshell.v1.EditDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 261: openshell.v1.UndoDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 262: openshell.v1.ClearDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 265, // 263: openshell.v1.GetDraftHistoryRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector - 260, // 264: openshell.v1.DraftHistoryEntry.event_time:type_name -> google.protobuf.Timestamp - 217, // 265: openshell.v1.GetDraftHistoryResponse.entries:type_name -> openshell.v1.DraftHistoryEntry - 259, // 266: openshell.v1.CreateWorkspaceRequest.labels:type_name -> openshell.v1.CreateWorkspaceRequest.LabelsEntry - 274, // 267: openshell.v1.CreateWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace - 274, // 268: openshell.v1.GetWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace - 274, // 269: openshell.v1.ListWorkspacesResponse.workspaces:type_name -> openshell.datamodel.v1.Workspace - 14, // 270: openshell.v1.DeleteWorkspaceResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 261, // 271: openshell.v1.WorkspaceMember.metadata:type_name -> openshell.datamodel.v1.ObjectMeta - 12, // 272: openshell.v1.WorkspaceMember.role:type_name -> openshell.v1.WorkspaceRole - 12, // 273: openshell.v1.AddWorkspaceMemberRequest.role:type_name -> openshell.v1.WorkspaceRole - 227, // 274: openshell.v1.AddWorkspaceMemberResponse.member:type_name -> openshell.v1.WorkspaceMember - 14, // 275: openshell.v1.RemoveWorkspaceMemberResponse.outcome:type_name -> openshell.v1.DeletionOutcome - 227, // 276: openshell.v1.ListWorkspaceMembersResponse.members:type_name -> openshell.v1.WorkspaceMember - 260, // 277: openshell.v1.ExtensionServiceCredential.expiration_time:type_name -> google.protobuf.Timestamp - 15, // 278: openshell.v1.EndpointObservation.result:type_name -> openshell.v1.EndpointResult - 235, // 279: openshell.v1.ReportEndpointStatusRequest.observations:type_name -> openshell.v1.EndpointObservation - 15, // 280: openshell.v1.EndpointStatus.last_result:type_name -> openshell.v1.EndpointResult - 260, // 281: openshell.v1.EndpointStatus.last_reported_time:type_name -> google.protobuf.Timestamp - 260, // 282: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp - 260, // 283: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp - 122, // 284: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry.value:type_name -> openshell.v1.ProviderProfileCredential - 150, // 285: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry.value:type_name -> openshell.v1.StaticCredentialBinding - 20, // 286: openshell.v1.OpenShell.Health:input_type -> openshell.v1.HealthRequest - 22, // 287: openshell.v1.OpenShell.GetCurrentUser:input_type -> openshell.v1.GetCurrentUserRequest - 24, // 288: openshell.v1.OpenShell.GetGatewayInfo:input_type -> openshell.v1.GetGatewayInfoRequest - 47, // 289: openshell.v1.OpenShell.CreateSandbox:input_type -> openshell.v1.CreateSandboxRequest - 55, // 290: openshell.v1.OpenShell.BeginRootfsTarStaging:input_type -> openshell.v1.BeginRootfsTarStagingRequest - 57, // 291: openshell.v1.OpenShell.GetSandbox:input_type -> openshell.v1.GetSandboxRequest - 58, // 292: openshell.v1.OpenShell.ListSandboxes:input_type -> openshell.v1.ListSandboxesRequest - 48, // 293: openshell.v1.OpenShell.CreateSandboxTemplate:input_type -> openshell.v1.CreateSandboxTemplateRequest - 49, // 294: openshell.v1.OpenShell.GetSandboxTemplate:input_type -> openshell.v1.GetSandboxTemplateRequest - 50, // 295: openshell.v1.OpenShell.ListSandboxTemplates:input_type -> openshell.v1.ListSandboxTemplatesRequest - 51, // 296: openshell.v1.OpenShell.DeleteSandboxTemplate:input_type -> openshell.v1.DeleteSandboxTemplateRequest - 59, // 297: openshell.v1.OpenShell.ListSandboxProviders:input_type -> openshell.v1.ListSandboxProvidersRequest - 60, // 298: openshell.v1.OpenShell.AttachSandboxProvider:input_type -> openshell.v1.AttachSandboxProviderRequest - 61, // 299: openshell.v1.OpenShell.DetachSandboxProvider:input_type -> openshell.v1.DetachSandboxProviderRequest - 77, // 300: openshell.v1.OpenShell.GetSandboxProviderStatus:input_type -> openshell.v1.GetSandboxProviderStatusRequest - 62, // 301: openshell.v1.OpenShell.DeleteSandbox:input_type -> openshell.v1.DeleteSandboxRequest - 63, // 302: openshell.v1.OpenShell.StopSandbox:input_type -> openshell.v1.StopSandboxRequest - 64, // 303: openshell.v1.OpenShell.StartSandbox:input_type -> openshell.v1.StartSandboxRequest - 82, // 304: openshell.v1.OpenShell.CreateSshSession:input_type -> openshell.v1.CreateSshSessionRequest - 84, // 305: openshell.v1.OpenShell.ExposeService:input_type -> openshell.v1.ExposeServiceRequest - 85, // 306: openshell.v1.OpenShell.GetService:input_type -> openshell.v1.GetServiceRequest - 86, // 307: openshell.v1.OpenShell.ListServices:input_type -> openshell.v1.ListServicesRequest - 88, // 308: openshell.v1.OpenShell.DeleteService:input_type -> openshell.v1.DeleteServiceRequest - 92, // 309: openshell.v1.OpenShell.RevokeSshSession:input_type -> openshell.v1.RevokeSshSessionRequest - 94, // 310: openshell.v1.OpenShell.ExecSandbox:input_type -> openshell.v1.ExecSandboxRequest - 100, // 311: openshell.v1.OpenShell.ForwardTcp:input_type -> openshell.v1.TcpForwardFrame - 101, // 312: openshell.v1.OpenShell.ExecSandboxInteractive:input_type -> openshell.v1.ExecSandboxInput - 108, // 313: openshell.v1.OpenShell.CreateProvider:input_type -> openshell.v1.CreateProviderRequest - 109, // 314: openshell.v1.OpenShell.GetProvider:input_type -> openshell.v1.GetProviderRequest - 110, // 315: openshell.v1.OpenShell.ListProviders:input_type -> openshell.v1.ListProvidersRequest - 115, // 316: openshell.v1.OpenShell.ListProviderProfiles:input_type -> openshell.v1.ListProviderProfilesRequest - 116, // 317: openshell.v1.OpenShell.GetProviderProfile:input_type -> openshell.v1.GetProviderProfileRequest - 139, // 318: openshell.v1.OpenShell.ImportProviderProfiles:input_type -> openshell.v1.ImportProviderProfilesRequest - 141, // 319: openshell.v1.OpenShell.UpdateProviderProfiles:input_type -> openshell.v1.UpdateProviderProfilesRequest - 143, // 320: openshell.v1.OpenShell.LintProviderProfiles:input_type -> openshell.v1.LintProviderProfilesRequest - 111, // 321: openshell.v1.OpenShell.UpdateProvider:input_type -> openshell.v1.UpdateProviderRequest - 128, // 322: openshell.v1.OpenShell.GetProviderRefreshStatus:input_type -> openshell.v1.GetProviderRefreshStatusRequest - 130, // 323: openshell.v1.OpenShell.ConfigureProviderRefresh:input_type -> openshell.v1.ConfigureProviderRefreshRequest - 132, // 324: openshell.v1.OpenShell.RotateProviderCredential:input_type -> openshell.v1.RotateProviderCredentialRequest - 134, // 325: openshell.v1.OpenShell.DeleteProviderRefresh:input_type -> openshell.v1.DeleteProviderRefreshRequest - 112, // 326: openshell.v1.OpenShell.DeleteProvider:input_type -> openshell.v1.DeleteProviderRequest - 146, // 327: openshell.v1.OpenShell.DeleteProviderProfile:input_type -> openshell.v1.DeleteProviderProfileRequest - 275, // 328: openshell.v1.OpenShell.GetSandboxConfig:input_type -> openshell.sandbox.v1.GetSandboxConfigRequest - 276, // 329: openshell.v1.OpenShell.GetGatewayConfig:input_type -> openshell.sandbox.v1.GetGatewayConfigRequest - 154, // 330: openshell.v1.OpenShell.UpdateConfig:input_type -> openshell.v1.UpdateConfigRequest - 164, // 331: openshell.v1.OpenShell.GetSandboxPolicyStatus:input_type -> openshell.v1.GetSandboxPolicyStatusRequest - 166, // 332: openshell.v1.OpenShell.ListSandboxPolicies:input_type -> openshell.v1.ListSandboxPoliciesRequest - 168, // 333: openshell.v1.OpenShell.ReportPolicyStatus:input_type -> openshell.v1.ReportPolicyStatusRequest - 236, // 334: openshell.v1.OpenShell.ReportEndpointStatus:input_type -> openshell.v1.ReportEndpointStatusRequest - 79, // 335: openshell.v1.OpenShell.ReportProviderReadiness:input_type -> openshell.v1.ReportProviderReadinessRequest - 148, // 336: openshell.v1.OpenShell.GetSandboxProviderEnvironment:input_type -> openshell.v1.GetSandboxProviderEnvironmentRequest - 152, // 337: openshell.v1.OpenShell.ExchangeProviderSubjectToken:input_type -> openshell.v1.ExchangeProviderSubjectTokenRequest - 171, // 338: openshell.v1.OpenShell.GetSandboxLogs:input_type -> openshell.v1.GetSandboxLogsRequest - 172, // 339: openshell.v1.OpenShell.PushSandboxLogs:input_type -> openshell.v1.PushSandboxLogsRequest - 175, // 340: openshell.v1.OpenShell.ConnectSupervisor:input_type -> openshell.v1.SupervisorMessage - 182, // 341: openshell.v1.OpenShell.ReportMainProcessExit:input_type -> openshell.v1.ReportMainProcessExitRequest - 184, // 342: openshell.v1.OpenShell.FinalizeMainProcessExit:input_type -> openshell.v1.FinalizeMainProcessExitRequest - 190, // 343: openshell.v1.OpenShell.RelayStream:input_type -> openshell.v1.RelayFrame - 104, // 344: openshell.v1.OpenShell.WatchSandbox:input_type -> openshell.v1.WatchSandboxRequest - 199, // 345: openshell.v1.OpenShell.SubmitPolicyAnalysis:input_type -> openshell.v1.SubmitPolicyAnalysisRequest - 201, // 346: openshell.v1.OpenShell.GetDraftPolicy:input_type -> openshell.v1.GetDraftPolicyRequest - 203, // 347: openshell.v1.OpenShell.ApproveDraftChunk:input_type -> openshell.v1.ApproveDraftChunkRequest - 205, // 348: openshell.v1.OpenShell.RejectDraftChunk:input_type -> openshell.v1.RejectDraftChunkRequest - 208, // 349: openshell.v1.OpenShell.ApproveAllDraftChunks:input_type -> openshell.v1.ApproveAllDraftChunksRequest - 210, // 350: openshell.v1.OpenShell.EditDraftChunk:input_type -> openshell.v1.EditDraftChunkRequest - 212, // 351: openshell.v1.OpenShell.UndoDraftChunk:input_type -> openshell.v1.UndoDraftChunkRequest - 214, // 352: openshell.v1.OpenShell.ClearDraftChunks:input_type -> openshell.v1.ClearDraftChunksRequest - 216, // 353: openshell.v1.OpenShell.GetDraftHistory:input_type -> openshell.v1.GetDraftHistoryRequest - 16, // 354: openshell.v1.OpenShell.IssueSandboxToken:input_type -> openshell.v1.IssueSandboxTokenRequest - 18, // 355: openshell.v1.OpenShell.RefreshSandboxToken:input_type -> openshell.v1.RefreshSandboxTokenRequest - 219, // 356: openshell.v1.OpenShell.CreateWorkspace:input_type -> openshell.v1.CreateWorkspaceRequest - 221, // 357: openshell.v1.OpenShell.GetWorkspace:input_type -> openshell.v1.GetWorkspaceRequest - 223, // 358: openshell.v1.OpenShell.ListWorkspaces:input_type -> openshell.v1.ListWorkspacesRequest - 225, // 359: openshell.v1.OpenShell.DeleteWorkspace:input_type -> openshell.v1.DeleteWorkspaceRequest - 228, // 360: openshell.v1.OpenShell.AddWorkspaceMember:input_type -> openshell.v1.AddWorkspaceMemberRequest - 230, // 361: openshell.v1.OpenShell.RemoveWorkspaceMember:input_type -> openshell.v1.RemoveWorkspaceMemberRequest - 232, // 362: openshell.v1.OpenShell.ListWorkspaceMembers:input_type -> openshell.v1.ListWorkspaceMembersRequest - 21, // 363: openshell.v1.OpenShell.Health:output_type -> openshell.v1.HealthResponse - 23, // 364: openshell.v1.OpenShell.GetCurrentUser:output_type -> openshell.v1.GetCurrentUserResponse - 25, // 365: openshell.v1.OpenShell.GetGatewayInfo:output_type -> openshell.v1.GetGatewayInfoResponse - 65, // 366: openshell.v1.OpenShell.CreateSandbox:output_type -> openshell.v1.SandboxResponse - 56, // 367: openshell.v1.OpenShell.BeginRootfsTarStaging:output_type -> openshell.v1.BeginRootfsTarStagingResponse - 65, // 368: openshell.v1.OpenShell.GetSandbox:output_type -> openshell.v1.SandboxResponse - 66, // 369: openshell.v1.OpenShell.ListSandboxes:output_type -> openshell.v1.ListSandboxesResponse - 52, // 370: openshell.v1.OpenShell.CreateSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse - 52, // 371: openshell.v1.OpenShell.GetSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse - 53, // 372: openshell.v1.OpenShell.ListSandboxTemplates:output_type -> openshell.v1.ListSandboxTemplatesResponse - 54, // 373: openshell.v1.OpenShell.DeleteSandboxTemplate:output_type -> openshell.v1.DeleteSandboxTemplateResponse - 67, // 374: openshell.v1.OpenShell.ListSandboxProviders:output_type -> openshell.v1.ListSandboxProvidersResponse - 68, // 375: openshell.v1.OpenShell.AttachSandboxProvider:output_type -> openshell.v1.AttachSandboxProviderResponse - 69, // 376: openshell.v1.OpenShell.DetachSandboxProvider:output_type -> openshell.v1.DetachSandboxProviderResponse - 78, // 377: openshell.v1.OpenShell.GetSandboxProviderStatus:output_type -> openshell.v1.GetSandboxProviderStatusResponse - 81, // 378: openshell.v1.OpenShell.DeleteSandbox:output_type -> openshell.v1.DeleteSandboxResponse - 65, // 379: openshell.v1.OpenShell.StopSandbox:output_type -> openshell.v1.SandboxResponse - 65, // 380: openshell.v1.OpenShell.StartSandbox:output_type -> openshell.v1.SandboxResponse - 83, // 381: openshell.v1.OpenShell.CreateSshSession:output_type -> openshell.v1.CreateSshSessionResponse - 91, // 382: openshell.v1.OpenShell.ExposeService:output_type -> openshell.v1.ServiceEndpointResponse - 91, // 383: openshell.v1.OpenShell.GetService:output_type -> openshell.v1.ServiceEndpointResponse - 87, // 384: openshell.v1.OpenShell.ListServices:output_type -> openshell.v1.ListServicesResponse - 89, // 385: openshell.v1.OpenShell.DeleteService:output_type -> openshell.v1.DeleteServiceResponse - 93, // 386: openshell.v1.OpenShell.RevokeSshSession:output_type -> openshell.v1.RevokeSshSessionResponse - 98, // 387: openshell.v1.OpenShell.ExecSandbox:output_type -> openshell.v1.ExecSandboxEvent - 100, // 388: openshell.v1.OpenShell.ForwardTcp:output_type -> openshell.v1.TcpForwardFrame - 98, // 389: openshell.v1.OpenShell.ExecSandboxInteractive:output_type -> openshell.v1.ExecSandboxEvent - 113, // 390: openshell.v1.OpenShell.CreateProvider:output_type -> openshell.v1.ProviderResponse - 113, // 391: openshell.v1.OpenShell.GetProvider:output_type -> openshell.v1.ProviderResponse - 114, // 392: openshell.v1.OpenShell.ListProviders:output_type -> openshell.v1.ListProvidersResponse - 138, // 393: openshell.v1.OpenShell.ListProviderProfiles:output_type -> openshell.v1.ListProviderProfilesResponse - 137, // 394: openshell.v1.OpenShell.GetProviderProfile:output_type -> openshell.v1.ProviderProfileResponse - 140, // 395: openshell.v1.OpenShell.ImportProviderProfiles:output_type -> openshell.v1.ImportProviderProfilesResponse - 142, // 396: openshell.v1.OpenShell.UpdateProviderProfiles:output_type -> openshell.v1.UpdateProviderProfilesResponse - 144, // 397: openshell.v1.OpenShell.LintProviderProfiles:output_type -> openshell.v1.LintProviderProfilesResponse - 113, // 398: openshell.v1.OpenShell.UpdateProvider:output_type -> openshell.v1.ProviderResponse - 129, // 399: openshell.v1.OpenShell.GetProviderRefreshStatus:output_type -> openshell.v1.GetProviderRefreshStatusResponse - 131, // 400: openshell.v1.OpenShell.ConfigureProviderRefresh:output_type -> openshell.v1.ConfigureProviderRefreshResponse - 133, // 401: openshell.v1.OpenShell.RotateProviderCredential:output_type -> openshell.v1.RotateProviderCredentialResponse - 135, // 402: openshell.v1.OpenShell.DeleteProviderRefresh:output_type -> openshell.v1.DeleteProviderRefreshResponse - 145, // 403: openshell.v1.OpenShell.DeleteProvider:output_type -> openshell.v1.DeleteProviderResponse - 147, // 404: openshell.v1.OpenShell.DeleteProviderProfile:output_type -> openshell.v1.DeleteProviderProfileResponse - 277, // 405: openshell.v1.OpenShell.GetSandboxConfig:output_type -> openshell.sandbox.v1.GetSandboxConfigResponse - 278, // 406: openshell.v1.OpenShell.GetGatewayConfig:output_type -> openshell.sandbox.v1.GetGatewayConfigResponse - 163, // 407: openshell.v1.OpenShell.UpdateConfig:output_type -> openshell.v1.UpdateConfigResponse - 165, // 408: openshell.v1.OpenShell.GetSandboxPolicyStatus:output_type -> openshell.v1.GetSandboxPolicyStatusResponse - 167, // 409: openshell.v1.OpenShell.ListSandboxPolicies:output_type -> openshell.v1.ListSandboxPoliciesResponse - 169, // 410: openshell.v1.OpenShell.ReportPolicyStatus:output_type -> openshell.v1.ReportPolicyStatusResponse - 237, // 411: openshell.v1.OpenShell.ReportEndpointStatus:output_type -> openshell.v1.ReportEndpointStatusResponse - 80, // 412: openshell.v1.OpenShell.ReportProviderReadiness:output_type -> openshell.v1.ReportProviderReadinessResponse - 151, // 413: openshell.v1.OpenShell.GetSandboxProviderEnvironment:output_type -> openshell.v1.GetSandboxProviderEnvironmentResponse - 153, // 414: openshell.v1.OpenShell.ExchangeProviderSubjectToken:output_type -> openshell.v1.ExchangeProviderSubjectTokenResponse - 174, // 415: openshell.v1.OpenShell.GetSandboxLogs:output_type -> openshell.v1.GetSandboxLogsResponse - 173, // 416: openshell.v1.OpenShell.PushSandboxLogs:output_type -> openshell.v1.PushSandboxLogsResponse - 176, // 417: openshell.v1.OpenShell.ConnectSupervisor:output_type -> openshell.v1.GatewayMessage - 183, // 418: openshell.v1.OpenShell.ReportMainProcessExit:output_type -> openshell.v1.ReportMainProcessExitResponse - 185, // 419: openshell.v1.OpenShell.FinalizeMainProcessExit:output_type -> openshell.v1.FinalizeMainProcessExitResponse - 190, // 420: openshell.v1.OpenShell.RelayStream:output_type -> openshell.v1.RelayFrame - 105, // 421: openshell.v1.OpenShell.WatchSandbox:output_type -> openshell.v1.SandboxStreamEvent - 200, // 422: openshell.v1.OpenShell.SubmitPolicyAnalysis:output_type -> openshell.v1.SubmitPolicyAnalysisResponse - 202, // 423: openshell.v1.OpenShell.GetDraftPolicy:output_type -> openshell.v1.GetDraftPolicyResponse - 204, // 424: openshell.v1.OpenShell.ApproveDraftChunk:output_type -> openshell.v1.ApproveDraftChunkResponse - 206, // 425: openshell.v1.OpenShell.RejectDraftChunk:output_type -> openshell.v1.RejectDraftChunkResponse - 209, // 426: openshell.v1.OpenShell.ApproveAllDraftChunks:output_type -> openshell.v1.ApproveAllDraftChunksResponse - 211, // 427: openshell.v1.OpenShell.EditDraftChunk:output_type -> openshell.v1.EditDraftChunkResponse - 213, // 428: openshell.v1.OpenShell.UndoDraftChunk:output_type -> openshell.v1.UndoDraftChunkResponse - 215, // 429: openshell.v1.OpenShell.ClearDraftChunks:output_type -> openshell.v1.ClearDraftChunksResponse - 218, // 430: openshell.v1.OpenShell.GetDraftHistory:output_type -> openshell.v1.GetDraftHistoryResponse - 17, // 431: openshell.v1.OpenShell.IssueSandboxToken:output_type -> openshell.v1.IssueSandboxTokenResponse - 19, // 432: openshell.v1.OpenShell.RefreshSandboxToken:output_type -> openshell.v1.RefreshSandboxTokenResponse - 220, // 433: openshell.v1.OpenShell.CreateWorkspace:output_type -> openshell.v1.CreateWorkspaceResponse - 222, // 434: openshell.v1.OpenShell.GetWorkspace:output_type -> openshell.v1.GetWorkspaceResponse - 224, // 435: openshell.v1.OpenShell.ListWorkspaces:output_type -> openshell.v1.ListWorkspacesResponse - 226, // 436: openshell.v1.OpenShell.DeleteWorkspace:output_type -> openshell.v1.DeleteWorkspaceResponse - 229, // 437: openshell.v1.OpenShell.AddWorkspaceMember:output_type -> openshell.v1.AddWorkspaceMemberResponse - 231, // 438: openshell.v1.OpenShell.RemoveWorkspaceMember:output_type -> openshell.v1.RemoveWorkspaceMemberResponse - 233, // 439: openshell.v1.OpenShell.ListWorkspaceMembers:output_type -> openshell.v1.ListWorkspaceMembersResponse - 363, // [363:440] is the sub-list for method output_type - 286, // [286:363] is the sub-list for method input_type - 286, // [286:286] is the sub-list for extension type_name - 286, // [286:286] is the sub-list for extension extendee - 0, // [0:286] is the sub-list for field type_name + 242, // 38: openshell.v1.SandboxStatus.endpoint_statuses:type_name -> openshell.v1.EndpointStatus + 171, // 39: openshell.v1.SandboxStatus.configuration_admission:type_name -> openshell.v1.SandboxConfigurationAdmission + 243, // 40: openshell.v1.SandboxStatus.provisioning:type_name -> openshell.v1.SandboxProvisioning + 265, // 41: openshell.v1.SandboxCondition.transition_time:type_name -> google.protobuf.Timestamp + 265, // 42: openshell.v1.PlatformEvent.event_time:type_name -> google.protobuf.Timestamp + 249, // 43: openshell.v1.PlatformEvent.metadata:type_name -> openshell.v1.PlatformEvent.MetadataEntry + 34, // 44: openshell.v1.CreateSandboxRequest.spec:type_name -> openshell.v1.SandboxSpec + 250, // 45: openshell.v1.CreateSandboxRequest.labels:type_name -> openshell.v1.CreateSandboxRequest.LabelsEntry + 251, // 46: openshell.v1.CreateSandboxRequest.annotations:type_name -> openshell.v1.CreateSandboxRequest.AnnotationsEntry + 270, // 47: openshell.v1.CreateSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 38, // 48: openshell.v1.CreateSandboxTemplateRequest.template:type_name -> openshell.v1.SandboxWorkloadTemplate + 270, // 49: openshell.v1.CreateSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 50: openshell.v1.GetSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 51: openshell.v1.ListSandboxTemplatesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 52: openshell.v1.DeleteSandboxTemplateRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 38, // 53: openshell.v1.SandboxTemplateResponse.template:type_name -> openshell.v1.SandboxWorkloadTemplate + 38, // 54: openshell.v1.ListSandboxTemplatesResponse.templates:type_name -> openshell.v1.SandboxWorkloadTemplate + 15, // 55: openshell.v1.DeleteSandboxTemplateResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 270, // 56: openshell.v1.BeginRootfsTarStagingRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 57: openshell.v1.BeginRootfsTarStagingResponse.expiration_time:type_name -> google.protobuf.Timestamp + 270, // 58: openshell.v1.GetSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 59: openshell.v1.ListSandboxesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 60: openshell.v1.ListSandboxProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 61: openshell.v1.AttachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 62: openshell.v1.DetachSandboxProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 63: openshell.v1.DeleteSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 64: openshell.v1.StopSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 65: openshell.v1.StartSandboxRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 33, // 66: openshell.v1.SandboxResponse.sandbox:type_name -> openshell.v1.Sandbox + 33, // 67: openshell.v1.ListSandboxesResponse.sandboxes:type_name -> openshell.v1.Sandbox + 271, // 68: openshell.v1.ListSandboxProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider + 33, // 69: openshell.v1.AttachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox + 75, // 70: openshell.v1.AttachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt + 33, // 71: openshell.v1.DetachSandboxProviderResponse.sandbox:type_name -> openshell.v1.Sandbox + 75, // 72: openshell.v1.DetachSandboxProviderResponse.receipt:type_name -> openshell.v1.ProviderMutationReceipt + 73, // 73: openshell.v1.ConfigSnapshotRevision.sandbox_config:type_name -> openshell.v1.SandboxConfigRevision + 71, // 74: openshell.v1.ConfigSnapshotRevision.provider_target:type_name -> openshell.v1.ProviderDesiredIdentity + 272, // 75: openshell.v1.SandboxConfigRevision.policy_source:type_name -> openshell.sandbox.v1.PolicySource + 4, // 76: openshell.v1.ConfigUpdateOperation.component:type_name -> openshell.v1.ConfigComponent + 72, // 77: openshell.v1.ConfigUpdateOperation.target_revision:type_name -> openshell.v1.ConfigSnapshotRevision + 6, // 78: openshell.v1.ConfigUpdateOperation.state:type_name -> openshell.v1.ConfigUpdateOperationState + 5, // 79: openshell.v1.ConfigUpdateOperation.outcome:type_name -> openshell.v1.ConfigApplyOutcome + 265, // 80: openshell.v1.ConfigUpdateOperation.created_time:type_name -> google.protobuf.Timestamp + 265, // 81: openshell.v1.ConfigUpdateOperation.updated_time:type_name -> google.protobuf.Timestamp + 265, // 82: openshell.v1.ConfigUpdateOperation.completed_time:type_name -> google.protobuf.Timestamp + 1, // 83: openshell.v1.ProviderMutationReceipt.kind:type_name -> openshell.v1.ProviderMutationKind + 71, // 84: openshell.v1.ProviderMutationReceipt.desired:type_name -> openshell.v1.ProviderDesiredIdentity + 265, // 85: openshell.v1.ProviderMutationReceipt.persisted_time:type_name -> google.protobuf.Timestamp + 3, // 86: openshell.v1.ProviderReadinessObservation.reason:type_name -> openshell.v1.ProviderReadinessReason + 75, // 87: openshell.v1.ProviderReadinessStatus.receipt:type_name -> openshell.v1.ProviderMutationReceipt + 2, // 88: openshell.v1.ProviderReadinessStatus.state:type_name -> openshell.v1.ProviderReadinessState + 3, // 89: openshell.v1.ProviderReadinessStatus.reason:type_name -> openshell.v1.ProviderReadinessReason + 76, // 90: openshell.v1.ProviderReadinessStatus.observed:type_name -> openshell.v1.ProviderReadinessObservation + 265, // 91: openshell.v1.ProviderReadinessStatus.observed_time:type_name -> google.protobuf.Timestamp + 265, // 92: openshell.v1.ProviderReadinessStatus.evaluated_time:type_name -> google.protobuf.Timestamp + 74, // 93: openshell.v1.ProviderReadinessStatus.operation:type_name -> openshell.v1.ConfigUpdateOperation + 270, // 94: openshell.v1.GetSandboxProviderStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 77, // 95: openshell.v1.GetSandboxProviderStatusResponse.status:type_name -> openshell.v1.ProviderReadinessStatus + 76, // 96: openshell.v1.ReportProviderReadinessRequest.observation:type_name -> openshell.v1.ProviderReadinessObservation + 269, // 97: openshell.v1.ReportProviderReadinessResponse.report_interval:type_name -> google.protobuf.Duration + 269, // 98: openshell.v1.ReportProviderReadinessResponse.observation_ttl:type_name -> google.protobuf.Duration + 15, // 99: openshell.v1.DeleteSandboxResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 265, // 100: openshell.v1.CreateSshSessionResponse.expiration_time:type_name -> google.protobuf.Timestamp + 270, // 101: openshell.v1.ExposeServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 102: openshell.v1.GetServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 103: openshell.v1.ListServicesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 92, // 104: openshell.v1.ListServicesResponse.services:type_name -> openshell.v1.ServiceEndpointResponse + 270, // 105: openshell.v1.DeleteServiceRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 15, // 106: openshell.v1.DeleteServiceResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 266, // 107: openshell.v1.ServiceEndpoint.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 91, // 108: openshell.v1.ServiceEndpointResponse.endpoint:type_name -> openshell.v1.ServiceEndpoint + 15, // 109: openshell.v1.RevokeSshSessionResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 252, // 110: openshell.v1.ExecSandboxRequest.environment:type_name -> openshell.v1.ExecSandboxRequest.EnvironmentEntry + 269, // 111: openshell.v1.ExecSandboxRequest.execution_timeout:type_name -> google.protobuf.Duration + 96, // 112: openshell.v1.ExecSandboxEvent.stdout:type_name -> openshell.v1.ExecSandboxStdout + 97, // 113: openshell.v1.ExecSandboxEvent.stderr:type_name -> openshell.v1.ExecSandboxStderr + 98, // 114: openshell.v1.ExecSandboxEvent.exit:type_name -> openshell.v1.ExecSandboxExit + 191, // 115: openshell.v1.TcpForwardInit.ssh:type_name -> openshell.v1.SshRelayTarget + 192, // 116: openshell.v1.TcpForwardInit.tcp:type_name -> openshell.v1.TcpRelayTarget + 100, // 117: openshell.v1.TcpForwardFrame.init:type_name -> openshell.v1.TcpForwardInit + 95, // 118: openshell.v1.ExecSandboxInput.start:type_name -> openshell.v1.ExecSandboxRequest + 103, // 119: openshell.v1.ExecSandboxInput.resize:type_name -> openshell.v1.ExecSandboxWindowResize + 266, // 120: openshell.v1.SshSession.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 265, // 121: openshell.v1.SshSession.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 122: openshell.v1.WatchSandboxRequest.since_time:type_name -> google.protobuf.Timestamp + 33, // 123: openshell.v1.SandboxStreamEvent.sandbox:type_name -> openshell.v1.Sandbox + 107, // 124: openshell.v1.SandboxStreamEvent.log:type_name -> openshell.v1.SandboxLogLine + 47, // 125: openshell.v1.SandboxStreamEvent.event:type_name -> openshell.v1.PlatformEvent + 108, // 126: openshell.v1.SandboxStreamEvent.warning:type_name -> openshell.v1.SandboxStreamWarning + 202, // 127: openshell.v1.SandboxStreamEvent.draft_policy_update:type_name -> openshell.v1.DraftPolicyUpdate + 265, // 128: openshell.v1.SandboxLogLine.event_time:type_name -> google.protobuf.Timestamp + 253, // 129: openshell.v1.SandboxLogLine.fields:type_name -> openshell.v1.SandboxLogLine.FieldsEntry + 271, // 130: openshell.v1.CreateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider + 270, // 131: openshell.v1.CreateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 132: openshell.v1.GetProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 133: openshell.v1.ListProvidersRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 271, // 134: openshell.v1.UpdateProviderRequest.provider:type_name -> openshell.datamodel.v1.Provider + 254, // 135: openshell.v1.UpdateProviderRequest.credential_expiration_times:type_name -> openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry + 270, // 136: openshell.v1.UpdateProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 137: openshell.v1.DeleteProviderRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 271, // 138: openshell.v1.ProviderResponse.provider:type_name -> openshell.datamodel.v1.Provider + 75, // 139: openshell.v1.ProviderResponse.target_receipts:type_name -> openshell.v1.ProviderMutationReceipt + 271, // 140: openshell.v1.ListProvidersResponse.providers:type_name -> openshell.datamodel.v1.Provider + 137, // 141: openshell.v1.ProviderProfileImportItem.profile:type_name -> openshell.v1.ProviderProfile + 269, // 142: openshell.v1.ProviderCredentialTokenGrant.cache_ttl:type_name -> google.protobuf.Duration + 120, // 143: openshell.v1.ProviderCredentialTokenGrant.audience_overrides:type_name -> openshell.v1.ProviderCredentialTokenGrantAudienceOverride + 7, // 144: openshell.v1.ProviderCredentialTokenGrant.grant_type:type_name -> openshell.v1.ProviderCredentialTokenGrantType + 121, // 145: openshell.v1.ProviderCredentialTokenGrant.subject_token:type_name -> openshell.v1.ProviderCredentialTokenGrantSubjectToken + 126, // 146: openshell.v1.ProviderProfileCredential.refresh:type_name -> openshell.v1.ProviderCredentialRefresh + 122, // 147: openshell.v1.ProviderProfileCredential.token_grant:type_name -> openshell.v1.ProviderCredentialTokenGrant + 8, // 148: openshell.v1.ProviderCredentialRefresh.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy + 269, // 149: openshell.v1.ProviderCredentialRefresh.refresh_before:type_name -> google.protobuf.Duration + 269, // 150: openshell.v1.ProviderCredentialRefresh.max_lifetime:type_name -> google.protobuf.Duration + 124, // 151: openshell.v1.ProviderCredentialRefresh.material:type_name -> openshell.v1.ProviderCredentialRefreshMaterial + 125, // 152: openshell.v1.ProviderCredentialRefresh.additional_outputs:type_name -> openshell.v1.ProviderCredentialRefreshOutput + 8, // 153: openshell.v1.ProviderCredentialRefreshStatus.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy + 265, // 154: openshell.v1.ProviderCredentialRefreshStatus.expiration_time:type_name -> google.protobuf.Timestamp + 265, // 155: openshell.v1.ProviderCredentialRefreshStatus.next_refresh_time:type_name -> google.protobuf.Timestamp + 265, // 156: openshell.v1.ProviderCredentialRefreshStatus.last_refresh_time:type_name -> google.protobuf.Timestamp + 14, // 157: openshell.v1.ProviderCredentialRefreshStatus.recovery_action:type_name -> openshell.v1.ProviderCredentialRefreshRecoveryAction + 265, // 158: openshell.v1.ProviderCredentialRefreshStatus.last_error_time:type_name -> google.protobuf.Timestamp + 270, // 159: openshell.v1.GetProviderRefreshStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 127, // 160: openshell.v1.GetProviderRefreshStatusResponse.credentials:type_name -> openshell.v1.ProviderCredentialRefreshStatus + 8, // 161: openshell.v1.ConfigureProviderRefreshRequest.strategy:type_name -> openshell.v1.ProviderCredentialRefreshStrategy + 255, // 162: openshell.v1.ConfigureProviderRefreshRequest.material:type_name -> openshell.v1.ConfigureProviderRefreshRequest.MaterialEntry + 265, // 163: openshell.v1.ConfigureProviderRefreshRequest.expiration_time:type_name -> google.protobuf.Timestamp + 270, // 164: openshell.v1.ConfigureProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 127, // 165: openshell.v1.ConfigureProviderRefreshResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus + 270, // 166: openshell.v1.RotateProviderCredentialRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 127, // 167: openshell.v1.RotateProviderCredentialResponse.status:type_name -> openshell.v1.ProviderCredentialRefreshStatus + 270, // 168: openshell.v1.DeleteProviderRefreshRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 15, // 169: openshell.v1.DeleteProviderRefreshResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 9, // 170: openshell.v1.ProviderProfile.category:type_name -> openshell.v1.ProviderProfileCategory + 123, // 171: openshell.v1.ProviderProfile.credentials:type_name -> openshell.v1.ProviderProfileCredential + 273, // 172: openshell.v1.ProviderProfile.endpoints:type_name -> openshell.sandbox.v1.NetworkEndpoint + 274, // 173: openshell.v1.ProviderProfile.binaries:type_name -> openshell.sandbox.v1.NetworkBinary + 128, // 174: openshell.v1.ProviderProfile.discovery:type_name -> openshell.v1.ProviderProfileDiscovery + 256, // 175: openshell.v1.ProviderProfile.annotations:type_name -> openshell.v1.ProviderProfile.AnnotationsEntry + 137, // 176: openshell.v1.ProviderProfileResponse.profile:type_name -> openshell.v1.ProviderProfile + 137, // 177: openshell.v1.ListProviderProfilesResponse.profiles:type_name -> openshell.v1.ProviderProfile + 118, // 178: openshell.v1.ImportProviderProfilesRequest.profiles:type_name -> openshell.v1.ProviderProfileImportItem + 119, // 179: openshell.v1.ImportProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic + 137, // 180: openshell.v1.ImportProviderProfilesResponse.profiles:type_name -> openshell.v1.ProviderProfile + 118, // 181: openshell.v1.UpdateProviderProfilesRequest.profile:type_name -> openshell.v1.ProviderProfileImportItem + 119, // 182: openshell.v1.UpdateProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic + 137, // 183: openshell.v1.UpdateProviderProfilesResponse.profile:type_name -> openshell.v1.ProviderProfile + 118, // 184: openshell.v1.LintProviderProfilesRequest.profiles:type_name -> openshell.v1.ProviderProfileImportItem + 119, // 185: openshell.v1.LintProviderProfilesResponse.diagnostics:type_name -> openshell.v1.ProviderProfileDiagnostic + 15, // 186: openshell.v1.DeleteProviderResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 15, // 187: openshell.v1.DeleteProviderProfileResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 150, // 188: openshell.v1.StaticCredentialBinding.endpoints:type_name -> openshell.v1.StaticCredentialEndpointBinding + 257, // 189: openshell.v1.GetSandboxProviderEnvironmentResponse.environment:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.EnvironmentEntry + 258, // 190: openshell.v1.GetSandboxProviderEnvironmentResponse.credential_expiration_times:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry + 259, // 191: openshell.v1.GetSandboxProviderEnvironmentResponse.dynamic_credentials:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry + 260, // 192: openshell.v1.GetSandboxProviderEnvironmentResponse.static_credential_bindings:type_name -> openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry + 3, // 193: openshell.v1.GetSandboxProviderEnvironmentResponse.readiness_reason:type_name -> openshell.v1.ProviderReadinessReason + 269, // 194: openshell.v1.ExchangeProviderSubjectTokenResponse.expires_after:type_name -> google.protobuf.Duration + 267, // 195: openshell.v1.UpdateConfigRequest.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 275, // 196: openshell.v1.UpdateConfigRequest.setting_value:type_name -> openshell.sandbox.v1.SettingValue + 156, // 197: openshell.v1.UpdateConfigRequest.merge_operations:type_name -> openshell.v1.PolicyMergeOperation + 261, // 198: openshell.v1.UpdateConfigRequest.annotations:type_name -> openshell.v1.UpdateConfigRequest.AnnotationsEntry + 270, // 199: openshell.v1.UpdateConfigRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 157, // 200: openshell.v1.PolicyMergeOperation.add_rule:type_name -> openshell.v1.AddNetworkRule + 158, // 201: openshell.v1.PolicyMergeOperation.remove_endpoint:type_name -> openshell.v1.RemoveNetworkEndpoint + 159, // 202: openshell.v1.PolicyMergeOperation.remove_rule:type_name -> openshell.v1.RemoveNetworkRule + 161, // 203: openshell.v1.PolicyMergeOperation.add_deny_rules:type_name -> openshell.v1.AddDenyRules + 162, // 204: openshell.v1.PolicyMergeOperation.add_allow_rules:type_name -> openshell.v1.AddAllowRules + 163, // 205: openshell.v1.PolicyMergeOperation.remove_binary:type_name -> openshell.v1.RemoveNetworkBinary + 276, // 206: openshell.v1.AddNetworkRule.rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 274, // 207: openshell.v1.L7RuleTarget.binaries:type_name -> openshell.sandbox.v1.NetworkBinary + 277, // 208: openshell.v1.AddDenyRules.deny_rules:type_name -> openshell.sandbox.v1.L7DenyRule + 160, // 209: openshell.v1.AddDenyRules.target:type_name -> openshell.v1.L7RuleTarget + 278, // 210: openshell.v1.AddAllowRules.rules:type_name -> openshell.sandbox.v1.L7Rule + 160, // 211: openshell.v1.AddAllowRules.target:type_name -> openshell.v1.L7RuleTarget + 262, // 212: openshell.v1.UpdateConfigResponse.annotations:type_name -> openshell.v1.UpdateConfigResponse.AnnotationsEntry + 270, // 213: openshell.v1.GetSandboxPolicyStatusRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 174, // 214: openshell.v1.GetSandboxPolicyStatusResponse.revision:type_name -> openshell.v1.SandboxPolicyRevision + 270, // 215: openshell.v1.ListSandboxPoliciesRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 174, // 216: openshell.v1.ListSandboxPoliciesResponse.revisions:type_name -> openshell.v1.SandboxPolicyRevision + 11, // 217: openshell.v1.ReportPolicyStatusRequest.status:type_name -> openshell.v1.PolicyStatus + 10, // 218: openshell.v1.SandboxConfigurationAdmission.state:type_name -> openshell.v1.ConfigurationAdmissionState + 171, // 219: openshell.v1.ReportSandboxConfigurationRequest.admission:type_name -> openshell.v1.SandboxConfigurationAdmission + 11, // 220: openshell.v1.SandboxPolicyRevision.status:type_name -> openshell.v1.PolicyStatus + 265, // 221: openshell.v1.SandboxPolicyRevision.created_time:type_name -> google.protobuf.Timestamp + 265, // 222: openshell.v1.SandboxPolicyRevision.loaded_time:type_name -> google.protobuf.Timestamp + 267, // 223: openshell.v1.SandboxPolicyRevision.policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 263, // 224: openshell.v1.SandboxPolicyRevision.provenance:type_name -> openshell.v1.SandboxPolicyRevision.ProvenanceEntry + 265, // 225: openshell.v1.GetSandboxLogsRequest.since_time:type_name -> google.protobuf.Timestamp + 270, // 226: openshell.v1.GetSandboxLogsRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 107, // 227: openshell.v1.PushSandboxLogsRequest.logs:type_name -> openshell.v1.SandboxLogLine + 107, // 228: openshell.v1.GetSandboxLogsResponse.logs:type_name -> openshell.v1.SandboxLogLine + 181, // 229: openshell.v1.SupervisorMessage.hello:type_name -> openshell.v1.SupervisorHello + 184, // 230: openshell.v1.SupervisorMessage.heartbeat:type_name -> openshell.v1.SupervisorHeartbeat + 195, // 231: openshell.v1.SupervisorMessage.relay_open_result:type_name -> openshell.v1.RelayOpenResult + 196, // 232: openshell.v1.SupervisorMessage.relay_close:type_name -> openshell.v1.RelayClose + 182, // 233: openshell.v1.GatewayMessage.session_accepted:type_name -> openshell.v1.SessionAccepted + 183, // 234: openshell.v1.GatewayMessage.session_rejected:type_name -> openshell.v1.SessionRejected + 185, // 235: openshell.v1.GatewayMessage.heartbeat:type_name -> openshell.v1.GatewayHeartbeat + 190, // 236: openshell.v1.GatewayMessage.relay_open:type_name -> openshell.v1.RelayOpen + 196, // 237: openshell.v1.GatewayMessage.relay_close:type_name -> openshell.v1.RelayClose + 269, // 238: openshell.v1.SessionAccepted.heartbeat_interval:type_name -> google.protobuf.Duration + 191, // 239: openshell.v1.RelayOpen.ssh:type_name -> openshell.v1.SshRelayTarget + 192, // 240: openshell.v1.RelayOpen.tcp:type_name -> openshell.v1.TcpRelayTarget + 193, // 241: openshell.v1.RelayFrame.init:type_name -> openshell.v1.RelayInit + 265, // 242: openshell.v1.DenialSummary.first_seen_time:type_name -> google.protobuf.Timestamp + 265, // 243: openshell.v1.DenialSummary.last_seen_time:type_name -> google.protobuf.Timestamp + 197, // 244: openshell.v1.DenialSummary.l7_request_samples:type_name -> openshell.v1.L7RequestSample + 199, // 245: openshell.v1.NetworkActivitySummary.denials_by_group:type_name -> openshell.v1.DenialGroupCount + 276, // 246: openshell.v1.PolicyChunk.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 265, // 247: openshell.v1.PolicyChunk.created_time:type_name -> google.protobuf.Timestamp + 265, // 248: openshell.v1.PolicyChunk.decided_time:type_name -> google.protobuf.Timestamp + 265, // 249: openshell.v1.PolicyChunk.first_seen_time:type_name -> google.protobuf.Timestamp + 265, // 250: openshell.v1.PolicyChunk.last_seen_time:type_name -> google.protobuf.Timestamp + 267, // 251: openshell.v1.PolicyChunk.current_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 267, // 252: openshell.v1.PolicyChunk.candidate_effective_policy:type_name -> openshell.sandbox.v1.SandboxPolicy + 198, // 253: openshell.v1.SubmitPolicyAnalysisRequest.summaries:type_name -> openshell.v1.DenialSummary + 201, // 254: openshell.v1.SubmitPolicyAnalysisRequest.proposed_chunks:type_name -> openshell.v1.PolicyChunk + 200, // 255: openshell.v1.SubmitPolicyAnalysisRequest.network_activity_summaries:type_name -> openshell.v1.NetworkActivitySummary + 270, // 256: openshell.v1.GetDraftPolicyRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 201, // 257: openshell.v1.GetDraftPolicyResponse.chunks:type_name -> openshell.v1.PolicyChunk + 265, // 258: openshell.v1.GetDraftPolicyResponse.last_analyzed_time:type_name -> google.protobuf.Timestamp + 270, // 259: openshell.v1.ApproveDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 260: openshell.v1.RejectDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 211, // 261: openshell.v1.ApproveAllDraftChunksRequest.approvals:type_name -> openshell.v1.DraftChunkApproval + 270, // 262: openshell.v1.ApproveAllDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 276, // 263: openshell.v1.EditDraftChunkRequest.proposed_rule:type_name -> openshell.sandbox.v1.NetworkPolicyRule + 270, // 264: openshell.v1.EditDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 265: openshell.v1.UndoDraftChunkRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 266: openshell.v1.ClearDraftChunksRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 270, // 267: openshell.v1.GetDraftHistoryRequest.workspace_scope:type_name -> openshell.datamodel.v1.WorkspaceSelector + 265, // 268: openshell.v1.DraftHistoryEntry.event_time:type_name -> google.protobuf.Timestamp + 221, // 269: openshell.v1.GetDraftHistoryResponse.entries:type_name -> openshell.v1.DraftHistoryEntry + 264, // 270: openshell.v1.CreateWorkspaceRequest.labels:type_name -> openshell.v1.CreateWorkspaceRequest.LabelsEntry + 279, // 271: openshell.v1.CreateWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace + 279, // 272: openshell.v1.GetWorkspaceResponse.workspace:type_name -> openshell.datamodel.v1.Workspace + 279, // 273: openshell.v1.ListWorkspacesResponse.workspaces:type_name -> openshell.datamodel.v1.Workspace + 15, // 274: openshell.v1.DeleteWorkspaceResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 266, // 275: openshell.v1.WorkspaceMember.metadata:type_name -> openshell.datamodel.v1.ObjectMeta + 13, // 276: openshell.v1.WorkspaceMember.role:type_name -> openshell.v1.WorkspaceRole + 13, // 277: openshell.v1.AddWorkspaceMemberRequest.role:type_name -> openshell.v1.WorkspaceRole + 231, // 278: openshell.v1.AddWorkspaceMemberResponse.member:type_name -> openshell.v1.WorkspaceMember + 15, // 279: openshell.v1.RemoveWorkspaceMemberResponse.outcome:type_name -> openshell.v1.DeletionOutcome + 231, // 280: openshell.v1.ListWorkspaceMembersResponse.members:type_name -> openshell.v1.WorkspaceMember + 265, // 281: openshell.v1.ExtensionServiceCredential.expiration_time:type_name -> google.protobuf.Timestamp + 16, // 282: openshell.v1.EndpointObservation.result:type_name -> openshell.v1.EndpointResult + 239, // 283: openshell.v1.ReportEndpointStatusRequest.observations:type_name -> openshell.v1.EndpointObservation + 16, // 284: openshell.v1.EndpointStatus.last_result:type_name -> openshell.v1.EndpointResult + 265, // 285: openshell.v1.EndpointStatus.last_reported_time:type_name -> google.protobuf.Timestamp + 265, // 286: openshell.v1.SandboxProvisioning.configuration_change_time:type_name -> google.protobuf.Timestamp + 265, // 287: openshell.v1.SandboxProvisioning.first_rejection_time:type_name -> google.protobuf.Timestamp + 265, // 288: openshell.v1.SandboxProvisioning.deadline:type_name -> google.protobuf.Timestamp + 265, // 289: openshell.v1.SandboxProvisioning.timeout_time:type_name -> google.protobuf.Timestamp + 265, // 290: openshell.v1.SandboxProvisioning.cleanup_completed_time:type_name -> google.protobuf.Timestamp + 265, // 291: openshell.v1.SandboxProvisioning.cleanup_retry_time:type_name -> google.protobuf.Timestamp + 265, // 292: openshell.v1.SandboxProvisioning.attachment_change_time:type_name -> google.protobuf.Timestamp + 265, // 293: openshell.v1.UpdateProviderRequest.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp + 265, // 294: openshell.v1.GetSandboxProviderEnvironmentResponse.CredentialExpirationTimesEntry.value:type_name -> google.protobuf.Timestamp + 123, // 295: openshell.v1.GetSandboxProviderEnvironmentResponse.DynamicCredentialsEntry.value:type_name -> openshell.v1.ProviderProfileCredential + 151, // 296: openshell.v1.GetSandboxProviderEnvironmentResponse.StaticCredentialBindingsEntry.value:type_name -> openshell.v1.StaticCredentialBinding + 21, // 297: openshell.v1.OpenShell.Health:input_type -> openshell.v1.HealthRequest + 23, // 298: openshell.v1.OpenShell.GetCurrentUser:input_type -> openshell.v1.GetCurrentUserRequest + 25, // 299: openshell.v1.OpenShell.GetGatewayInfo:input_type -> openshell.v1.GetGatewayInfoRequest + 48, // 300: openshell.v1.OpenShell.CreateSandbox:input_type -> openshell.v1.CreateSandboxRequest + 56, // 301: openshell.v1.OpenShell.BeginRootfsTarStaging:input_type -> openshell.v1.BeginRootfsTarStagingRequest + 58, // 302: openshell.v1.OpenShell.GetSandbox:input_type -> openshell.v1.GetSandboxRequest + 59, // 303: openshell.v1.OpenShell.ListSandboxes:input_type -> openshell.v1.ListSandboxesRequest + 49, // 304: openshell.v1.OpenShell.CreateSandboxTemplate:input_type -> openshell.v1.CreateSandboxTemplateRequest + 50, // 305: openshell.v1.OpenShell.GetSandboxTemplate:input_type -> openshell.v1.GetSandboxTemplateRequest + 51, // 306: openshell.v1.OpenShell.ListSandboxTemplates:input_type -> openshell.v1.ListSandboxTemplatesRequest + 52, // 307: openshell.v1.OpenShell.DeleteSandboxTemplate:input_type -> openshell.v1.DeleteSandboxTemplateRequest + 60, // 308: openshell.v1.OpenShell.ListSandboxProviders:input_type -> openshell.v1.ListSandboxProvidersRequest + 61, // 309: openshell.v1.OpenShell.AttachSandboxProvider:input_type -> openshell.v1.AttachSandboxProviderRequest + 62, // 310: openshell.v1.OpenShell.DetachSandboxProvider:input_type -> openshell.v1.DetachSandboxProviderRequest + 78, // 311: openshell.v1.OpenShell.GetSandboxProviderStatus:input_type -> openshell.v1.GetSandboxProviderStatusRequest + 63, // 312: openshell.v1.OpenShell.DeleteSandbox:input_type -> openshell.v1.DeleteSandboxRequest + 64, // 313: openshell.v1.OpenShell.StopSandbox:input_type -> openshell.v1.StopSandboxRequest + 65, // 314: openshell.v1.OpenShell.StartSandbox:input_type -> openshell.v1.StartSandboxRequest + 83, // 315: openshell.v1.OpenShell.CreateSshSession:input_type -> openshell.v1.CreateSshSessionRequest + 85, // 316: openshell.v1.OpenShell.ExposeService:input_type -> openshell.v1.ExposeServiceRequest + 86, // 317: openshell.v1.OpenShell.GetService:input_type -> openshell.v1.GetServiceRequest + 87, // 318: openshell.v1.OpenShell.ListServices:input_type -> openshell.v1.ListServicesRequest + 89, // 319: openshell.v1.OpenShell.DeleteService:input_type -> openshell.v1.DeleteServiceRequest + 93, // 320: openshell.v1.OpenShell.RevokeSshSession:input_type -> openshell.v1.RevokeSshSessionRequest + 95, // 321: openshell.v1.OpenShell.ExecSandbox:input_type -> openshell.v1.ExecSandboxRequest + 101, // 322: openshell.v1.OpenShell.ForwardTcp:input_type -> openshell.v1.TcpForwardFrame + 102, // 323: openshell.v1.OpenShell.ExecSandboxInteractive:input_type -> openshell.v1.ExecSandboxInput + 109, // 324: openshell.v1.OpenShell.CreateProvider:input_type -> openshell.v1.CreateProviderRequest + 110, // 325: openshell.v1.OpenShell.GetProvider:input_type -> openshell.v1.GetProviderRequest + 111, // 326: openshell.v1.OpenShell.ListProviders:input_type -> openshell.v1.ListProvidersRequest + 116, // 327: openshell.v1.OpenShell.ListProviderProfiles:input_type -> openshell.v1.ListProviderProfilesRequest + 117, // 328: openshell.v1.OpenShell.GetProviderProfile:input_type -> openshell.v1.GetProviderProfileRequest + 140, // 329: openshell.v1.OpenShell.ImportProviderProfiles:input_type -> openshell.v1.ImportProviderProfilesRequest + 142, // 330: openshell.v1.OpenShell.UpdateProviderProfiles:input_type -> openshell.v1.UpdateProviderProfilesRequest + 144, // 331: openshell.v1.OpenShell.LintProviderProfiles:input_type -> openshell.v1.LintProviderProfilesRequest + 112, // 332: openshell.v1.OpenShell.UpdateProvider:input_type -> openshell.v1.UpdateProviderRequest + 129, // 333: openshell.v1.OpenShell.GetProviderRefreshStatus:input_type -> openshell.v1.GetProviderRefreshStatusRequest + 131, // 334: openshell.v1.OpenShell.ConfigureProviderRefresh:input_type -> openshell.v1.ConfigureProviderRefreshRequest + 133, // 335: openshell.v1.OpenShell.RotateProviderCredential:input_type -> openshell.v1.RotateProviderCredentialRequest + 135, // 336: openshell.v1.OpenShell.DeleteProviderRefresh:input_type -> openshell.v1.DeleteProviderRefreshRequest + 113, // 337: openshell.v1.OpenShell.DeleteProvider:input_type -> openshell.v1.DeleteProviderRequest + 147, // 338: openshell.v1.OpenShell.DeleteProviderProfile:input_type -> openshell.v1.DeleteProviderProfileRequest + 280, // 339: openshell.v1.OpenShell.GetSandboxConfig:input_type -> openshell.sandbox.v1.GetSandboxConfigRequest + 281, // 340: openshell.v1.OpenShell.GetGatewayConfig:input_type -> openshell.sandbox.v1.GetGatewayConfigRequest + 155, // 341: openshell.v1.OpenShell.UpdateConfig:input_type -> openshell.v1.UpdateConfigRequest + 165, // 342: openshell.v1.OpenShell.GetSandboxPolicyStatus:input_type -> openshell.v1.GetSandboxPolicyStatusRequest + 167, // 343: openshell.v1.OpenShell.ListSandboxPolicies:input_type -> openshell.v1.ListSandboxPoliciesRequest + 169, // 344: openshell.v1.OpenShell.ReportPolicyStatus:input_type -> openshell.v1.ReportPolicyStatusRequest + 240, // 345: openshell.v1.OpenShell.ReportEndpointStatus:input_type -> openshell.v1.ReportEndpointStatusRequest + 80, // 346: openshell.v1.OpenShell.ReportProviderReadiness:input_type -> openshell.v1.ReportProviderReadinessRequest + 172, // 347: openshell.v1.OpenShell.ReportSandboxConfiguration:input_type -> openshell.v1.ReportSandboxConfigurationRequest + 149, // 348: openshell.v1.OpenShell.GetSandboxProviderEnvironment:input_type -> openshell.v1.GetSandboxProviderEnvironmentRequest + 153, // 349: openshell.v1.OpenShell.ExchangeProviderSubjectToken:input_type -> openshell.v1.ExchangeProviderSubjectTokenRequest + 175, // 350: openshell.v1.OpenShell.GetSandboxLogs:input_type -> openshell.v1.GetSandboxLogsRequest + 176, // 351: openshell.v1.OpenShell.PushSandboxLogs:input_type -> openshell.v1.PushSandboxLogsRequest + 179, // 352: openshell.v1.OpenShell.ConnectSupervisor:input_type -> openshell.v1.SupervisorMessage + 186, // 353: openshell.v1.OpenShell.ReportMainProcessExit:input_type -> openshell.v1.ReportMainProcessExitRequest + 188, // 354: openshell.v1.OpenShell.FinalizeMainProcessExit:input_type -> openshell.v1.FinalizeMainProcessExitRequest + 194, // 355: openshell.v1.OpenShell.RelayStream:input_type -> openshell.v1.RelayFrame + 105, // 356: openshell.v1.OpenShell.WatchSandbox:input_type -> openshell.v1.WatchSandboxRequest + 203, // 357: openshell.v1.OpenShell.SubmitPolicyAnalysis:input_type -> openshell.v1.SubmitPolicyAnalysisRequest + 205, // 358: openshell.v1.OpenShell.GetDraftPolicy:input_type -> openshell.v1.GetDraftPolicyRequest + 207, // 359: openshell.v1.OpenShell.ApproveDraftChunk:input_type -> openshell.v1.ApproveDraftChunkRequest + 209, // 360: openshell.v1.OpenShell.RejectDraftChunk:input_type -> openshell.v1.RejectDraftChunkRequest + 212, // 361: openshell.v1.OpenShell.ApproveAllDraftChunks:input_type -> openshell.v1.ApproveAllDraftChunksRequest + 214, // 362: openshell.v1.OpenShell.EditDraftChunk:input_type -> openshell.v1.EditDraftChunkRequest + 216, // 363: openshell.v1.OpenShell.UndoDraftChunk:input_type -> openshell.v1.UndoDraftChunkRequest + 218, // 364: openshell.v1.OpenShell.ClearDraftChunks:input_type -> openshell.v1.ClearDraftChunksRequest + 220, // 365: openshell.v1.OpenShell.GetDraftHistory:input_type -> openshell.v1.GetDraftHistoryRequest + 17, // 366: openshell.v1.OpenShell.IssueSandboxToken:input_type -> openshell.v1.IssueSandboxTokenRequest + 19, // 367: openshell.v1.OpenShell.RefreshSandboxToken:input_type -> openshell.v1.RefreshSandboxTokenRequest + 223, // 368: openshell.v1.OpenShell.CreateWorkspace:input_type -> openshell.v1.CreateWorkspaceRequest + 225, // 369: openshell.v1.OpenShell.GetWorkspace:input_type -> openshell.v1.GetWorkspaceRequest + 227, // 370: openshell.v1.OpenShell.ListWorkspaces:input_type -> openshell.v1.ListWorkspacesRequest + 229, // 371: openshell.v1.OpenShell.DeleteWorkspace:input_type -> openshell.v1.DeleteWorkspaceRequest + 232, // 372: openshell.v1.OpenShell.AddWorkspaceMember:input_type -> openshell.v1.AddWorkspaceMemberRequest + 234, // 373: openshell.v1.OpenShell.RemoveWorkspaceMember:input_type -> openshell.v1.RemoveWorkspaceMemberRequest + 236, // 374: openshell.v1.OpenShell.ListWorkspaceMembers:input_type -> openshell.v1.ListWorkspaceMembersRequest + 22, // 375: openshell.v1.OpenShell.Health:output_type -> openshell.v1.HealthResponse + 24, // 376: openshell.v1.OpenShell.GetCurrentUser:output_type -> openshell.v1.GetCurrentUserResponse + 26, // 377: openshell.v1.OpenShell.GetGatewayInfo:output_type -> openshell.v1.GetGatewayInfoResponse + 66, // 378: openshell.v1.OpenShell.CreateSandbox:output_type -> openshell.v1.SandboxResponse + 57, // 379: openshell.v1.OpenShell.BeginRootfsTarStaging:output_type -> openshell.v1.BeginRootfsTarStagingResponse + 66, // 380: openshell.v1.OpenShell.GetSandbox:output_type -> openshell.v1.SandboxResponse + 67, // 381: openshell.v1.OpenShell.ListSandboxes:output_type -> openshell.v1.ListSandboxesResponse + 53, // 382: openshell.v1.OpenShell.CreateSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse + 53, // 383: openshell.v1.OpenShell.GetSandboxTemplate:output_type -> openshell.v1.SandboxTemplateResponse + 54, // 384: openshell.v1.OpenShell.ListSandboxTemplates:output_type -> openshell.v1.ListSandboxTemplatesResponse + 55, // 385: openshell.v1.OpenShell.DeleteSandboxTemplate:output_type -> openshell.v1.DeleteSandboxTemplateResponse + 68, // 386: openshell.v1.OpenShell.ListSandboxProviders:output_type -> openshell.v1.ListSandboxProvidersResponse + 69, // 387: openshell.v1.OpenShell.AttachSandboxProvider:output_type -> openshell.v1.AttachSandboxProviderResponse + 70, // 388: openshell.v1.OpenShell.DetachSandboxProvider:output_type -> openshell.v1.DetachSandboxProviderResponse + 79, // 389: openshell.v1.OpenShell.GetSandboxProviderStatus:output_type -> openshell.v1.GetSandboxProviderStatusResponse + 82, // 390: openshell.v1.OpenShell.DeleteSandbox:output_type -> openshell.v1.DeleteSandboxResponse + 66, // 391: openshell.v1.OpenShell.StopSandbox:output_type -> openshell.v1.SandboxResponse + 66, // 392: openshell.v1.OpenShell.StartSandbox:output_type -> openshell.v1.SandboxResponse + 84, // 393: openshell.v1.OpenShell.CreateSshSession:output_type -> openshell.v1.CreateSshSessionResponse + 92, // 394: openshell.v1.OpenShell.ExposeService:output_type -> openshell.v1.ServiceEndpointResponse + 92, // 395: openshell.v1.OpenShell.GetService:output_type -> openshell.v1.ServiceEndpointResponse + 88, // 396: openshell.v1.OpenShell.ListServices:output_type -> openshell.v1.ListServicesResponse + 90, // 397: openshell.v1.OpenShell.DeleteService:output_type -> openshell.v1.DeleteServiceResponse + 94, // 398: openshell.v1.OpenShell.RevokeSshSession:output_type -> openshell.v1.RevokeSshSessionResponse + 99, // 399: openshell.v1.OpenShell.ExecSandbox:output_type -> openshell.v1.ExecSandboxEvent + 101, // 400: openshell.v1.OpenShell.ForwardTcp:output_type -> openshell.v1.TcpForwardFrame + 99, // 401: openshell.v1.OpenShell.ExecSandboxInteractive:output_type -> openshell.v1.ExecSandboxEvent + 114, // 402: openshell.v1.OpenShell.CreateProvider:output_type -> openshell.v1.ProviderResponse + 114, // 403: openshell.v1.OpenShell.GetProvider:output_type -> openshell.v1.ProviderResponse + 115, // 404: openshell.v1.OpenShell.ListProviders:output_type -> openshell.v1.ListProvidersResponse + 139, // 405: openshell.v1.OpenShell.ListProviderProfiles:output_type -> openshell.v1.ListProviderProfilesResponse + 138, // 406: openshell.v1.OpenShell.GetProviderProfile:output_type -> openshell.v1.ProviderProfileResponse + 141, // 407: openshell.v1.OpenShell.ImportProviderProfiles:output_type -> openshell.v1.ImportProviderProfilesResponse + 143, // 408: openshell.v1.OpenShell.UpdateProviderProfiles:output_type -> openshell.v1.UpdateProviderProfilesResponse + 145, // 409: openshell.v1.OpenShell.LintProviderProfiles:output_type -> openshell.v1.LintProviderProfilesResponse + 114, // 410: openshell.v1.OpenShell.UpdateProvider:output_type -> openshell.v1.ProviderResponse + 130, // 411: openshell.v1.OpenShell.GetProviderRefreshStatus:output_type -> openshell.v1.GetProviderRefreshStatusResponse + 132, // 412: openshell.v1.OpenShell.ConfigureProviderRefresh:output_type -> openshell.v1.ConfigureProviderRefreshResponse + 134, // 413: openshell.v1.OpenShell.RotateProviderCredential:output_type -> openshell.v1.RotateProviderCredentialResponse + 136, // 414: openshell.v1.OpenShell.DeleteProviderRefresh:output_type -> openshell.v1.DeleteProviderRefreshResponse + 146, // 415: openshell.v1.OpenShell.DeleteProvider:output_type -> openshell.v1.DeleteProviderResponse + 148, // 416: openshell.v1.OpenShell.DeleteProviderProfile:output_type -> openshell.v1.DeleteProviderProfileResponse + 282, // 417: openshell.v1.OpenShell.GetSandboxConfig:output_type -> openshell.sandbox.v1.GetSandboxConfigResponse + 283, // 418: openshell.v1.OpenShell.GetGatewayConfig:output_type -> openshell.sandbox.v1.GetGatewayConfigResponse + 164, // 419: openshell.v1.OpenShell.UpdateConfig:output_type -> openshell.v1.UpdateConfigResponse + 166, // 420: openshell.v1.OpenShell.GetSandboxPolicyStatus:output_type -> openshell.v1.GetSandboxPolicyStatusResponse + 168, // 421: openshell.v1.OpenShell.ListSandboxPolicies:output_type -> openshell.v1.ListSandboxPoliciesResponse + 170, // 422: openshell.v1.OpenShell.ReportPolicyStatus:output_type -> openshell.v1.ReportPolicyStatusResponse + 241, // 423: openshell.v1.OpenShell.ReportEndpointStatus:output_type -> openshell.v1.ReportEndpointStatusResponse + 81, // 424: openshell.v1.OpenShell.ReportProviderReadiness:output_type -> openshell.v1.ReportProviderReadinessResponse + 173, // 425: openshell.v1.OpenShell.ReportSandboxConfiguration:output_type -> openshell.v1.ReportSandboxConfigurationResponse + 152, // 426: openshell.v1.OpenShell.GetSandboxProviderEnvironment:output_type -> openshell.v1.GetSandboxProviderEnvironmentResponse + 154, // 427: openshell.v1.OpenShell.ExchangeProviderSubjectToken:output_type -> openshell.v1.ExchangeProviderSubjectTokenResponse + 178, // 428: openshell.v1.OpenShell.GetSandboxLogs:output_type -> openshell.v1.GetSandboxLogsResponse + 177, // 429: openshell.v1.OpenShell.PushSandboxLogs:output_type -> openshell.v1.PushSandboxLogsResponse + 180, // 430: openshell.v1.OpenShell.ConnectSupervisor:output_type -> openshell.v1.GatewayMessage + 187, // 431: openshell.v1.OpenShell.ReportMainProcessExit:output_type -> openshell.v1.ReportMainProcessExitResponse + 189, // 432: openshell.v1.OpenShell.FinalizeMainProcessExit:output_type -> openshell.v1.FinalizeMainProcessExitResponse + 194, // 433: openshell.v1.OpenShell.RelayStream:output_type -> openshell.v1.RelayFrame + 106, // 434: openshell.v1.OpenShell.WatchSandbox:output_type -> openshell.v1.SandboxStreamEvent + 204, // 435: openshell.v1.OpenShell.SubmitPolicyAnalysis:output_type -> openshell.v1.SubmitPolicyAnalysisResponse + 206, // 436: openshell.v1.OpenShell.GetDraftPolicy:output_type -> openshell.v1.GetDraftPolicyResponse + 208, // 437: openshell.v1.OpenShell.ApproveDraftChunk:output_type -> openshell.v1.ApproveDraftChunkResponse + 210, // 438: openshell.v1.OpenShell.RejectDraftChunk:output_type -> openshell.v1.RejectDraftChunkResponse + 213, // 439: openshell.v1.OpenShell.ApproveAllDraftChunks:output_type -> openshell.v1.ApproveAllDraftChunksResponse + 215, // 440: openshell.v1.OpenShell.EditDraftChunk:output_type -> openshell.v1.EditDraftChunkResponse + 217, // 441: openshell.v1.OpenShell.UndoDraftChunk:output_type -> openshell.v1.UndoDraftChunkResponse + 219, // 442: openshell.v1.OpenShell.ClearDraftChunks:output_type -> openshell.v1.ClearDraftChunksResponse + 222, // 443: openshell.v1.OpenShell.GetDraftHistory:output_type -> openshell.v1.GetDraftHistoryResponse + 18, // 444: openshell.v1.OpenShell.IssueSandboxToken:output_type -> openshell.v1.IssueSandboxTokenResponse + 20, // 445: openshell.v1.OpenShell.RefreshSandboxToken:output_type -> openshell.v1.RefreshSandboxTokenResponse + 224, // 446: openshell.v1.OpenShell.CreateWorkspace:output_type -> openshell.v1.CreateWorkspaceResponse + 226, // 447: openshell.v1.OpenShell.GetWorkspace:output_type -> openshell.v1.GetWorkspaceResponse + 228, // 448: openshell.v1.OpenShell.ListWorkspaces:output_type -> openshell.v1.ListWorkspacesResponse + 230, // 449: openshell.v1.OpenShell.DeleteWorkspace:output_type -> openshell.v1.DeleteWorkspaceResponse + 233, // 450: openshell.v1.OpenShell.AddWorkspaceMember:output_type -> openshell.v1.AddWorkspaceMemberResponse + 235, // 451: openshell.v1.OpenShell.RemoveWorkspaceMember:output_type -> openshell.v1.RemoveWorkspaceMemberResponse + 237, // 452: openshell.v1.OpenShell.ListWorkspaceMembers:output_type -> openshell.v1.ListWorkspaceMembersResponse + 375, // [375:453] is the sub-list for method output_type + 297, // [297:375] is the sub-list for method input_type + 297, // [297:297] is the sub-list for extension type_name + 297, // [297:297] is the sub-list for extension extendee + 0, // [0:297] is the sub-list for field type_name } func init() { file_openshell_proto_init() } @@ -18997,24 +19454,24 @@ func file_openshell_proto_init() { (*PolicyMergeOperation_RemoveBinary)(nil), } file_openshell_proto_msgTypes[143].OneofWrappers = []any{} - file_openshell_proto_msgTypes[159].OneofWrappers = []any{ + file_openshell_proto_msgTypes[162].OneofWrappers = []any{ (*SupervisorMessage_Hello)(nil), (*SupervisorMessage_Heartbeat)(nil), (*SupervisorMessage_RelayOpenResult)(nil), (*SupervisorMessage_RelayClose)(nil), } - file_openshell_proto_msgTypes[160].OneofWrappers = []any{ + file_openshell_proto_msgTypes[163].OneofWrappers = []any{ (*GatewayMessage_SessionAccepted)(nil), (*GatewayMessage_SessionRejected)(nil), (*GatewayMessage_Heartbeat)(nil), (*GatewayMessage_RelayOpen)(nil), (*GatewayMessage_RelayClose)(nil), } - file_openshell_proto_msgTypes[170].OneofWrappers = []any{ + file_openshell_proto_msgTypes[173].OneofWrappers = []any{ (*RelayOpen_Ssh)(nil), (*RelayOpen_Tcp)(nil), } - file_openshell_proto_msgTypes[174].OneofWrappers = []any{ + file_openshell_proto_msgTypes[177].OneofWrappers = []any{ (*RelayFrame_Init)(nil), (*RelayFrame_Data)(nil), } @@ -19023,8 +19480,8 @@ func file_openshell_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_openshell_proto_rawDesc), len(file_openshell_proto_rawDesc)), - NumEnums: 16, - NumMessages: 244, + NumEnums: 17, + NumMessages: 248, NumExtensions: 0, NumServices: 1, }, diff --git a/sdk/go/proto/openshellv1/openshell_grpc.pb.go b/sdk/go/proto/openshellv1/openshell_grpc.pb.go index fab991628c..0609450c89 100644 --- a/sdk/go/proto/openshellv1/openshell_grpc.pb.go +++ b/sdk/go/proto/openshellv1/openshell_grpc.pb.go @@ -73,6 +73,7 @@ const ( OpenShell_ReportPolicyStatus_FullMethodName = "/openshell.v1.OpenShell/ReportPolicyStatus" OpenShell_ReportEndpointStatus_FullMethodName = "/openshell.v1.OpenShell/ReportEndpointStatus" OpenShell_ReportProviderReadiness_FullMethodName = "/openshell.v1.OpenShell/ReportProviderReadiness" + OpenShell_ReportSandboxConfiguration_FullMethodName = "/openshell.v1.OpenShell/ReportSandboxConfiguration" OpenShell_GetSandboxProviderEnvironment_FullMethodName = "/openshell.v1.OpenShell/GetSandboxProviderEnvironment" OpenShell_ExchangeProviderSubjectToken_FullMethodName = "/openshell.v1.OpenShell/ExchangeProviderSubjectToken" OpenShell_GetSandboxLogs_FullMethodName = "/openshell.v1.OpenShell/GetSandboxLogs" @@ -231,6 +232,8 @@ type OpenShellClient interface { // Report installed provider state for the current ConnectSupervisor session. // Replacing or losing that session invalidates its observations. ReportProviderReadiness(ctx context.Context, in *ReportProviderReadinessRequest, opts ...grpc.CallOption) (*ReportProviderReadinessResponse, error) + // Register startup and acknowledge an exact validated runtime configuration. + ReportSandboxConfiguration(ctx context.Context, in *ReportSandboxConfigurationRequest, opts ...grpc.CallOption) (*ReportSandboxConfigurationResponse, error) // Get provider environment for a sandbox (called by sandbox supervisor at startup). GetSandboxProviderEnvironment(ctx context.Context, in *GetSandboxProviderEnvironmentRequest, opts ...grpc.CallOption) (*GetSandboxProviderEnvironmentResponse, error) // Exchange a stored provider subject token for an intermediate token scoped @@ -841,6 +844,16 @@ func (c *openShellClient) ReportProviderReadiness(ctx context.Context, in *Repor return out, nil } +func (c *openShellClient) ReportSandboxConfiguration(ctx context.Context, in *ReportSandboxConfigurationRequest, opts ...grpc.CallOption) (*ReportSandboxConfigurationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ReportSandboxConfigurationResponse) + err := c.cc.Invoke(ctx, OpenShell_ReportSandboxConfiguration_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *openShellClient) GetSandboxProviderEnvironment(ctx context.Context, in *GetSandboxProviderEnvironmentRequest, opts ...grpc.CallOption) (*GetSandboxProviderEnvironmentResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetSandboxProviderEnvironmentResponse) @@ -1258,6 +1271,8 @@ type OpenShellServer interface { // Report installed provider state for the current ConnectSupervisor session. // Replacing or losing that session invalidates its observations. ReportProviderReadiness(context.Context, *ReportProviderReadinessRequest) (*ReportProviderReadinessResponse, error) + // Register startup and acknowledge an exact validated runtime configuration. + ReportSandboxConfiguration(context.Context, *ReportSandboxConfigurationRequest) (*ReportSandboxConfigurationResponse, error) // Get provider environment for a sandbox (called by sandbox supervisor at startup). GetSandboxProviderEnvironment(context.Context, *GetSandboxProviderEnvironmentRequest) (*GetSandboxProviderEnvironmentResponse, error) // Exchange a stored provider subject token for an intermediate token scoped @@ -1503,6 +1518,9 @@ func (UnimplementedOpenShellServer) ReportEndpointStatus(context.Context, *Repor func (UnimplementedOpenShellServer) ReportProviderReadiness(context.Context, *ReportProviderReadinessRequest) (*ReportProviderReadinessResponse, error) { return nil, status.Error(codes.Unimplemented, "method ReportProviderReadiness not implemented") } +func (UnimplementedOpenShellServer) ReportSandboxConfiguration(context.Context, *ReportSandboxConfigurationRequest) (*ReportSandboxConfigurationResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ReportSandboxConfiguration not implemented") +} func (UnimplementedOpenShellServer) GetSandboxProviderEnvironment(context.Context, *GetSandboxProviderEnvironmentRequest) (*GetSandboxProviderEnvironmentResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetSandboxProviderEnvironment not implemented") } @@ -2476,6 +2494,24 @@ func _OpenShell_ReportProviderReadiness_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _OpenShell_ReportSandboxConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReportSandboxConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OpenShellServer).ReportSandboxConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OpenShell_ReportSandboxConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OpenShellServer).ReportSandboxConfiguration(ctx, req.(*ReportSandboxConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _OpenShell_GetSandboxProviderEnvironment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetSandboxProviderEnvironmentRequest) if err := dec(in); err != nil { @@ -3117,6 +3153,10 @@ var OpenShell_ServiceDesc = grpc.ServiceDesc{ MethodName: "ReportProviderReadiness", Handler: _OpenShell_ReportProviderReadiness_Handler, }, + { + MethodName: "ReportSandboxConfiguration", + Handler: _OpenShell_ReportSandboxConfiguration_Handler, + }, { MethodName: "GetSandboxProviderEnvironment", Handler: _OpenShell_GetSandboxProviderEnvironment_Handler, diff --git a/sdk/go/proto/sandboxv1/sandbox.pb.go b/sdk/go/proto/sandboxv1/sandbox.pb.go index c4a7d5f417..3153c0ecae 100644 --- a/sdk/go/proto/sandboxv1/sandbox.pb.go +++ b/sdk/go/proto/sandboxv1/sandbox.pb.go @@ -1829,6 +1829,13 @@ type GetSandboxConfigResponse struct { // Gateway-owned attachment identity captured with this desired configuration. // Compare for equality; reattachment invalidates previous installation evidence. ProviderAttachmentEpoch string `protobuf:"bytes,14,opt,name=provider_attachment_epoch,json=providerAttachmentEpoch,proto3" json:"provider_attachment_epoch,omitempty"` + // True only after validating this complete policy/provider composition. + // Missing (older gateway) is deliberately not admission. + ConfigurationAdmitted bool `protobuf:"varint,13,opt,name=configuration_admitted,json=configurationAdmitted,proto3" json:"configuration_admitted,omitempty"` + // Bounded, credential-free admission diagnostic. Empty for admitted policy. + ConfigurationError string `protobuf:"bytes,16,opt,name=configuration_error,json=configurationError,proto3" json:"configuration_error,omitempty"` + // Registration fence for a new supervisor; capture once and retain on retry. + ConfigurationInstanceId string `protobuf:"bytes,15,opt,name=configuration_instance_id,json=configurationInstanceId,proto3" json:"configuration_instance_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1954,6 +1961,27 @@ func (x *GetSandboxConfigResponse) GetProviderAttachmentEpoch() string { return "" } +func (x *GetSandboxConfigResponse) GetConfigurationAdmitted() bool { + if x != nil { + return x.ConfigurationAdmitted + } + return false +} + +func (x *GetSandboxConfigResponse) GetConfigurationError() string { + if x != nil { + return x.ConfigurationError + } + return "" +} + +func (x *GetSandboxConfigResponse) GetConfigurationInstanceId() string { + if x != nil { + return x.ConfigurationInstanceId + } + return "" +} + // Connection details for one operator-registered supervisor middleware service. // V1 supports plaintext and server-authenticated TLS gRPC. type SupervisorMiddlewareService struct { @@ -2217,7 +2245,7 @@ const file_sandbox_proto_rawDesc = "" + "\x05value\"\x86\x01\n" + "\x10EffectiveSetting\x128\n" + "\x05value\x18\x01 \x01(\v2\".openshell.sandbox.v1.SettingValueR\x05value\x128\n" + - "\x05scope\x18\x02 \x01(\x0e2\".openshell.sandbox.v1.SettingScopeR\x05scope\"\x8d\a\n" + + "\x05scope\x18\x02 \x01(\x0e2\".openshell.sandbox.v1.SettingScopeR\x05scope\"\xb1\b\n" + "\x18GetSandboxConfigResponse\x12;\n" + "\x06policy\x18\x01 \x01(\v2#.openshell.sandbox.v1.SandboxPolicyR\x06policy\x12\x18\n" + "\aversion\x18\x02 \x01(\rR\aversion\x12\x1f\n" + @@ -2233,7 +2261,10 @@ const file_sandbox_proto_rawDesc = "" + " \x01(\tR\tworkspace\x12C\n" + "\x1epolicy_validation_failure_mode\x18\v \x01(\tR\x1bpolicyValidationFailureMode\x12H\n" + " extension_authentication_enabled\x18\f \x01(\bR\x1eextensionAuthenticationEnabled\x12:\n" + - "\x19provider_attachment_epoch\x18\x0e \x01(\tR\x17providerAttachmentEpoch\x1ac\n" + + "\x19provider_attachment_epoch\x18\x0e \x01(\tR\x17providerAttachmentEpoch\x125\n" + + "\x16configuration_admitted\x18\r \x01(\bR\x15configurationAdmitted\x12/\n" + + "\x13configuration_error\x18\x10 \x01(\tR\x12configurationError\x12:\n" + + "\x19configuration_instance_id\x18\x0f \x01(\tR\x17configurationInstanceId\x1ac\n" + "\rSettingsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12<\n" + "\x05value\x18\x02 \x01(\v2&.openshell.sandbox.v1.EffectiveSettingR\x05value:\x028\x01\"\xd2\x02\n" + diff --git a/skills/debug-openshell-cluster/SKILL.md b/skills/debug-openshell-cluster/SKILL.md index 5e312ae718..c833d2cfc8 100644 --- a/skills/debug-openshell-cluster/SKILL.md +++ b/skills/debug-openshell-cluster/SKILL.md @@ -185,6 +185,25 @@ are unavailable. Workload shells belong to the separate sandbox image. Preserve the driver-selected UID and writable runtime/log mounts when reproducing a supervisor startup failure. +A `ConfigurationInvalid` readiness condition means startup admission rejected +the image/effective policy or provider configuration. The supervisor remains +alive while the workload stays unstarted. Inspect `openshell sandbox get` and +repair the desired configuration with a complete policy replacement or provider +change; do not treat a healthy container as proof that the workload is ready. +If the 300-second provisioning repair window expires, the gateway records +`ProvisioningTimedOut` and stops workload and supervisor compute. Inspect +`provisioning` in sandbox JSON and TUI NOTES to distinguish cleanup pending from +complete. Repairing configuration after expiry does not restart compute: wait +for cleanup, then explicitly use `sandbox start`. Repeated rejected reports do +not refresh the deadline, and the CLI wait timeout does not control it. +See [policy validation and repair](https://docs.nvidia.com/openshell/latest/sandboxes/policies.md). +The isolated supervisor requests image-policy discovery through the authenticated +sandbox boundary before admission. The workload boundary can remain alive without +launching the workload while configuration is repaired. An unavailable boundary +fails discovery within its control-request deadline. Permanent +gateway errors and exhausted transient retries terminate startup; inspect those +errors as connectivity, authorization, or lifecycle failures. + ### Step 4: Check Docker-Backed Gateways ```bash diff --git a/skills/generate-sandbox-policy/SKILL.md b/skills/generate-sandbox-policy/SKILL.md index 39ab4cadef..89e6223ac2 100644 --- a/skills/generate-sandbox-policy/SKILL.md +++ b/skills/generate-sandbox-policy/SKILL.md @@ -173,6 +173,12 @@ When middleware is requested, also read the published [supervisor middleware gui For enforcement concepts and the shipped baseline, read [sandbox policies](https://docs.nvidia.com/openshell/latest/sandboxes/policies.md) and the [default policy reference](https://docs.nvidia.com/openshell/latest/reference/default-policy.md). The default policy is baked into the community base image (`ghcr.io/nvidia/openshell-community/sandboxes/base:latest`). +Validate the intended provider combination as well as the authored policy. +An image endpoint can become credentialed after provider composition and block +startup with `ConfigurationInvalid`. Repair the complete policy or provider +selection using the published policy workflow; do not add +`allow_uninspected_credentials` merely to bypass a startup error. + ## Step 4: Choose Policy Shape Follow this decision tree based on the detail tier and user intent: diff --git a/skills/openshell-cli/SKILL.md b/skills/openshell-cli/SKILL.md index cb23c6e6f8..057874fa3a 100644 --- a/skills/openshell-cli/SKILL.md +++ b/skills/openshell-cli/SKILL.md @@ -447,7 +447,21 @@ the operation that removes retained state. This is the most important multi-step workflow. It enables a tight feedback cycle where sandbox policy is refined based on observed activity. -**Key concept**: Policies have static fields (immutable after creation: `filesystem_policy`, `landlock`, `process`) and two dynamic fields: `network_policies` and `network_middlewares`. Both dynamic fields can be updated without recreating the sandbox when the selected compute driver supports live policy updates. Drivers without the standard supervisor fetch revisions through the sandbox configuration API and report whether they loaded them. +**Key concept**: Policies have static fields (immutable after activation: `filesystem_policy`, `landlock`, `process`) and two dynamic fields: `network_policies` and `network_middlewares`. Both dynamic fields can be updated without recreating the sandbox when the selected compute driver supports live policy updates. Drivers without the standard supervisor fetch revisions through the sandbox configuration API and report whether they loaded them. + +If startup reports `ConfigurationInvalid`, inspect `openshell sandbox get` and +repair the complete policy or provider set through the gateway. The workload +has not started on its first activation, so static fields can also be replaced +during this initial repair. A previously activated sandbox retains static-field +restrictions while restart admission is pending or rejected. +Before the gateway's 300-second repair window expires, successful validation +completes startup in place. Effective stored configuration changes and their +first failed load reset that window; repeated failures do not. After +`ProvisioningTimedOut`, inspect the retained record and cleanup status, repair +configuration, and explicitly run `sandbox start` once cleanup completes. A CLI +wait timeout is separate from this gateway deadline. Follow the +published [policy repair guidance](https://docs.nvidia.com/openshell/latest/sandboxes/policies.md) +and confirm current replacement/detach syntax with installed CLI help. An endpoint with omitted `protocol` retains explicit-proxy behavior. Explicit `protocol: tcp` requests policy DNS and transparent TCP and currently requires From 8b77925eb7a67df5356c510076d6495b08f90058 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Fri, 18 Sep 2026 00:53:36 +0000 Subject: [PATCH 12/12] feat(installer): support prerelease installations (#3364) * feat(installer): support prerelease installations Signed-off-by: Drew Newberry * docs(readme): clarify 0.1.0 production readiness Signed-off-by: Drew Newberry * docs(readme): refine production readiness message Signed-off-by: Drew Newberry * fix(release): publish rolling prerelease channels Signed-off-by: Drew Newberry * fix(release): keep prereleases out of GitHub releases Signed-off-by: Drew Newberry * docs(readme): refine 0.1.0 notice Signed-off-by: Drew Newberry * docs(readme): expand 0.1.0 notice Signed-off-by: Drew Newberry * docs(readme): simplify 0.1.0 notice Signed-off-by: Drew Newberry * refactor(installer): simplify prerelease alias Signed-off-by: Drew Newberry * fix(installer): require successful prerelease runs Signed-off-by: Drew Newberry * refactor(release): reuse exact prerelease artifacts Signed-off-by: Drew Newberry * fix(installer): include prover in prerelease bundle Signed-off-by: Drew Newberry * ci: remove prerelease post-publish validation Signed-off-by: Drew Newberry * docs(fern): sync announcement configuration Signed-off-by: Piotr Mlocek * docs: remove stale prerelease canary claim Signed-off-by: Drew Newberry * docs(fern): defer announcement synchronization Signed-off-by: Drew Newberry * docs(fern): simplify release announcement Signed-off-by: Drew Newberry --------- Signed-off-by: Drew Newberry Signed-off-by: Piotr Mlocek Co-authored-by: Piotr Mlocek --- .github/workflows/release-tag.yml | 59 +++++++- README.md | 90 +++++++++-- deploy/helm/openshell/README.md | 3 +- deploy/helm/openshell/README.md.gotmpl | 3 +- docs/about/installation.mdx | 12 ++ fern/docs.yml | 2 + install.sh | 185 +++++++++++++++++++++-- python/openshell/release_formula_test.py | 9 +- tasks/scripts/test-install-sh.sh | 127 ++++++++++++++++ 9 files changed, 458 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 09010d9031..bc6291c094 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -407,7 +407,6 @@ jobs: cat openshell-supervisor-checksums-sha256.txt - name: Generate Homebrew formula - if: needs.compute-versions.outputs.is_prerelease != 'true' run: | set -euo pipefail python3 tasks/scripts/release.py generate-homebrew-formula \ @@ -493,12 +492,64 @@ jobs: release/openshell-supervisor-checksums-sha256.txt release/openshell-prover-checksums-sha256.txt - - name: Upload pre-release artifacts + - name: Upload amd64 Debian prerelease package if: needs.compute-versions.outputs.is_prerelease == 'true' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: openshell-${{ env.RELEASE_TAG }} - path: release/ + name: openshell-${{ env.RELEASE_TAG }}-linux-amd64-deb + path: | + release/openshell_*_amd64.deb + release/openshell-checksums-sha256.txt + retention-days: 90 + if-no-files-found: error + + - name: Upload arm64 Debian prerelease package + if: needs.compute-versions.outputs.is_prerelease == 'true' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: openshell-${{ env.RELEASE_TAG }}-linux-arm64-deb + path: | + release/openshell_*_arm64.deb + release/openshell-checksums-sha256.txt + retention-days: 90 + if-no-files-found: error + + - name: Upload x86_64 RPM prerelease packages + if: needs.compute-versions.outputs.is_prerelease == 'true' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: openshell-${{ env.RELEASE_TAG }}-linux-x86_64-rpm + path: | + release/openshell-*.x86_64.rpm + release/openshell-checksums-sha256.txt + retention-days: 90 + if-no-files-found: error + + - name: Upload aarch64 RPM prerelease packages + if: needs.compute-versions.outputs.is_prerelease == 'true' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: openshell-${{ env.RELEASE_TAG }}-linux-aarch64-rpm + path: | + release/openshell-*.aarch64.rpm + release/openshell-checksums-sha256.txt + retention-days: 90 + if-no-files-found: error + + - name: Upload macOS prerelease packages + if: needs.compute-versions.outputs.is_prerelease == 'true' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: openshell-${{ env.RELEASE_TAG }}-macos-arm64 + path: | + release/openshell-aarch64-apple-darwin.tar.gz + release/openshell-gateway-aarch64-apple-darwin.tar.gz + release/openshell-driver-vm-aarch64-apple-darwin.tar.gz + release/openshell-prover-aarch64-apple-darwin.tar.gz + release/openshell.rb + release/openshell-checksums-sha256.txt + release/openshell-gateway-checksums-sha256.txt + release/openshell-prover-checksums-sha256.txt retention-days: 90 if-no-files-found: error diff --git a/README.md b/README.md index 51ae674956..f23ddb63c5 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ [![Documentation](https://img.shields.io/badge/docs-latest-brightgreen)](https://docs.nvidia.com/openshell/latest/index.html) [![Project Status](https://img.shields.io/badge/status-alpha-orange)](https://docs.nvidia.com/openshell/latest/about/release-notes.html) +> [!IMPORTANT] +> **OpenShell 0.1.0 is coming soon.** [Track progress in the 0.1.0 milestone](https://github.com/NVIDIA/OpenShell/milestone/10), [read the prerelease documentation](https://docs.nvidia.com/openshell/dev/index.html), or [install a prerelease](#prerelease-and-development-builds). + OpenShell is the safe, private runtime for autonomous AI agents. It provides sandboxed execution environments that protect your data, credentials, and infrastructure — governed by declarative YAML policies that prevent unauthorized file access, data exfiltration, and uncontrolled network activity. OpenShell is built agent-first. It ships public agent skills for using and operating OpenShell, plus separate repository-aware workflows for contributors and maintainers. @@ -27,21 +30,15 @@ OpenShell is built agent-first. It ships public agent skills for using and opera ### Install -**Binary (recommended):** +**Local installation:** ```bash curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh ``` -The installer installs the latest stable release by default. To install a specific version, set `OPENSHELL_VERSION`. A [`dev` release](https://github.com/NVIDIA/OpenShell/releases/tag/dev) is also available that tracks the latest commit on `main`. - -The `openshell` package on PyPI provides the Python SDK only. It does not install the `openshell` CLI. Add the SDK to a Python project with [uv](https://docs.astral.sh/uv/): - -```bash -uv add openshell -``` +The installer installs the latest stable release by default. See [Prerelease and development builds](#prerelease-and-development-builds) to install an upcoming release or the latest commit on `main`. -**Helm chart:** +**Kubernetes installation:** > **Experimental** — the Kubernetes deployment path is under active development. Expect rough edges and breaking changes. @@ -104,6 +101,44 @@ See the [full walkthrough](examples/sandbox-policy-quickstart/) or run the autom bash examples/sandbox-policy-quickstart/demo.sh ``` +## SDKs + +OpenShell provides client SDKs for Python, TypeScript, Go, and Rust. SDK packages connect applications to an OpenShell gateway; they do not install the `openshell` CLI. Use the SDK and gateway from the same OpenShell release when possible. + +### Python + +The [Python SDK](python/openshell/) is published to [PyPI](https://pypi.org/project/openshell/): + +```shell +uv add openshell +``` + +### TypeScript + +The [TypeScript SDK](sdk/typescript/README.md) is published to GitHub Packages as `@nvidia/openshell-sdk`. Configure the `@nvidia` npm scope for `https://npm.pkg.github.com`, authenticate with a token that has `read:packages`, and install it: + +```shell +npm install @nvidia/openshell-sdk +``` + +### Go + +Add the [Go SDK](sdk/go/README.md) to a Go module: + +```shell +go get github.com/NVIDIA/OpenShell/sdk/go@latest +``` + +### Rust + +The [Rust SDK](crates/openshell-sdk/README.md) is currently consumed from source. Pin the Git dependency to the same OpenShell release as the gateway: + +```shell +cargo add openshell-sdk \ + --git https://github.com/NVIDIA/OpenShell \ + --tag +``` + ## How It Works OpenShell isolates each sandbox in its own container with policy-enforced egress routing. A lightweight gateway coordinates sandbox lifecycle, and every outbound connection is intercepted by the policy engine, which does one of three things: @@ -257,6 +292,43 @@ Agent implementation is human-directed: a user may request a phase directly, or - [Brev Launchable](https://brev.nvidia.com/launchable/deploy/now?launchableID=env-3Ap3tL55zq4a8kew1AuW0FpSLsg) — try OpenShell on cloud compute without local setup - [Agent Instructions](AGENTS.md) — system prompt and workflow documentation for agent contributors +## Prerelease and development builds + +Use a prerelease candidate to evaluate an upcoming release, or use the rolling development build to test the latest commit on `main`. These builds may change before the next stable release. The matching documentation is published in the [development channel](https://docs.nvidia.com/openshell/dev/index.html). + +Prerelease packages are retained as GitHub Actions artifacts for 90 days and require an authenticated [GitHub CLI](https://cli.github.com/) session. The `pre` alias installs the latest prerelease: + +```shell +gh auth login +curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | \ + OPENSHELL_VERSION=pre sh +``` + +The installer downloads only the artifact for the current platform and rejects expired candidates during discovery. Installed packages retain the candidate's exact version, such as `0.1.0-pre.3`. Prerelease tags do not create entries on the GitHub Releases page. + +The rolling [`dev` release](https://github.com/NVIDIA/OpenShell/releases/tag/dev) does not require GitHub authentication: + +```shell +curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | \ + OPENSHELL_VERSION=dev sh +``` + +For Kubernetes, select the corresponding Helm chart version. Helm chart versions omit the leading `v` from release tags: + +```shell +# Pin an exact candidate +helm upgrade --install openshell \ + oci://ghcr.io/nvidia/openshell/helm-chart \ + --version 0.1.0-pre.3 + +# Rolling development build +helm upgrade --install openshell \ + oci://ghcr.io/nvidia/openshell/helm-chart \ + --version 0.0.0-dev +``` + +Prerelease charts use exact `-pre.N` versions. Development charts are also published as immutable `0.0.0-dev.` versions when you need to pin a specific commit. See the [Helm chart documentation](deploy/helm/openshell/README.md#available-versions) for version and configuration details. + ## Contributing OpenShell is built agent-first. Issues should include a user story, problem statement, impact, and acceptance criteria. The impact should explain the consequences of the current behavior and why existing workarounds are insufficient. Feature requests also require a workflow-level proposed design and alternatives; bug reports add reproduction steps, environment details, and relevant logs. Once work is authorized through the project workflow or a direct request, contributors should use the skills in `.agents/skills/` to investigate the current code and behavior, implement the change, and verify it. If an issue contains earlier diagnostics, verify them rather than relying on them. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full agent skills table, contribution workflow, and development setup. diff --git a/deploy/helm/openshell/README.md b/deploy/helm/openshell/README.md index 231983aca7..003475df96 100644 --- a/deploy/helm/openshell/README.md +++ b/deploy/helm/openshell/README.md @@ -63,10 +63,11 @@ On OpenShift 4.22+, end-to-end TLS is supported via `BackendTLSPolicy`. See the | Tag | Source | Notes | | --- | --- | --- | | `` (e.g. `0.6.0`) | Tagged GitHub release | Tracks the matching gateway, sandbox, and supervisor image versions. Recommended for production. | +| `-pre.N` (e.g. `0.1.0-pre.3`) | A specific prerelease candidate | Immutable candidate pin that tracks images with the same exact version. | | `0.0.0-dev` | Latest commit on `main` | Floating tag, overwritten on every push. `appVersion` is `dev`, so images resolve to the `:dev` tag. | | `0.0.0-dev.` | A specific commit on `main` | Per-commit pin. Chart version and `appVersion` both use the full 40-character commit SHA, which matches the image tag pushed by CI. | -The `dev` tags are intended for testing changes ahead of a release. Production deployments should pin to a tagged release. +Prerelease and `dev` tags are intended for testing changes ahead of a release. Production deployments should pin to a stable tagged release. ## Configuration diff --git a/deploy/helm/openshell/README.md.gotmpl b/deploy/helm/openshell/README.md.gotmpl index 0adac0d070..75e651e214 100644 --- a/deploy/helm/openshell/README.md.gotmpl +++ b/deploy/helm/openshell/README.md.gotmpl @@ -63,10 +63,11 @@ On OpenShift 4.22+, end-to-end TLS is supported via `BackendTLSPolicy`. See the | Tag | Source | Notes | | --- | --- | --- | | `` (e.g. `0.6.0`) | Tagged GitHub release | Tracks the matching gateway, sandbox, and supervisor image versions. Recommended for production. | +| `-pre.N` (e.g. `0.1.0-pre.3`) | A specific prerelease candidate | Immutable candidate pin that tracks images with the same exact version. | | `0.0.0-dev` | Latest commit on `main` | Floating tag, overwritten on every push. `appVersion` is `dev`, so images resolve to the `:dev` tag. | | `0.0.0-dev.` | A specific commit on `main` | Per-commit pin. Chart version and `appVersion` both use the full 40-character commit SHA, which matches the image tag pushed by CI. | -The `dev` tags are intended for testing changes ahead of a release. Production deployments should pin to a tagged release. +Prerelease and `dev` tags are intended for testing changes ahead of a release. Production deployments should pin to a stable tagged release. ## Configuration diff --git a/docs/about/installation.mdx b/docs/about/installation.mdx index 33b4dfc95f..57d8ca6b39 100644 --- a/docs/about/installation.mdx +++ b/docs/about/installation.mdx @@ -20,6 +20,18 @@ The script detects your operating system and installs the OpenShell CLI, standal You can also download release artifacts directly from the [OpenShell GitHub Releases](https://github.com/NVIDIA/OpenShell/releases) page. +### Install a prerelease + +Prerelease packages are retained as GitHub Actions artifacts for 90 days and require an authenticated [GitHub CLI](https://cli.github.com/) session. The `pre` alias installs the latest prerelease: + +```shell +gh auth login +curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | \ + OPENSHELL_VERSION=pre sh +``` + +The installer rejects expired candidates, downloads only the artifact required for your platform, and installs with Debian, RPM, or Homebrew. Installed packages retain the candidate's exact version, such as `0.1.0-pre.3`. Prerelease tags do not create entries on the GitHub Releases page. + The `openshell` package on PyPI provides the Python SDK only. It does not install the `openshell` CLI. Add the SDK to a Python project with: ```shell diff --git a/fern/docs.yml b/fern/docs.yml index 65639bd5d0..1161512029 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -59,6 +59,8 @@ versions: - display-name: Latest path: ../docs/index.yml slug: latest + announcement: + message: 'OpenShell 0.1.0 is coming soon. Track progress in the 0.1.0 milestone, read the prerelease documentation, or install a prerelease.' redirects: - source: "/openshell/latest/sandboxes/providers-v2" diff --git a/install.sh b/install.sh index 7f86736148..00f8141135 100755 --- a/install.sh +++ b/install.sh @@ -14,10 +14,15 @@ APP_NAME="openshell" REPO="NVIDIA/OpenShell" GITHUB_URL="https://github.com/${REPO}" RELEASE_TAG="${OPENSHELL_VERSION:-}" +RELEASE_ASSET_DIR="" CHECKSUMS_NAME="openshell-checksums-sha256.txt" LOCAL_GATEWAY_PORT="17670" HOMEBREW_TAP="nvidia/openshell" HOMEBREW_FORMULA_NAME="openshell" +HOMEBREW_CLI_ASSET="openshell-aarch64-apple-darwin.tar.gz" +HOMEBREW_GATEWAY_ASSET="openshell-gateway-aarch64-apple-darwin.tar.gz" +HOMEBREW_DRIVER_VM_ASSET="openshell-driver-vm-aarch64-apple-darwin.tar.gz" +HOMEBREW_PROVER_ASSET="openshell-prover-aarch64-apple-darwin.tar.gz" BREAKING_RELEASE_VERSION="0.0.37" LINUX_PACKAGE_GLIBC_MIN_VERSION="2.28" UPGRADE_NOTICE_ACK="${OPENSHELL_ACK_BREAKING_UPGRADE:-}" @@ -51,6 +56,8 @@ OPTIONS: ENVIRONMENT VARIABLES: OPENSHELL_VERSION Release tag to install (default: latest tagged release). Set OPENSHELL_VERSION=dev to install the rolling dev build. + Set OPENSHELL_VERSION=pre to install the latest prerelease. + Prereleases require an authenticated GitHub CLI session. OPENSHELL_ACK_BREAKING_UPGRADE Set to 1 only after backing up and cleaning up a pre-v0.0.37 installation. @@ -328,6 +335,11 @@ guard_breaking_upgrade() { } resolve_release_tag() { + if [ "${OPENSHELL_VERSION:-}" = "pre" ]; then + resolve_latest_prerelease_tag + return 0 + fi + if [ -n "${OPENSHELL_VERSION:-}" ]; then echo "$OPENSHELL_VERSION" return 0 @@ -355,11 +367,138 @@ resolve_release_tag() { echo "$_version" } +resolve_latest_prerelease_tag() { + require_prerelease_github_access + + info "resolving latest prerelease..." + _artifact_platform="$(prerelease_artifact_platform)" + _successful_run_ids="$(gh api --paginate \ + "repos/${REPO}/actions/workflows/release-tag.yml/runs?status=success&per_page=100" \ + --jq '.workflow_runs[] | select(.status == "completed" and .conclusion == "success") | .id')" || { + error "failed to list successful Release Tag workflow runs" + } + _artifact_records="$(gh api --paginate \ + "repos/${REPO}/actions/artifacts?per_page=100" \ + --jq '.artifacts[] | select(.expired == false) | [.workflow_run.id, .name] | @tsv')" || { + error "failed to list prerelease artifacts" + } + _artifact_names="$(printf '%s\n--ARTIFACTS--\n%s\n' "$_successful_run_ids" "$_artifact_records" | awk -F '\t' ' + $0 == "--ARTIFACTS--" { + reading_artifacts = 1 + next + } + !reading_artifacts { + if ($1 ~ /^[0-9]+$/) successful_runs[$1] = 1 + next + } + $1 in successful_runs { + print $2 + } + ')" + _release_tags="$(printf '%s\n' "$_artifact_names" | sed -n "s/^openshell-\(v[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-pre\.[1-9][0-9]*\)-${_artifact_platform}$/\1/p" | sort -u)" + + _latest_prerelease="$(printf '%s\n' "$_release_tags" | awk ' + /^v[0-9]+\.[0-9]+\.[0-9]+-pre\.[1-9][0-9]*$/ { + tag = $0 + sub(/^v/, "", tag) + split(tag, version_parts, "-pre[.]") + split(version_parts[1], core, "[.]") + sequence = version_parts[2] + 0 + + if (!found || core[1] + 0 > major || + (core[1] + 0 == major && core[2] + 0 > minor) || + (core[1] + 0 == major && core[2] + 0 == minor && core[3] + 0 > patch) || + (core[1] + 0 == major && core[2] + 0 == minor && core[3] + 0 == patch && sequence > prerelease)) { + selected = $0 + major = core[1] + 0 + minor = core[2] + 0 + patch = core[3] + 0 + prerelease = sequence + found = 1 + } + } + END { + if (found) print selected + } + ')" + + if [ -z "$_latest_prerelease" ]; then + error "no unexpired prerelease artifacts found" + fi + + printf '%s\n' "$_latest_prerelease" +} + +is_prerelease_tag() { + printf '%s\n' "$1" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+-pre\.[1-9][0-9]*$' +} + +require_prerelease_github_access() { + require_cmd gh + if ! gh auth status --hostname github.com >/dev/null 2>&1; then + error "GitHub CLI authentication is required for prerelease artifacts; run 'gh auth login' and try again" + fi +} + +prerelease_artifact_platform() { + case "${PLATFORM}:$(uname -m)" in + linux:x86_64 | linux:amd64) + case "$(linux_package_method)" in + deb) echo "linux-amd64-deb" ;; + rpm) echo "linux-x86_64-rpm" ;; + esac + ;; + linux:aarch64 | linux:arm64) + case "$(linux_package_method)" in + deb) echo "linux-arm64-deb" ;; + rpm) echo "linux-aarch64-rpm" ;; + esac + ;; + darwin:arm64 | darwin:aarch64) echo "macos-arm64" ;; + *) error "no prerelease artifact is available for ${PLATFORM}/$(uname -m)" ;; + esac +} + +prepare_prerelease_assets() { + _destination="$1" + is_prerelease_tag "$RELEASE_TAG" || return 0 + require_prerelease_github_access + + _artifact_name="openshell-${RELEASE_TAG}-$(prerelease_artifact_platform)" + info "locating ${_artifact_name}..." + _run_id="$(gh api \ + "repos/${REPO}/actions/artifacts?name=${_artifact_name}&per_page=100" \ + --jq '[.artifacts[] | select(.expired == false)] | sort_by(.created_at) | last | .workflow_run.id')" || { + error "failed to find prerelease artifact ${_artifact_name}" + } + if [ -z "$_run_id" ] || [ "$_run_id" = "null" ] || ! printf '%s\n' "$_run_id" | grep -Eq '^[0-9]+$'; then + error "no unexpired prerelease artifact found for ${RELEASE_TAG} on this platform" + fi + + RELEASE_ASSET_DIR="${_destination}/release" + info "downloading ${_artifact_name}..." + gh run download "$_run_id" \ + --repo "$REPO" \ + --name "$_artifact_name" \ + --dir "$RELEASE_ASSET_DIR" || { + error "failed to download prerelease artifact ${_artifact_name}" + } +} + download_release_asset() { _tag="$1" _filename="$2" _output="$3" + if [ -n "$RELEASE_ASSET_DIR" ]; then + _source="${RELEASE_ASSET_DIR}/${_filename}" + if [ -f "$_source" ]; then + cp "$_source" "$_output" + return 0 + fi + return 1 + fi + if curl -fLs --retry 3 --max-redirs 5 -o "$_output" \ "${GITHUB_URL}/releases/download/${_tag}/${_filename}"; then return 0 @@ -697,6 +836,28 @@ patch_homebrew_formula() { } +patch_prerelease_homebrew_formula_urls() { + _formula_file="$1" + [ -n "$RELEASE_ASSET_DIR" ] || return 0 + + for _asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do + if [ ! -f "${RELEASE_ASSET_DIR}/${_asset}" ]; then + error "prerelease artifact is missing the required macOS asset: ${_asset}" + fi + done + + _release_asset_url="${GITHUB_URL}/releases/download/${RELEASE_TAG}" + _local_asset_url="file://${RELEASE_ASSET_DIR}" + _patched_file="${_formula_file}.prerelease" + sed \ + -e "s#${_release_asset_url}/${HOMEBREW_CLI_ASSET}#${_local_asset_url}/${HOMEBREW_CLI_ASSET}#g" \ + -e "s#${_release_asset_url}/${HOMEBREW_GATEWAY_ASSET}#${_local_asset_url}/${HOMEBREW_GATEWAY_ASSET}#g" \ + -e "s#${_release_asset_url}/${HOMEBREW_DRIVER_VM_ASSET}#${_local_asset_url}/${HOMEBREW_DRIVER_VM_ASSET}#g" \ + -e "s#${_release_asset_url}/${HOMEBREW_PROVER_ASSET}#${_local_asset_url}/${HOMEBREW_PROVER_ASSET}#g" \ + "$_formula_file" >"$_patched_file" + mv "$_patched_file" "$_formula_file" +} + start_user_gateway() { info "restarting openshell-gateway user service as ${TARGET_USER}..." @@ -891,11 +1052,10 @@ install_linux_deb() { _tmpdir="$(mktemp -d)" chmod 0755 "$_tmpdir" trap 'rm -rf "$_tmpdir"' EXIT - - _checksums_url="${GITHUB_URL}/releases/download/${RELEASE_TAG}/${CHECKSUMS_NAME}" + prepare_prerelease_assets "$_tmpdir" info "downloading ${RELEASE_TAG} release checksums..." - download "$_checksums_url" "${_tmpdir}/${CHECKSUMS_NAME}" || { - error "failed to download ${_checksums_url}" + download_release_asset "$RELEASE_TAG" "$CHECKSUMS_NAME" "${_tmpdir}/${CHECKSUMS_NAME}" || { + error "failed to download ${CHECKSUMS_NAME} for ${RELEASE_TAG}" } _deb_file="$(find_deb_asset "${_tmpdir}/${CHECKSUMS_NAME}" "$_arch")" @@ -903,14 +1063,13 @@ install_linux_deb() { error "no Debian package found for architecture: ${_arch}" fi - _deb_url="${GITHUB_URL}/releases/download/${RELEASE_TAG}/${_deb_file}" _deb_path="${_tmpdir}/${_deb_file}" info "selected ${_deb_file}" info "downloading ${_deb_file}..." download_release_asset "$RELEASE_TAG" "$_deb_file" "$_deb_path" || { - error "failed to download ${_deb_url}" + error "failed to download ${_deb_file} for ${RELEASE_TAG}" } chmod 0644 "$_deb_path" @@ -931,11 +1090,10 @@ install_linux_rpm() { _tmpdir="$(mktemp -d)" chmod 0755 "$_tmpdir" trap 'rm -rf "$_tmpdir"' EXIT - - _checksums_url="${GITHUB_URL}/releases/download/${RELEASE_TAG}/${CHECKSUMS_NAME}" + prepare_prerelease_assets "$_tmpdir" info "downloading ${RELEASE_TAG} release checksums..." - download "$_checksums_url" "${_tmpdir}/${CHECKSUMS_NAME}" || { - error "failed to download ${_checksums_url}" + download_release_asset "$RELEASE_TAG" "$CHECKSUMS_NAME" "${_tmpdir}/${CHECKSUMS_NAME}" || { + error "failed to download ${CHECKSUMS_NAME} for ${RELEASE_TAG}" } _rpm_file="$(find_rpm_asset "${_tmpdir}/${CHECKSUMS_NAME}" "$_arch" openshell)" @@ -961,7 +1119,7 @@ install_linux_rpm() { info "downloading ${_package_file}..." download_release_asset "$RELEASE_TAG" "$_package_file" "$_package_path" || { - error "failed to download ${_package_url}" + error "failed to download ${_package_file} for ${RELEASE_TAG}" } chmod 0644 "$_package_path" @@ -984,7 +1142,7 @@ install_macos_homebrew() { _tmpdir="$(mktemp -d)" chmod 0755 "$_tmpdir" trap 'rm -rf "$_tmpdir"' EXIT - + prepare_prerelease_assets "$_tmpdir" _formula_file="${_tmpdir}/openshell.rb" _formula_url="${GITHUB_URL}/releases/download/${RELEASE_TAG}/openshell.rb" @@ -993,6 +1151,7 @@ install_macos_homebrew() { error "failed to download ${_formula_url}; the selected release may not include a Homebrew formula" } chmod 0644 "$_formula_file" + patch_prerelease_homebrew_formula_urls "$_formula_file" patch_homebrew_formula "$_formula_file" _tap_formula_file="$(homebrew_formula_path "$HOMEBREW_TAP" "$HOMEBREW_FORMULA_NAME")" @@ -1046,8 +1205,8 @@ main() { fi require_cmd curl - RELEASE_TAG="$(resolve_release_tag)" PLATFORM="$(detect_platform)" + RELEASE_TAG="$(resolve_release_tag)" TARGET_USER="$(target_user)" TARGET_UID="$(id -u "$TARGET_USER" 2>/dev/null || true)" diff --git a/python/openshell/release_formula_test.py b/python/openshell/release_formula_test.py index 671577d708..61fff150ac 100644 --- a/python/openshell/release_formula_test.py +++ b/python/openshell/release_formula_test.py @@ -10,7 +10,7 @@ from pathlib import Path -def test_generate_homebrew_formula_uses_tagged_macos_driver_asset_without_default_driver( +def test_generate_homebrew_formula_uses_channel_urls_and_exact_version( tmp_path: Path, ) -> None: release_dir = tmp_path / "release" @@ -42,7 +42,7 @@ def test_generate_homebrew_formula_uses_tagged_macos_driver_asset_without_defaul str(repo_root / "tasks/scripts/release.py"), "generate-homebrew-formula", "--release-tag", - "v0.0.10", + "v0.1.0-pre.3", "--release-dir", str(release_dir), "--output", @@ -54,12 +54,13 @@ def test_generate_homebrew_formula_uses_tagged_macos_driver_asset_without_defaul formula = output.read_text(encoding="utf-8") assert ( "https://github.com/NVIDIA/OpenShell/releases/download/" - "v0.0.10/openshell-driver-vm-aarch64-apple-darwin.tar.gz" + "v0.1.0-pre.3/openshell-driver-vm-aarch64-apple-darwin.tar.gz" ) in formula + assert 'version "0.1.0-pre.3"' in formula assert 'sha256 "' + "b" * 64 + '"' in formula assert ( "https://github.com/NVIDIA/OpenShell/releases/download/" - "v0.0.10/openshell-prover-aarch64-apple-darwin.tar.gz" + "v0.1.0-pre.3/openshell-prover-aarch64-apple-darwin.tar.gz" ) in formula assert 'sha256 "' + "e" * 64 + '"' in formula assert 'resource("openshell-prover").stage' in formula diff --git a/tasks/scripts/test-install-sh.sh b/tasks/scripts/test-install-sh.sh index b9d5f980ff..220fbb43d4 100755 --- a/tasks/scripts/test-install-sh.sh +++ b/tasks/scripts/test-install-sh.sh @@ -121,4 +121,131 @@ if [ "$(find_rpm_asset "${tmpdir}/checksums" x86_64 openshell-prover)" != "opens exit 1 fi +mock_gh_log="${tmpdir}/gh.log" +PLATFORM=linux +linux_package_method() { + printf 'deb\n' +} +uname() { + case "${1:-}" in + -m) printf 'x86_64\n' ;; + *) command uname "$@" ;; + esac +} +gh() { + printf '%s\n' "$*" >>"$mock_gh_log" + case "$1:$2" in + auth:status) + return 0 + ;; + api:*) + case "$*" in + *"?name="*) printf '123456\n' ;; + *"actions/workflows/release-tag.yml/runs?status=success"*) + printf '%s\n' 100 101 + ;; + *) + if [ "${MOCK_NO_PRERELEASE:-0}" != "1" ]; then + printf '%b\n' \ + '100\topenshell-v0.1.0-pre.9-linux-amd64-deb' \ + '101\topenshell-v1.0.0-pre.2-linux-amd64-deb' \ + '101\topenshell-v1.0.0-pre.1-macos-arm64' \ + '101\topenshell-v0.2.0-pre.10-linux-aarch64-rpm' \ + '999\topenshell-v2.0.0-pre.1-linux-amd64-deb' + fi + ;; + esac + ;; + run:download) + while [ "$#" -gt 0 ]; do + if [ "$1" = "--dir" ]; then + shift + mkdir -p "$1" + printf 'checksums\n' >"$1/$CHECKSUMS_NAME" + return 0 + fi + shift + done + return 1 + ;; + *) return 1 ;; + esac +} + +resolved_prerelease="$(OPENSHELL_VERSION=pre resolve_release_tag)" +if [ "$resolved_prerelease" != "v1.0.0-pre.2" ]; then + echo "FAIL: pre alias resolved to ${resolved_prerelease}, expected v1.0.0-pre.2" >&2 + exit 1 +fi +if ! grep -Fq 'actions/workflows/release-tag.yml/runs?status=success' "$mock_gh_log"; then + echo "FAIL: pre alias did not query successful Release Tag workflow runs" >&2 + cat "$mock_gh_log" >&2 + exit 1 +fi +if ! grep -Fq 'select(.status == "completed" and .conclusion == "success")' "$mock_gh_log"; then + echo "FAIL: pre alias did not require completed successful workflow runs" >&2 + cat "$mock_gh_log" >&2 + exit 1 +fi + +if (MOCK_NO_PRERELEASE=1 OPENSHELL_VERSION=pre resolve_release_tag) >"$out" 2>"$err"; then + echo "FAIL: pre alias should fail when no unexpired prerelease artifacts exist" >&2 + exit 1 +fi +if ! grep -Fq 'no unexpired prerelease artifacts found' "$err"; then + echo "FAIL: missing prerelease resolution failure was not explained" >&2 + cat "$err" >&2 + exit 1 +fi + +RELEASE_TAG=v0.1.0-pre.9 +prerelease_tmp="${tmpdir}/prerelease" +prepare_prerelease_assets "$prerelease_tmp" +if [ "$RELEASE_ASSET_DIR" != "${prerelease_tmp}/release" ]; then + echo "FAIL: prerelease artifact directory was not recorded" >&2 + exit 1 +fi +if ! grep -Fq 'select(.expired == false)' "$mock_gh_log"; then + echo "FAIL: prerelease lookup did not filter expired artifacts" >&2 + cat "$mock_gh_log" >&2 + exit 1 +fi +if ! grep -Fq 'actions/artifacts?name=openshell-v0.1.0-pre.9-linux-amd64-deb' "$mock_gh_log"; then + echo "FAIL: prerelease lookup did not select the current platform artifact" >&2 + cat "$mock_gh_log" >&2 + exit 1 +fi +if ! grep -Fq 'run download 123456 --repo NVIDIA/OpenShell --name openshell-v0.1.0-pre.9-linux-amd64-deb' "$mock_gh_log"; then + echo "FAIL: prerelease download did not select the current platform artifact" >&2 + cat "$mock_gh_log" >&2 + exit 1 +fi + +downloaded_checksum="${tmpdir}/downloaded-checksums.txt" +download_release_asset "$RELEASE_TAG" "$CHECKSUMS_NAME" "$downloaded_checksum" +if [ "$(cat "$downloaded_checksum")" != "checksums" ]; then + echo "FAIL: prerelease checksum was not copied from the platform artifact" >&2 + exit 1 +fi + +for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do + : >"${RELEASE_ASSET_DIR}/${asset}" +done +prerelease_formula="${tmpdir}/openshell.rb" +printf '%s\n' \ + " url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_CLI_ASSET}\"" \ + " url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_GATEWAY_ASSET}\"" \ + " url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_DRIVER_VM_ASSET}\"" \ + " url \"${GITHUB_URL}/releases/download/${RELEASE_TAG}/${HOMEBREW_PROVER_ASSET}\"" \ + >"$prerelease_formula" +patch_prerelease_homebrew_formula_urls "$prerelease_formula" +for asset in "$HOMEBREW_CLI_ASSET" "$HOMEBREW_GATEWAY_ASSET" "$HOMEBREW_DRIVER_VM_ASSET" "$HOMEBREW_PROVER_ASSET"; do + if ! grep -Fq "file://${RELEASE_ASSET_DIR}/${asset}" "$prerelease_formula"; then + echo "FAIL: prerelease formula did not use local asset ${asset}" >&2 + exit 1 + fi +done + +unset -f gh uname linux_package_method + echo "install.sh focused tests passed"