Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions crates/openshell-cli/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ use openshell_core::proto::{
GetSandboxPolicyStatusRequest, GetSandboxRequest, HealthRequest, ListProvidersRequest,
ListSandboxPoliciesRequest, ListSandboxesRequest, PolicyStatus, Provider,
RejectDraftChunkRequest, Sandbox, SandboxPhase, SandboxPolicy, SandboxSpec, SandboxTemplate,
SetClusterInferenceRequest, SettingScope, SettingValue, UpdateProviderRequest,
UpdateSettingsRequest, WatchSandboxRequest, setting_value,
SetClusterInferenceRequest, SettingScope, SettingValue, UpdateConfigRequest,
UpdateProviderRequest, WatchSandboxRequest, setting_value,
};
use openshell_core::settings::{self, SettingValueKind};
use openshell_providers::{
Expand Down Expand Up @@ -3906,7 +3906,7 @@ pub async fn sandbox_policy_set_global(

let mut client = grpc_client(server, tls).await?;
let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: String::new(),
policy: Some(policy),
setting_key: String::new(),
Expand Down Expand Up @@ -4105,7 +4105,7 @@ pub async fn gateway_setting_set(

let mut client = grpc_client(server, tls).await?;
let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: String::new(),
policy: None,
setting_key: key.to_string(),
Expand Down Expand Up @@ -4138,7 +4138,7 @@ pub async fn sandbox_setting_set(

let mut client = grpc_client(server, tls).await?;
let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: name.to_string(),
policy: None,
setting_key: key.to_string(),
Expand Down Expand Up @@ -4171,7 +4171,7 @@ pub async fn gateway_setting_delete(

let mut client = grpc_client(server, tls).await?;
let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: String::new(),
policy: None,
setting_key: key.to_string(),
Expand Down Expand Up @@ -4204,7 +4204,7 @@ pub async fn sandbox_setting_delete(
) -> Result<()> {
let mut client = grpc_client(server, tls).await?;
let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: name.to_string(),
policy: None,
setting_key: key.to_string(),
Expand Down Expand Up @@ -4261,7 +4261,7 @@ pub async fn sandbox_policy_set(
.map_or(0, |r| r.version);

let response = client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: name.to_string(),
policy: Some(policy),
setting_key: String::new(),
Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-cli/tests/ensure_providers_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ impl OpenShell for TestOpenShell {
)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-cli/tests/mtls_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ impl OpenShell for TestOpenShell {
)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-cli/tests/provider_commands_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ impl OpenShell for TestOpenShell {
)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ impl OpenShell for TestOpenShell {
)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ impl OpenShell for TestOpenShell {
)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
4 changes: 2 additions & 2 deletions crates/openshell-sandbox/src/grpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use miette::{IntoDiagnostic, Result, WrapErr};
use openshell_core::proto::{
DenialSummary, GetInferenceBundleRequest, GetInferenceBundleResponse, GetSandboxConfigRequest,
GetSandboxProviderEnvironmentRequest, PolicySource, PolicyStatus, ReportPolicyStatusRequest,
SandboxPolicy as ProtoSandboxPolicy, SubmitPolicyAnalysisRequest, UpdateSettingsRequest,
SandboxPolicy as ProtoSandboxPolicy, SubmitPolicyAnalysisRequest, UpdateConfigRequest,
inference_client::InferenceClient, open_shell_client::OpenShellClient,
};
use tonic::transport::{Certificate, Channel, ClientTlsConfig, Endpoint, Identity};
Expand Down Expand Up @@ -126,7 +126,7 @@ async fn sync_policy_with_client(
policy: &ProtoSandboxPolicy,
) -> Result<()> {
client
.update_settings(UpdateSettingsRequest {
.update_config(UpdateConfigRequest {
name: sandbox.to_string(),
policy: Some(policy.clone()),
setting_key: String::new(),
Expand Down
30 changes: 15 additions & 15 deletions crates/openshell-server/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use openshell_core::proto::{
RevokeSshSessionRequest, RevokeSshSessionResponse, SandboxLogLine, SandboxPolicyRevision,
SandboxResponse, SandboxStreamEvent, ServiceStatus, SettingScope, SettingValue, SshSession,
SubmitPolicyAnalysisRequest, SubmitPolicyAnalysisResponse, UndoDraftChunkRequest,
UndoDraftChunkResponse, UpdateProviderRequest, UpdateSettingsRequest, UpdateSettingsResponse,
UndoDraftChunkResponse, UpdateConfigRequest, UpdateConfigResponse, UpdateProviderRequest,
WatchSandboxRequest, open_shell_server::OpenShell,
};
use openshell_core::proto::{
Expand Down Expand Up @@ -1086,10 +1086,10 @@ impl OpenShell for OpenShellService {
// Policy update handlers
// -------------------------------------------------------------------

async fn update_settings(
async fn update_config(
&self,
request: Request<UpdateSettingsRequest>,
) -> Result<Response<UpdateSettingsResponse>, Status> {
request: Request<UpdateConfigRequest>,
) -> Result<Response<UpdateConfigResponse>, Status> {
let req = request.into_inner();
let key = req.setting_key.trim();
let has_policy = req.policy.is_some();
Expand Down Expand Up @@ -1158,7 +1158,7 @@ impl OpenShell for OpenShellService {
save_global_settings(self.state.store.as_ref(), &global_settings)
.await?;
}
return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: u32::try_from(current.version).unwrap_or(0),
policy_hash: hash,
settings_revision: global_settings.revision,
Expand Down Expand Up @@ -1221,7 +1221,7 @@ impl OpenShell for OpenShellService {
save_global_settings(self.state.store.as_ref(), &global_settings).await?;
}

return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: u32::try_from(next_version).unwrap_or(0),
policy_hash: hash,
settings_revision: global_settings.revision,
Expand Down Expand Up @@ -1273,7 +1273,7 @@ impl OpenShell for OpenShellService {
save_global_settings(self.state.store.as_ref(), &global_settings).await?;
}

return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: 0,
policy_hash: String::new(),
settings_revision: global_settings.revision,
Expand Down Expand Up @@ -1334,7 +1334,7 @@ impl OpenShell for OpenShellService {
.await?;
}

return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: 0,
policy_hash: String::new(),
settings_revision: sandbox_settings.revision,
Expand Down Expand Up @@ -1368,7 +1368,7 @@ impl OpenShell for OpenShellService {
.await?;
}

return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: 0,
policy_hash: String::new(),
settings_revision: sandbox_settings.revision,
Expand Down Expand Up @@ -1424,7 +1424,7 @@ impl OpenShell for OpenShellService {
.map_err(|e| Status::internal(format!("backfill spec.policy failed: {e}")))?;
info!(
sandbox_id = %sandbox_id,
"UpdateSettings: backfilled spec.policy from sandbox-discovered policy"
"UpdateConfig: backfilled spec.policy from sandbox-discovered policy"
);
}

Expand All @@ -1443,7 +1443,7 @@ impl OpenShell for OpenShellService {
if let Some(ref current) = latest
&& current.policy_hash == hash
{
return Ok(Response::new(UpdateSettingsResponse {
return Ok(Response::new(UpdateConfigResponse {
version: u32::try_from(current.version).unwrap_or(0),
policy_hash: hash,
settings_revision: 0,
Expand Down Expand Up @@ -1474,10 +1474,10 @@ impl OpenShell for OpenShellService {
sandbox_id = %sandbox_id,
version = next_version,
policy_hash = %hash,
"UpdateSettings: new policy version persisted"
"UpdateConfig: new policy version persisted"
);

Ok(Response::new(UpdateSettingsResponse {
Ok(Response::new(UpdateConfigResponse {
version: u32::try_from(next_version).unwrap_or(0),
policy_hash: hash,
settings_revision: 0,
Expand Down Expand Up @@ -2474,7 +2474,7 @@ fn draft_chunk_record_to_proto(record: &DraftChunkRecord) -> Result<PolicyChunk,
/// Merge a draft chunk's proposed rule into the current active sandbox policy.
///
/// Returns `(new_version, policy_hash)`. This reuses the same persistence
/// pattern as `update_settings`: compute hash, check for no-op,
/// pattern as `update_config`: compute hash, check for no-op,
/// persist a new revision, supersede older versions, and notify watchers.
/// Maximum number of optimistic retry attempts for policy version conflicts.
const MERGE_RETRY_LIMIT: usize = 5;
Expand Down Expand Up @@ -4908,7 +4908,7 @@ mod tests {
};
store.put_message(&sandbox).await.unwrap();

// Simulate what update_settings does when spec.policy is None:
// Simulate what update_config does when spec.policy is None:
// backfill spec.policy with the new policy.
let new_policy = ProtoSandboxPolicy {
version: 1,
Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-server/tests/auth_endpoint_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ impl openshell_core::proto::open_shell_server::OpenShell for TestOpenShell {
))
}

async fn update_settings(
async fn update_config(
&self,
_: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<tonic::Response<openshell_core::proto::UpdateSettingsResponse>, tonic::Status> {
_: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<tonic::Response<openshell_core::proto::UpdateConfigResponse>, tonic::Status> {
Err(tonic::Status::unimplemented("test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-server/tests/edge_tunnel_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ impl OpenShell for TestOpenShell {
Ok(Response::new(ReceiverStream::new(rx)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-server/tests/multiplex_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ impl OpenShell for TestOpenShell {
Ok(Response::new(ReceiverStream::new(rx)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-server/tests/multiplex_tls_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ impl OpenShell for TestOpenShell {
Ok(Response::new(ReceiverStream::new(rx)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
6 changes: 3 additions & 3 deletions crates/openshell-server/tests/ws_tunnel_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ impl OpenShell for TestOpenShell {
Ok(Response::new(ReceiverStream::new(rx)))
}

async fn update_settings(
async fn update_config(
&self,
_request: tonic::Request<openshell_core::proto::UpdateSettingsRequest>,
) -> Result<Response<openshell_core::proto::UpdateSettingsResponse>, Status> {
_request: tonic::Request<openshell_core::proto::UpdateConfigRequest>,
) -> Result<Response<openshell_core::proto::UpdateConfigResponse>, Status> {
Err(Status::unimplemented("not implemented in test"))
}

Expand Down
Loading
Loading