An open-source, faster Devin alternative
TypeScript
secret store refresh wip
Brian Reardon4f444db7bb13
diff --git a/internal/api/projects.go b/internal/api/projects.goindex 0525a0e1..55cc725d 100644--- a/internal/api/projects.go+++ b/internal/api/projects.go@@ -1,13 +1,20 @@package apiimport (+ "context"+ "fmt"+ "log""net/http""strings"+ "sync"+ "time""github.com/google/uuid""github.com/labstack/echo/v4""github.com/opensandbox/opensandbox/internal/auth"+ "github.com/opensandbox/opensandbox/internal/db"+ pb "github.com/opensandbox/opensandbox/proto/worker")// ── Secret Stores ─────────────────────────────────────────────────────────────@@ -182,7 +189,27 @@ func (s *Server) setSecretEntry(c echo.Context) error {if err := s.store.SetSecretEntry(c.Request().Context(), storeID, name, []byte(req.Value), req.AllowedHosts); err != nil {return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})}- return c.JSON(http.StatusOK, map[string]string{"name": name, "status": "set"})++ // Fan the new value out to running sandboxes that resolve envs from this+ // store. The proxy on each affected worker updates the value its sealed+ // token resolves to — the sandbox env keeps the same `osb_sealed_xxx`+ // string, so no restart, no env re-injection, and no agent involvement+ // inside the guest. Synchronous: PUT returns only after every reachable+ // affected worker has confirmed (or hit the timeout). Per-sandbox failures+ // are logged + included in the response but don't fail the whole call —+ // the DB write is the source of truth and fresh values will propagate+ // on the next sandbox handoff (wake, fork, migrate).+ refreshed, refreshErrs := s.fanoutSecretRefresh(c.Request().Context(), storeID, name, req.Value)++ resp := map[string]any{+ "name": name,+ "status": "set",+ "refreshed": refreshed,+ }+ if len(refreshErrs) > 0 {+ resp["refreshErrors"] = refreshErrs+ }+ return c.JSON(http.StatusOK, resp)}func (s *Server) deleteSecretEntry(c echo.Context) error {@@ -234,3 +261,117 @@ func (s *Server) listSecretEntries(c echo.Context) error {}return c.JSON(http.StatusOK, entries)}++// secretRefreshTimeout is the per-call deadline for the worker fan-out. Picked+// to comfortably exceed the worst-case gRPC RTT to a healthy worker (~1s) plus+// migration windows where source/destination both need a push. PUT /secrets+// returns within this bound regardless of how many sandboxes are affected.+const secretRefreshTimeout = 15 * time.Second++// fanoutSecretRefresh tells every worker hosting a sandbox that uses this+// SecretStore to update its proxy session's value for `name` to `newValue`.+// Synchronous: caller blocks until all in-flight RPCs complete or hit the+// timeout. Returns the count of sandboxes successfully refreshed and a slice+// of human-readable per-sandbox failures.+//+// Migration awareness: if a sandbox is mid-migration (`migrating_to_worker`+// non-empty), the update is pushed to BOTH source and destination workers in+// parallel. The "winner" depends on which worker's gRPC call lands last; both+// are correct because the proxy session on the destination is re-registered+// during PrepareIncomingMigration, which means by the time we're pushing+// updates the destination has a session to update. Idempotent on either side+// — pushing to a worker that doesn't have a session for this sandbox returns+// updated=false (transient miss, logged but not fatal).+func (s *Server) fanoutSecretRefresh(parentCtx context.Context, storeID uuid.UUID, name, newValue string) (refreshed int, failures []string) {+ if s.store == nil || s.workerRegistry == nil {+ return 0, nil+ }++ // Use a separate context with our own timeout — the parent is the HTTP+ // request, which we don't want to bleed onto. Caller ultimately waits up+ // to secretRefreshTimeout regardless of the request's deadline.+ ctx, cancel := context.WithTimeout(context.Background(), secretRefreshTimeout)+ defer cancel()+ _ = parentCtx // not propagated; we want bounded fanout time++ targets, err := s.store.ListRunningSandboxesByStore(ctx, storeID)+ if err != nil {+ log.Printf("secret-refresh: list sandboxes for store %s failed: %v", storeID, err)+ failures = append(failures, fmt.Sprintf("list affected sandboxes: %v", err))+ return 0, failures+ }+ if len(targets) == 0 {+ return 0, nil+ }++ type result struct {+ sandboxID string+ ok bool+ err error+ }++ // Dedup: a sandbox mid-migration appears once but spawns 2 RPC calls+ // (source + destination). pushOne handles a single (sandboxID, workerID)+ // pair so we can reuse for both halves of the dual-push.+ pushOne := func(sandboxID, workerID string) result {+ client, err := s.workerRegistry.GetWorkerClient(workerID)+ if err != nil {+ return result{sandboxID: sandboxID, err: fmt.Errorf("worker %s unreachable: %w", workerID, err)}+ }+ callCtx, callCancel := context.WithTimeout(ctx, 5*time.Second)+ defer callCancel()+ resp, err := client.UpdateSandboxSecret(callCtx, &pb.UpdateSandboxSecretRequest{+ SandboxId: sandboxID,+ SecretName: name,+ Value: newValue,+ })+ if err != nil {+ return result{sandboxID: sandboxID, err: fmt.Errorf("worker %s rpc: %w", workerID, err)}+ }+ return result{sandboxID: sandboxID, ok: resp.Updated}+ }++ var wg sync.WaitGroup+ resultsCh := make(chan result, len(targets)*2)+ for _, t := range targets {+ wg.Add(1)+ go func(t db.SecretRefreshTarget) {+ defer wg.Done()+ // Always push to the source worker.+ resultsCh <- pushOne(t.SandboxID, t.WorkerID)+ // During an in-flight migration, also push to the destination+ // so the cutover doesn't leave it serving stale values.+ if t.MigratingToWorker != "" {+ resultsCh <- pushOne(t.SandboxID, t.MigratingToWorker)+ }+ }(t)+ }+ wg.Wait()+ close(resultsCh)++ // Roll up results. A sandbox is "refreshed" if at least one of its push+ // attempts (source or destination) returned updated=true. A failure on+ // only one side of a migration is logged but doesn't downgrade the+ // sandbox's refreshed status — the other side handled it.+ successBySandbox := make(map[string]bool, len(targets))+ for r := range resultsCh {+ if r.err != nil {+ log.Printf("secret-refresh: store=%s name=%s sandbox=%s: %v", storeID, name, r.sandboxID, r.err)+ failures = append(failures, fmt.Sprintf("%s: %v", r.sandboxID, r.err))+ continue+ }+ if r.ok {+ successBySandbox[r.sandboxID] = true+ }+ }+ for _, ok := range successBySandbox {+ if ok {+ refreshed+++ }+ }+ if refreshed > 0 {+ log.Printf("secret-refresh: store=%s name=%s refreshed=%d failures=%d", storeID, name, refreshed, len(failures))+ }+ return refreshed, failures+}+diff --git a/internal/db/secret_refresh.go b/internal/db/secret_refresh.gonew file mode 100644index 00000000..8d4271f6--- /dev/null+++ b/internal/db/secret_refresh.go@@ -0,0 +1,47 @@+package db++import (+ "context"+ "fmt"++ "github.com/google/uuid"+)++// SecretRefreshTarget is one running sandbox affected by a secret-store update.+// MigratingToWorker is empty when the sandbox is steady-state on WorkerID;+// non-empty during a migration in flight, in which case the refresh fanout+// must push to BOTH workers (source and destination) to avoid a window where+// one of them serves outbound HTTPS with the stale value after the cutover.+type SecretRefreshTarget struct {+ SandboxID string+ WorkerID string+ MigratingToWorker string+}++// ListRunningSandboxesByStore returns the running sandboxes that resolve their+// envs from the given SecretStore. Used by the secret-store-update flow to+// fanout UpdateSandboxSecret RPCs to the right workers.+//+// Filters: status='running' (no-op for stopped/hibernated; they'll get fresh+// values when the customer next wakes/recreates them).+func (s *Store) ListRunningSandboxesByStore(ctx context.Context, storeID uuid.UUID) ([]SecretRefreshTarget, error) {+ rows, err := s.pool.Query(ctx, `+ SELECT sandbox_id, worker_id, COALESCE(migrating_to_worker, '')+ FROM sandbox_sessions+ WHERE secret_store_id = $1 AND status = 'running'+ `, storeID)+ if err != nil {+ return nil, fmt.Errorf("list sandboxes by store %s: %w", storeID, err)+ }+ defer rows.Close()++ var out []SecretRefreshTarget+ for rows.Next() {+ var t SecretRefreshTarget+ if err := rows.Scan(&t.SandboxID, &t.WorkerID, &t.MigratingToWorker); err != nil {+ return nil, err+ }+ out = append(out, t)+ }+ return out, rows.Err()+}diff --git a/internal/firecracker/manager.go b/internal/firecracker/manager.goindex c2ebf1ce..536d4800 100644--- a/internal/firecracker/manager.go+++ b/internal/firecracker/manager.go@@ -82,7 +82,11 @@ type SecretsProxyIntegration interface {// GetSessionTokenHosts returns the per-token host restrictions for persisting during hibernate.GetSessionTokenHosts(guestIP string) map[string][]string// ReregisterSession re-creates a proxy session from a persisted token map (used on wake).- ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string)+ ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string, names map[string]string)+ // GetSessionNames returns the env-var-name → sealed-token index for persistence.+ GetSessionNames(guestIP string) map[string]string+ // UpdateSecretValue replaces the value the sealed token for secretName resolves to.+ UpdateSecretValue(sandboxID, secretName, newValue string) bool// CACertPEM returns the CA certificate PEM for injection into the VM trust store.CACertPEM() []byte}diff --git a/internal/qemu/manager.go b/internal/qemu/manager.goindex b1adc596..bb96b784 100644--- a/internal/qemu/manager.go+++ b/internal/qemu/manager.go@@ -143,7 +143,16 @@ type SecretsProxyIntegration interface {// GetSessionTokenHosts returns the per-token host restrictions for persisting during hibernate.GetSessionTokenHosts(guestIP string) map[string][]string// ReregisterSession re-creates a proxy session from a persisted token map (used on wake).- ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string)+ // names is the env-var-name → sealed-token index needed for refresh-by-name+ // (UpdateSecretValue) to keep working after a wake/migration.+ ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string, names map[string]string)+ // GetSessionNames returns the env-var-name → sealed-token map; persisted alongside+ // SealedTokens so refresh-by-name survives a handoff.+ GetSessionNames(guestIP string) map[string]string+ // UpdateSecretValue replaces the value the sealed token for secretName resolves+ // to, on the session for the given sandbox. Sealed token unchanged; the+ // next outbound HTTPS substitutes the new value. Returns true on success.+ UpdateSecretValue(sandboxID, secretName, newValue string) bool// CACertPEM returns the CA certificate PEM for injection into the VM trust store.CACertPEM() []byte}@@ -1931,6 +1940,18 @@ func (m *Manager) SetResourceLimits(ctx context.Context, sandboxID string, maxPireturn vm.agent.SetResourceLimits(ctx, maxPids, maxMemoryBytes, cpuMaxUsec, cpuPeriodUsec)}+// UpdateSandboxSecret refreshes the proxy session value for one secret name.+// Returns (true, nil) on success, (false, nil) if there's no session for the+// sandbox or the secret name isn't on the session — both treated as transient+// (e.g. mid-migration); the caller may log + move on. Returns an error only+// on hard failure (no proxy at all).+func (m *Manager) UpdateSandboxSecret(_ context.Context, sandboxID, secretName, value string) (bool, error) {+ if m.secretsProxy == nil {+ return false, fmt.Errorf("secrets proxy not configured on this worker")+ }+ return m.secretsProxy.UpdateSecretValue(sandboxID, secretName, value), nil+}+// TotalCommittedMemoryMB returns the sum of MemoryMB (base + virtio-mem) across all running VMs.// This represents the maximum host memory that could be consumed if all VMs use their full allocation.func (m *Manager) TotalCommittedMemoryMB() int {@@ -2632,7 +2653,7 @@ func (m *Manager) RestoreFromCheckpoint(ctx context.Context, sandboxID, checkpoi// Re-register secrets proxy session from checkpoint metadata.if m.secretsProxy != nil && len(cpMeta.SealedTokens) > 0 {- m.secretsProxy.ReregisterSession(sandboxID, netCfg.GuestIP, cpMeta.SealedTokens, cpMeta.EgressAllowlist, cpMeta.TokenHosts)+ m.secretsProxy.ReregisterSession(sandboxID, netCfg.GuestIP, cpMeta.SealedTokens, cpMeta.EgressAllowlist, cpMeta.TokenHosts, cpMeta.SealedNames)log.Printf("qemu: RestoreFromCheckpoint %s: re-registered secrets proxy session (%d tokens)", sandboxID, len(cpMeta.SealedTokens))}diff --git a/internal/qemu/snapshot.go b/internal/qemu/snapshot.goindex 803b232e..407d67e0 100644--- a/internal/qemu/snapshot.go+++ b/internal/qemu/snapshot.go@@ -36,6 +36,10 @@ type SnapshotMeta struct {GoldenVersion string `json:"goldenVersion,omitempty"`SnapshotedAt time.Time `json:"snapshotedAt,omitempty"`SealedTokens map[string]string `json:"sealedTokens,omitempty"`+ // SealedNames is the env-var-name → sealed-token index. Persisted alongside+ // SealedTokens so secret-store refresh-by-name (UpdateSecretValue) keeps+ // working after a wake or migration handoff.+ SealedNames map[string]string `json:"sealedNames,omitempty"`EgressAllowlist []string `json:"egressAllowlist,omitempty"`TokenHosts map[string][]string `json:"tokenHosts,omitempty"`}@@ -130,6 +134,7 @@ func (m *Manager) doHibernate(ctx context.Context, vm *VMInstance, checkpointSto// Persist secrets proxy state so wake can re-register the session.if m.secretsProxy != nil && vm.network != nil {meta.SealedTokens = m.secretsProxy.GetSessionTokens(vm.network.GuestIP)+ meta.SealedNames = m.secretsProxy.GetSessionNames(vm.network.GuestIP)meta.EgressAllowlist = m.secretsProxy.GetSessionAllowlist(vm.network.GuestIP)meta.TokenHosts = m.secretsProxy.GetSessionTokenHosts(vm.network.GuestIP)}@@ -488,7 +493,7 @@ func (m *Manager) doWake(ctx context.Context, sandboxID, checkpointKey string, c// Re-register secrets proxy session from persisted tokens.if m.secretsProxy != nil && len(meta.SealedTokens) > 0 {- m.secretsProxy.ReregisterSession(sandboxID, netCfg.GuestIP, meta.SealedTokens, meta.EgressAllowlist, meta.TokenHosts)+ m.secretsProxy.ReregisterSession(sandboxID, netCfg.GuestIP, meta.SealedTokens, meta.EgressAllowlist, meta.TokenHosts, meta.SealedNames)log.Printf("qemu: wake %s: re-registered secrets proxy session (%d tokens)", sandboxID, len(meta.SealedTokens))}diff --git a/internal/sandbox/interface.go b/internal/sandbox/interface.goindex a6525ade..e977bc81 100644--- a/internal/sandbox/interface.go+++ b/internal/sandbox/interface.go@@ -55,6 +55,13 @@ type Manager interface {// Resource limitsSetResourceLimits(ctx context.Context, sandboxID string, maxPids int32, maxMemoryBytes, cpuMaxUsec, cpuPeriodUsec int64) error+ // UpdateSandboxSecret refreshes the proxy session value for one secret name+ // (env var name) without changing the sealed token id seen by the sandbox.+ // Used by the secret-store-update flow to push new values to running+ // sandboxes. Returns (true, nil) on success; (false, nil) if no session+ // or no name match (transient miss e.g. mid-migration; caller logs).+ UpdateSandboxSecret(ctx context.Context, sandboxID, secretName, value string) (bool, error)+// MonitoringStats(ctx context.Context, sandboxID string) (*SandboxStats, error)HostPort(ctx context.Context, sandboxID string) (int, error)diff --git a/internal/secretsproxy/proxy.go b/internal/secretsproxy/proxy.goindex 652f86bb..e422fbed 100644--- a/internal/secretsproxy/proxy.go+++ b/internal/secretsproxy/proxy.go@@ -57,6 +57,7 @@ const (type Session struct {SandboxID stringSecrets map[string]string // "osb_sealed_xxx" → real value+ Names map[string]string // envVarName → "osb_sealed_xxx" — lets us update by name without re-sealingTokenHosts map[string][]string // sealed token → allowed hosts; nil/empty entry = all allowed hostsAllowlist []string // nil = all hosts allowed; supports "*." prefix wildcardsExpiresAt time.Time@@ -178,12 +179,26 @@ func (p *SecretsProxy) GetSessionTokenHosts(guestIP string) map[string][]stringreturn session.TokenHosts}+// GetSessionNames returns the env-var-name → sealed-token map for the given+// guest IP's session. Used to persist the name index across hibernate/wake+// and live migration so secret-refresh-by-name keeps working after a handoff.+func (p *SecretsProxy) GetSessionNames(guestIP string) map[string]string {+ p.mu.RLock()+ session := p.sessions[guestIP]+ p.mu.RUnlock()+ if session == nil {+ return nil+ }+ return session.Names+}+// ReregisterSession creates a new proxy session from a previously persisted token map.// Used on wake to restore the proxy session without re-generating tokens.-func (p *SecretsProxy) ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string) {+func (p *SecretsProxy) ReregisterSession(sandboxID, guestIP string, tokens map[string]string, allowlist []string, tokenHosts map[string][]string, names map[string]string) {session := &Session{SandboxID: sandboxID,Secrets: tokens,+ Names: names,TokenHosts: tokenHosts,Allowlist: allowlist,ExpiresAt: time.Now().Add(defaultSessionTTL),@@ -191,8 +206,38 @@ func (p *SecretsProxy) ReregisterSession(sandboxID, guestIP string, tokens map[sp.mu.Lock()p.sessions[guestIP] = sessionp.mu.Unlock()- log.Printf("secrets-proxy: re-registered session sandbox=%s ip=%s secrets=%d allowlist=%d tokenHosts=%d",- sandboxID, guestIP, len(tokens), len(allowlist), len(tokenHosts))+ log.Printf("secrets-proxy: re-registered session sandbox=%s ip=%s secrets=%d allowlist=%d tokenHosts=%d names=%d",+ sandboxID, guestIP, len(tokens), len(allowlist), len(tokenHosts), len(names))+}++// UpdateSecretValue replaces the value the sealed token for `secretName` resolves+// to, on the session for the given sandbox. The sealed token ID itself stays+// the same — sandbox env vars don't change, but the next outbound HTTPS that+// the proxy substitutes uses the new value.+//+// Returns true if the update landed (session found, name matched a known+// sealed token, value replaced). Returns false if there's no session for the+// sandbox or the name isn't in the session — caller can use this to log a+// stale/missed update.+func (p *SecretsProxy) UpdateSecretValue(sandboxID, secretName, newValue string) bool {+ p.mu.Lock()+ defer p.mu.Unlock()+ for _, session := range p.sessions {+ if session.SandboxID != sandboxID {+ continue+ }+ token, ok := session.Names[secretName]+ if !ok {+ return false+ }+ if session.Secrets == nil {+ session.Secrets = make(map[string]string, 1)+ }+ session.Secrets[token] = newValue+ log.Printf("secrets-proxy: updated value for sandbox=%s name=%s (token unchanged)", sandboxID, secretName)+ return true+ }+ return false}// CreateSealedEnvs generates sealed tokens for the given env vars, registers a@@ -239,9 +284,16 @@ func (p *SecretsProxy) CreateSealedEnvs(sandboxID, guestIP, gatewayIP string, pl// Only register a proxy session if there's actually something to substitute.if len(tokenMap) > 0 {+ // Build the env-var-name → sealed-token index. Required for+ // UpdateSecretValue (refresh-by-name without re-sealing).+ names := make(map[string]string, len(sealed))+ for envVar, token := range sealed {+ names[envVar] = token+ }p.RegisterSession(guestIP, &Session{SandboxID: sandboxID,Secrets: tokenMap,+ Names: names,TokenHosts: tokenHosts,Allowlist: allowlist,})diff --git a/internal/worker/grpc_server.go b/internal/worker/grpc_server.goindex d92a0867..5d44a6e2 100644--- a/internal/worker/grpc_server.go+++ b/internal/worker/grpc_server.go@@ -975,6 +975,17 @@ func (s *GRPCServer) SetSandboxLimits(ctx context.Context, req *pb.SetSandboxLimreturn &pb.SetSandboxLimitsResponse{}, nil}+func (s *GRPCServer) UpdateSandboxSecret(ctx context.Context, req *pb.UpdateSandboxSecretRequest) (*pb.UpdateSandboxSecretResponse, error) {+ if req.SandboxId == "" || req.SecretName == "" {+ return nil, fmt.Errorf("sandbox_id and secret_name required")+ }+ updated, err := s.manager.UpdateSandboxSecret(ctx, req.SandboxId, req.SecretName, req.Value)+ if err != nil {+ return nil, fmt.Errorf("update secret: %w", err)+ }+ return &pb.UpdateSandboxSecretResponse{Updated: updated}, nil+}+// SetMigrator sets the live migration handler (call after NewGRPCServer if the manager supports it).func (s *GRPCServer) SetMigrator(m LiveMigrator) {s.migrator = mdiff --git a/proto/worker/worker.pb.go b/proto/worker/worker.pb.goindex f78caf2c..f81d42d2 100644--- a/proto/worker/worker.pb.go+++ b/proto/worker/worker.pb.go@@ -3217,6 +3217,113 @@ func (x *PrepareMigrationIncomingResponse) GetHostPort() int32 {return 0}+type UpdateSandboxSecretRequest struct {+ state protoimpl.MessageState `protogen:"open.v1"`+ SandboxId string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"`+ SecretName string `protobuf:"bytes,2,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"` // env var name (the key in the secret store)+ Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // new plaintext value+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache+}++func (x *UpdateSandboxSecretRequest) Reset() {+ *x = UpdateSandboxSecretRequest{}+ mi := &file_proto_worker_worker_proto_msgTypes[54]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+}++func (x *UpdateSandboxSecretRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateSandboxSecretRequest) ProtoMessage() {}++func (x *UpdateSandboxSecretRequest) ProtoReflect() protoreflect.Message {+ mi := &file_proto_worker_worker_proto_msgTypes[54]+ 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 UpdateSandboxSecretRequest.ProtoReflect.Descriptor instead.+func (*UpdateSandboxSecretRequest) Descriptor() ([]byte, []int) {+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{54}+}++func (x *UpdateSandboxSecretRequest) GetSandboxId() string {+ if x != nil {+ return x.SandboxId+ }+ return ""+}++func (x *UpdateSandboxSecretRequest) GetSecretName() string {+ if x != nil {+ return x.SecretName+ }+ return ""+}++func (x *UpdateSandboxSecretRequest) GetValue() string {+ if x != nil {+ return x.Value+ }+ return ""+}++type UpdateSandboxSecretResponse struct {+ state protoimpl.MessageState `protogen:"open.v1"`+ // updated is false if the worker has no proxy session for this sandbox+ // or the secret_name isn't registered on the session. Caller logs ++ // surfaces; not necessarily a hard error (sandbox may be mid-migration).+ Updated bool `protobuf:"varint,1,opt,name=updated,proto3" json:"updated,omitempty"`+ unknownFields protoimpl.UnknownFields+ sizeCache protoimpl.SizeCache+}++func (x *UpdateSandboxSecretResponse) Reset() {+ *x = UpdateSandboxSecretResponse{}+ mi := &file_proto_worker_worker_proto_msgTypes[55]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+}++func (x *UpdateSandboxSecretResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateSandboxSecretResponse) ProtoMessage() {}++func (x *UpdateSandboxSecretResponse) ProtoReflect() protoreflect.Message {+ mi := &file_proto_worker_worker_proto_msgTypes[55]+ 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 UpdateSandboxSecretResponse.ProtoReflect.Descriptor instead.+func (*UpdateSandboxSecretResponse) Descriptor() ([]byte, []int) {+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{55}+}++func (x *UpdateSandboxSecretResponse) GetUpdated() bool {+ if x != nil {+ return x.Updated+ }+ return false+}+type LiveMigrateRequest struct {state protoimpl.MessageState `protogen:"open.v1"`SandboxId string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"`@@ -3227,7 +3334,7 @@ type LiveMigrateRequest struct {func (x *LiveMigrateRequest) Reset() {*x = LiveMigrateRequest{}- mi := &file_proto_worker_worker_proto_msgTypes[54]+ mi := &file_proto_worker_worker_proto_msgTypes[56]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3239,7 +3346,7 @@ func (x *LiveMigrateRequest) String() string {func (*LiveMigrateRequest) ProtoMessage() {}func (x *LiveMigrateRequest) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[54]+ mi := &file_proto_worker_worker_proto_msgTypes[56]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3252,7 +3359,7 @@ func (x *LiveMigrateRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use LiveMigrateRequest.ProtoReflect.Descriptor instead.func (*LiveMigrateRequest) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{54}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{56}}func (x *LiveMigrateRequest) GetSandboxId() string {@@ -3277,7 +3384,7 @@ type LiveMigrateResponse struct {func (x *LiveMigrateResponse) Reset() {*x = LiveMigrateResponse{}- mi := &file_proto_worker_worker_proto_msgTypes[55]+ mi := &file_proto_worker_worker_proto_msgTypes[57]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3289,7 +3396,7 @@ func (x *LiveMigrateResponse) String() string {func (*LiveMigrateResponse) ProtoMessage() {}func (x *LiveMigrateResponse) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[55]+ mi := &file_proto_worker_worker_proto_msgTypes[57]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3302,7 +3409,7 @@ func (x *LiveMigrateResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use LiveMigrateResponse.ProtoReflect.Descriptor instead.func (*LiveMigrateResponse) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{55}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{57}}type CompleteMigrationIncomingRequest struct {@@ -3314,7 +3421,7 @@ type CompleteMigrationIncomingRequest struct {func (x *CompleteMigrationIncomingRequest) Reset() {*x = CompleteMigrationIncomingRequest{}- mi := &file_proto_worker_worker_proto_msgTypes[56]+ mi := &file_proto_worker_worker_proto_msgTypes[58]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3326,7 +3433,7 @@ func (x *CompleteMigrationIncomingRequest) String() string {func (*CompleteMigrationIncomingRequest) ProtoMessage() {}func (x *CompleteMigrationIncomingRequest) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[56]+ mi := &file_proto_worker_worker_proto_msgTypes[58]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3339,7 +3446,7 @@ func (x *CompleteMigrationIncomingRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use CompleteMigrationIncomingRequest.ProtoReflect.Descriptor instead.func (*CompleteMigrationIncomingRequest) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{56}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{58}}func (x *CompleteMigrationIncomingRequest) GetSandboxId() string {@@ -3357,7 +3464,7 @@ type CompleteMigrationIncomingResponse struct {func (x *CompleteMigrationIncomingResponse) Reset() {*x = CompleteMigrationIncomingResponse{}- mi := &file_proto_worker_worker_proto_msgTypes[57]+ mi := &file_proto_worker_worker_proto_msgTypes[59]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3369,7 +3476,7 @@ func (x *CompleteMigrationIncomingResponse) String() string {func (*CompleteMigrationIncomingResponse) ProtoMessage() {}func (x *CompleteMigrationIncomingResponse) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[57]+ mi := &file_proto_worker_worker_proto_msgTypes[59]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3382,7 +3489,7 @@ func (x *CompleteMigrationIncomingResponse) ProtoReflect() protoreflect.Message// Deprecated: Use CompleteMigrationIncomingResponse.ProtoReflect.Descriptor instead.func (*CompleteMigrationIncomingResponse) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{57}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{59}}// Golden snapshot management@@ -3394,7 +3501,7 @@ type RebuildGoldenSnapshotRequest struct {func (x *RebuildGoldenSnapshotRequest) Reset() {*x = RebuildGoldenSnapshotRequest{}- mi := &file_proto_worker_worker_proto_msgTypes[58]+ mi := &file_proto_worker_worker_proto_msgTypes[60]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3406,7 +3513,7 @@ func (x *RebuildGoldenSnapshotRequest) String() string {func (*RebuildGoldenSnapshotRequest) ProtoMessage() {}func (x *RebuildGoldenSnapshotRequest) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[58]+ mi := &file_proto_worker_worker_proto_msgTypes[60]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3419,7 +3526,7 @@ func (x *RebuildGoldenSnapshotRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use RebuildGoldenSnapshotRequest.ProtoReflect.Descriptor instead.func (*RebuildGoldenSnapshotRequest) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{58}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{60}}type RebuildGoldenSnapshotResponse struct {@@ -3432,7 +3539,7 @@ type RebuildGoldenSnapshotResponse struct {func (x *RebuildGoldenSnapshotResponse) Reset() {*x = RebuildGoldenSnapshotResponse{}- mi := &file_proto_worker_worker_proto_msgTypes[59]+ mi := &file_proto_worker_worker_proto_msgTypes[61]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -3444,7 +3551,7 @@ func (x *RebuildGoldenSnapshotResponse) String() string {func (*RebuildGoldenSnapshotResponse) ProtoMessage() {}func (x *RebuildGoldenSnapshotResponse) ProtoReflect() protoreflect.Message {- mi := &file_proto_worker_worker_proto_msgTypes[59]+ mi := &file_proto_worker_worker_proto_msgTypes[61]if x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -3457,7 +3564,7 @@ func (x *RebuildGoldenSnapshotResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use RebuildGoldenSnapshotResponse.ProtoReflect.Descriptor instead.func (*RebuildGoldenSnapshotResponse) Descriptor() ([]byte, []int) {- return file_proto_worker_worker_proto_rawDescGZIP(), []int{59}+ return file_proto_worker_worker_proto_rawDescGZIP(), []int{61}}func (x *RebuildGoldenSnapshotResponse) GetOldVersion() string {@@ -3745,7 +3852,15 @@ const file_proto_worker_worker_proto_rawDesc = "" +"\x15source_golden_version\x18\f \x01(\tR\x13sourceGoldenVersion\"d\n" +" PrepareMigrationIncomingResponse\x12#\n" +"\rincoming_addr\x18\x01 \x01(\tR\fincomingAddr\x12\x1b\n" +- "\thost_port\x18\x02 \x01(\x05R\bhostPort\"X\n" ++ "\thost_port\x18\x02 \x01(\x05R\bhostPort\"r\n" ++ "\x1aUpdateSandboxSecretRequest\x12\x1d\n" ++ "\n" ++ "sandbox_id\x18\x01 \x01(\tR\tsandboxId\x12\x1f\n" ++ "\vsecret_name\x18\x02 \x01(\tR\n" ++ "secretName\x12\x14\n" ++ "\x05value\x18\x03 \x01(\tR\x05value\"7\n" ++ "\x1bUpdateSandboxSecretResponse\x12\x18\n" ++ "\aupdated\x18\x01 \x01(\bR\aupdated\"X\n" +"\x12LiveMigrateRequest\x12\x1d\n" +"\n" +"sandbox_id\x18\x01 \x01(\tR\tsandboxId\x12#\n" +@@ -3760,7 +3875,7 @@ const file_proto_worker_worker_proto_rawDesc = "" +"\vold_version\x18\x01 \x01(\tR\n" +"oldVersion\x12\x1f\n" +"\vnew_version\x18\x02 \x01(\tR\n" +- "newVersion2\xab\x12\n" ++ "newVersion2\x8b\x13\n" +"\rSandboxWorker\x12L\n" +"\rCreateSandbox\x12\x1c.worker.CreateSandboxRequest\x1a\x1d.worker.CreateSandboxResponse\x12O\n" +"\x0eDestroySandbox\x12\x1d.worker.DestroySandboxRequest\x1a\x1e.worker.DestroySandboxResponse\x12C\n" +@@ -3786,7 +3901,8 @@ const file_proto_worker_worker_proto_rawDesc = "" +"\x11RestoreCheckpoint\x12 .worker.RestoreCheckpointRequest\x1a!.worker.RestoreCheckpointResponse\x12L\n" +"\rBuildTemplate\x12\x1c.worker.BuildTemplateRequest\x1a\x1d.worker.BuildTemplateResponse\x12R\n" +"\x0fGetSandboxStats\x12\x1e.worker.GetSandboxStatsRequest\x1a\x1f.worker.GetSandboxStatsResponse\x12U\n" +- "\x10SetSandboxLimits\x12\x1f.worker.SetSandboxLimitsRequest\x1a .worker.SetSandboxLimitsResponse\x12L\n" ++ "\x10SetSandboxLimits\x12\x1f.worker.SetSandboxLimitsRequest\x1a .worker.SetSandboxLimitsResponse\x12^\n" ++ "\x13UpdateSandboxSecret\x12\".worker.UpdateSandboxSecretRequest\x1a#.worker.UpdateSandboxSecretResponse\x12L\n" +"\rPreCopyDrives\x12\x1c.worker.PreCopyDrivesRequest\x1a\x1d.worker.PreCopyDrivesResponse\x12m\n" +"\x18PrepareMigrationIncoming\x12'.worker.PrepareMigrationIncomingRequest\x1a(.worker.PrepareMigrationIncomingResponse\x12F\n" +"\vLiveMigrate\x12\x1a.worker.LiveMigrateRequest\x1a\x1b.worker.LiveMigrateResponse\x12p\n" +@@ -3806,7 +3922,7 @@ func file_proto_worker_worker_proto_rawDescGZIP() []byte {}var file_proto_worker_worker_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_proto_worker_worker_proto_msgTypes = make([]protoimpl.MessageInfo, 65)+var file_proto_worker_worker_proto_msgTypes = make([]protoimpl.MessageInfo, 67)var file_proto_worker_worker_proto_goTypes = []any{(ExecOutputChunk_Stream)(0), // 0: worker.ExecOutputChunk.Stream(*CreateSandboxRequest)(nil), // 1: worker.CreateSandboxRequest@@ -3863,28 +3979,30 @@ var file_proto_worker_worker_proto_goTypes = []any{(*PreCopyDrivesResponse)(nil), // 52: worker.PreCopyDrivesResponse(*PrepareMigrationIncomingRequest)(nil), // 53: worker.PrepareMigrationIncomingRequest(*PrepareMigrationIncomingResponse)(nil), // 54: worker.PrepareMigrationIncomingResponse- (*LiveMigrateRequest)(nil), // 55: worker.LiveMigrateRequest- (*LiveMigrateResponse)(nil), // 56: worker.LiveMigrateResponse- (*CompleteMigrationIncomingRequest)(nil), // 57: worker.CompleteMigrationIncomingRequest- (*CompleteMigrationIncomingResponse)(nil), // 58: worker.CompleteMigrationIncomingResponse- (*RebuildGoldenSnapshotRequest)(nil), // 59: worker.RebuildGoldenSnapshotRequest- (*RebuildGoldenSnapshotResponse)(nil), // 60: worker.RebuildGoldenSnapshotResponse- nil, // 61: worker.CreateSandboxRequest.EnvsEntry- nil, // 62: worker.CreateSandboxRequest.SecretAllowedHostsEntry- nil, // 63: worker.CreateSandboxRequest.SecretEnvsEntry- nil, // 64: worker.ExecCommandRequest.EnvsEntry- nil, // 65: worker.ExecSessionCreateRequest.EnvsEntry+ (*UpdateSandboxSecretRequest)(nil), // 55: worker.UpdateSandboxSecretRequest+ (*UpdateSandboxSecretResponse)(nil), // 56: worker.UpdateSandboxSecretResponse+ (*LiveMigrateRequest)(nil), // 57: worker.LiveMigrateRequest+ (*LiveMigrateResponse)(nil), // 58: worker.LiveMigrateResponse+ (*CompleteMigrationIncomingRequest)(nil), // 59: worker.CompleteMigrationIncomingRequest+ (*CompleteMigrationIncomingResponse)(nil), // 60: worker.CompleteMigrationIncomingResponse+ (*RebuildGoldenSnapshotRequest)(nil), // 61: worker.RebuildGoldenSnapshotRequest+ (*RebuildGoldenSnapshotResponse)(nil), // 62: worker.RebuildGoldenSnapshotResponse+ nil, // 63: worker.CreateSandboxRequest.EnvsEntry+ nil, // 64: worker.CreateSandboxRequest.SecretAllowedHostsEntry+ nil, // 65: worker.CreateSandboxRequest.SecretEnvsEntry+ nil, // 66: worker.ExecCommandRequest.EnvsEntry+ nil, // 67: worker.ExecSessionCreateRequest.EnvsEntry}var file_proto_worker_worker_proto_depIdxs = []int32{- 61, // 0: worker.CreateSandboxRequest.envs:type_name -> worker.CreateSandboxRequest.EnvsEntry- 62, // 1: worker.CreateSandboxRequest.secret_allowed_hosts:type_name -> worker.CreateSandboxRequest.SecretAllowedHostsEntry- 63, // 2: worker.CreateSandboxRequest.secret_envs:type_name -> worker.CreateSandboxRequest.SecretEnvsEntry+ 63, // 0: worker.CreateSandboxRequest.envs:type_name -> worker.CreateSandboxRequest.EnvsEntry+ 64, // 1: worker.CreateSandboxRequest.secret_allowed_hosts:type_name -> worker.CreateSandboxRequest.SecretAllowedHostsEntry+ 65, // 2: worker.CreateSandboxRequest.secret_envs:type_name -> worker.CreateSandboxRequest.SecretEnvsEntry10, // 3: worker.ListSandboxesResponse.sandboxes:type_name -> worker.GetSandboxResponse- 64, // 4: worker.ExecCommandRequest.envs:type_name -> worker.ExecCommandRequest.EnvsEntry+ 66, // 4: worker.ExecCommandRequest.envs:type_name -> worker.ExecCommandRequest.EnvsEntry0, // 5: worker.ExecOutputChunk.stream:type_name -> worker.ExecOutputChunk.Stream21, // 6: worker.ListDirResponse.entries:type_name -> worker.DirEntry26, // 7: worker.PTYInput.resize:type_name -> worker.PTYResize- 65, // 8: worker.ExecSessionCreateRequest.envs:type_name -> worker.ExecSessionCreateRequest.EnvsEntry+ 67, // 8: worker.ExecSessionCreateRequest.envs:type_name -> worker.ExecSessionCreateRequest.EnvsEntry40, // 9: worker.ExecSessionListResponse.sessions:type_name -> worker.ExecSessionInfoEntry1, // 10: worker.SandboxWorker.CreateSandbox:input_type -> worker.CreateSandboxRequest3, // 11: worker.SandboxWorker.DestroySandbox:input_type -> worker.DestroySandboxRequest@@ -3910,42 +4028,44 @@ var file_proto_worker_worker_proto_depIdxs = []int32{34, // 31: worker.SandboxWorker.BuildTemplate:input_type -> worker.BuildTemplateRequest43, // 32: worker.SandboxWorker.GetSandboxStats:input_type -> worker.GetSandboxStatsRequest49, // 33: worker.SandboxWorker.SetSandboxLimits:input_type -> worker.SetSandboxLimitsRequest- 51, // 34: worker.SandboxWorker.PreCopyDrives:input_type -> worker.PreCopyDrivesRequest- 53, // 35: worker.SandboxWorker.PrepareMigrationIncoming:input_type -> worker.PrepareMigrationIncomingRequest- 55, // 36: worker.SandboxWorker.LiveMigrate:input_type -> worker.LiveMigrateRequest- 57, // 37: worker.SandboxWorker.CompleteMigrationIncoming:input_type -> worker.CompleteMigrationIncomingRequest- 59, // 38: worker.SandboxWorker.RebuildGoldenSnapshot:input_type -> worker.RebuildGoldenSnapshotRequest- 2, // 39: worker.SandboxWorker.CreateSandbox:output_type -> worker.CreateSandboxResponse- 4, // 40: worker.SandboxWorker.DestroySandbox:output_type -> worker.DestroySandboxResponse- 10, // 41: worker.SandboxWorker.GetSandbox:output_type -> worker.GetSandboxResponse- 12, // 42: worker.SandboxWorker.ListSandboxes:output_type -> worker.ListSandboxesResponse- 14, // 43: worker.SandboxWorker.ExecCommand:output_type -> worker.ExecCommandResponse- 15, // 44: worker.SandboxWorker.ExecCommandStream:output_type -> worker.ExecOutputChunk- 17, // 45: worker.SandboxWorker.ReadFile:output_type -> worker.ReadFileResponse- 19, // 46: worker.SandboxWorker.WriteFile:output_type -> worker.WriteFileResponse- 22, // 47: worker.SandboxWorker.ListDir:output_type -> worker.ListDirResponse- 24, // 48: worker.SandboxWorker.CreatePTY:output_type -> worker.CreatePTYResponse- 27, // 49: worker.SandboxWorker.PTYStream:output_type -> worker.PTYOutput- 37, // 50: worker.SandboxWorker.ExecSessionCreate:output_type -> worker.ExecSessionCreateResponse- 39, // 51: worker.SandboxWorker.ExecSessionList:output_type -> worker.ExecSessionListResponse- 42, // 52: worker.SandboxWorker.ExecSessionKill:output_type -> worker.ExecSessionKillResponse- 29, // 53: worker.SandboxWorker.HibernateSandbox:output_type -> worker.HibernateSandboxResponse- 31, // 54: worker.SandboxWorker.WakeSandbox:output_type -> worker.WakeSandboxResponse- 6, // 55: worker.SandboxWorker.RebootSandbox:output_type -> worker.RebootSandboxResponse- 8, // 56: worker.SandboxWorker.PowerCycleSandbox:output_type -> worker.PowerCycleSandboxResponse- 33, // 57: worker.SandboxWorker.SaveAsTemplate:output_type -> worker.SaveAsTemplateResponse- 46, // 58: worker.SandboxWorker.CreateCheckpoint:output_type -> worker.CreateCheckpointResponse- 48, // 59: worker.SandboxWorker.RestoreCheckpoint:output_type -> worker.RestoreCheckpointResponse- 35, // 60: worker.SandboxWorker.BuildTemplate:output_type -> worker.BuildTemplateResponse- 44, // 61: worker.SandboxWorker.GetSandboxStats:output_type -> worker.GetSandboxStatsResponse- 50, // 62: worker.SandboxWorker.SetSandboxLimits:output_type -> worker.SetSandboxLimitsResponse- 52, // 63: worker.SandboxWorker.PreCopyDrives:output_type -> worker.PreCopyDrivesResponse- 54, // 64: worker.SandboxWorker.PrepareMigrationIncoming:output_type -> worker.PrepareMigrationIncomingResponse- 56, // 65: worker.SandboxWorker.LiveMigrate:output_type -> worker.LiveMigrateResponse- 58, // 66: worker.SandboxWorker.CompleteMigrationIncoming:output_type -> worker.CompleteMigrationIncomingResponse- 60, // 67: worker.SandboxWorker.RebuildGoldenSnapshot:output_type -> worker.RebuildGoldenSnapshotResponse- 39, // [39:68] is the sub-list for method output_type- 10, // [10:39] is the sub-list for method input_type+ 55, // 34: worker.SandboxWorker.UpdateSandboxSecret:input_type -> worker.UpdateSandboxSecretRequest+ 51, // 35: worker.SandboxWorker.PreCopyDrives:input_type -> worker.PreCopyDrivesRequest+ 53, // 36: worker.SandboxWorker.PrepareMigrationIncoming:input_type -> worker.PrepareMigrationIncomingRequest+ 57, // 37: worker.SandboxWorker.LiveMigrate:input_type -> worker.LiveMigrateRequest+ 59, // 38: worker.SandboxWorker.CompleteMigrationIncoming:input_type -> worker.CompleteMigrationIncomingRequest+ 61, // 39: worker.SandboxWorker.RebuildGoldenSnapshot:input_type -> worker.RebuildGoldenSnapshotRequest+ 2, // 40: worker.SandboxWorker.CreateSandbox:output_type -> worker.CreateSandboxResponse+ 4, // 41: worker.SandboxWorker.DestroySandbox:output_type -> worker.DestroySandboxResponse+ 10, // 42: worker.SandboxWorker.GetSandbox:output_type -> worker.GetSandboxResponse+ 12, // 43: worker.SandboxWorker.ListSandboxes:output_type -> worker.ListSandboxesResponse+ 14, // 44: worker.SandboxWorker.ExecCommand:output_type -> worker.ExecCommandResponse+ 15, // 45: worker.SandboxWorker.ExecCommandStream:output_type -> worker.ExecOutputChunk+ 17, // 46: worker.SandboxWorker.ReadFile:output_type -> worker.ReadFileResponse+ 19, // 47: worker.SandboxWorker.WriteFile:output_type -> worker.WriteFileResponse+ 22, // 48: worker.SandboxWorker.ListDir:output_type -> worker.ListDirResponse+ 24, // 49: worker.SandboxWorker.CreatePTY:output_type -> worker.CreatePTYResponse+ 27, // 50: worker.SandboxWorker.PTYStream:output_type -> worker.PTYOutput+ 37, // 51: worker.SandboxWorker.ExecSessionCreate:output_type -> worker.ExecSessionCreateResponse+ 39, // 52: worker.SandboxWorker.ExecSessionList:output_type -> worker.ExecSessionListResponse+ 42, // 53: worker.SandboxWorker.ExecSessionKill:output_type -> worker.ExecSessionKillResponse+ 29, // 54: worker.SandboxWorker.HibernateSandbox:output_type -> worker.HibernateSandboxResponse+ 31, // 55: worker.SandboxWorker.WakeSandbox:output_type -> worker.WakeSandboxResponse+ 6, // 56: worker.SandboxWorker.RebootSandbox:output_type -> worker.RebootSandboxResponse+ 8, // 57: worker.SandboxWorker.PowerCycleSandbox:output_type -> worker.PowerCycleSandboxResponse+ 33, // 58: worker.SandboxWorker.SaveAsTemplate:output_type -> worker.SaveAsTemplateResponse+ 46, // 59: worker.SandboxWorker.CreateCheckpoint:output_type -> worker.CreateCheckpointResponse+ 48, // 60: worker.SandboxWorker.RestoreCheckpoint:output_type -> worker.RestoreCheckpointResponse+ 35, // 61: worker.SandboxWorker.BuildTemplate:output_type -> worker.BuildTemplateResponse+ 44, // 62: worker.SandboxWorker.GetSandboxStats:output_type -> worker.GetSandboxStatsResponse+ 50, // 63: worker.SandboxWorker.SetSandboxLimits:output_type -> worker.SetSandboxLimitsResponse+ 56, // 64: worker.SandboxWorker.UpdateSandboxSecret:output_type -> worker.UpdateSandboxSecretResponse+ 52, // 65: worker.SandboxWorker.PreCopyDrives:output_type -> worker.PreCopyDrivesResponse+ 54, // 66: worker.SandboxWorker.PrepareMigrationIncoming:output_type -> worker.PrepareMigrationIncomingResponse+ 58, // 67: worker.SandboxWorker.LiveMigrate:output_type -> worker.LiveMigrateResponse+ 60, // 68: worker.SandboxWorker.CompleteMigrationIncoming:output_type -> worker.CompleteMigrationIncomingResponse+ 62, // 69: worker.SandboxWorker.RebuildGoldenSnapshot:output_type -> worker.RebuildGoldenSnapshotResponse+ 40, // [40:70] is the sub-list for method output_type+ 10, // [10:40] is the sub-list for method input_type10, // [10:10] is the sub-list for extension type_name10, // [10:10] is the sub-list for extension extendee0, // [0:10] is the sub-list for field type_name@@ -3966,7 +4086,7 @@ func file_proto_worker_worker_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_worker_worker_proto_rawDesc), len(file_proto_worker_worker_proto_rawDesc)),NumEnums: 1,- NumMessages: 65,+ NumMessages: 67,NumExtensions: 0,NumServices: 1,},diff --git a/proto/worker/worker.proto b/proto/worker/worker.protoindex f201b5ff..8ab840e3 100644--- a/proto/worker/worker.proto+++ b/proto/worker/worker.proto@@ -51,6 +51,14 @@ service SandboxWorker {rpc SetSandboxLimits(SetSandboxLimitsRequest) returns (SetSandboxLimitsResponse);+ // UpdateSandboxSecret refreshes the value the proxy substitutes for a+ // sealed token, by env-var name. Used by the secret-store update flow:+ // when a customer PUTs a new value, the CP fans out this RPC to every+ // worker hosting a sandbox that uses the store. Sealed token IDs and+ // sandbox env vars are unchanged — only the proxy session's value map+ // updates, so the next outbound HTTPS substitution uses the new value.+ rpc UpdateSandboxSecret(UpdateSandboxSecretRequest) returns (UpdateSandboxSecretResponse);+// Live migration between workersrpc PreCopyDrives(PreCopyDrivesRequest) returns (PreCopyDrivesResponse);rpc PrepareMigrationIncoming(PrepareMigrationIncomingRequest) returns (PrepareMigrationIncomingResponse);@@ -389,6 +397,19 @@ message PrepareMigrationIncomingResponse {int32 host_port = 2; // mapped host port on target worker}+message UpdateSandboxSecretRequest {+ string sandbox_id = 1;+ string secret_name = 2; // env var name (the key in the secret store)+ string value = 3; // new plaintext value+}++message UpdateSandboxSecretResponse {+ // updated is false if the worker has no proxy session for this sandbox+ // or the secret_name isn't registered on the session. Caller logs ++ // surfaces; not necessarily a hard error (sandbox may be mid-migration).+ bool updated = 1;+}+message LiveMigrateRequest {string sandbox_id = 1;string incoming_addr = 2; // TCP address from PrepareMigrationIncomingdiff --git a/proto/worker/worker_grpc.pb.go b/proto/worker/worker_grpc.pb.goindex 4cd9f3e3..2f2b14bd 100644--- a/proto/worker/worker_grpc.pb.go+++ b/proto/worker/worker_grpc.pb.go@@ -43,6 +43,7 @@ const (SandboxWorker_BuildTemplate_FullMethodName = "/worker.SandboxWorker/BuildTemplate"SandboxWorker_GetSandboxStats_FullMethodName = "/worker.SandboxWorker/GetSandboxStats"SandboxWorker_SetSandboxLimits_FullMethodName = "/worker.SandboxWorker/SetSandboxLimits"+ SandboxWorker_UpdateSandboxSecret_FullMethodName = "/worker.SandboxWorker/UpdateSandboxSecret"SandboxWorker_PreCopyDrives_FullMethodName = "/worker.SandboxWorker/PreCopyDrives"SandboxWorker_PrepareMigrationIncoming_FullMethodName = "/worker.SandboxWorker/PrepareMigrationIncoming"SandboxWorker_LiveMigrate_FullMethodName = "/worker.SandboxWorker/LiveMigrate"@@ -87,6 +88,13 @@ type SandboxWorkerClient interface {BuildTemplate(ctx context.Context, in *BuildTemplateRequest, opts ...grpc.CallOption) (*BuildTemplateResponse, error)GetSandboxStats(ctx context.Context, in *GetSandboxStatsRequest, opts ...grpc.CallOption) (*GetSandboxStatsResponse, error)SetSandboxLimits(ctx context.Context, in *SetSandboxLimitsRequest, opts ...grpc.CallOption) (*SetSandboxLimitsResponse, error)+ // UpdateSandboxSecret refreshes the value the proxy substitutes for a+ // sealed token, by env-var name. Used by the secret-store update flow:+ // when a customer PUTs a new value, the CP fans out this RPC to every+ // worker hosting a sandbox that uses the store. Sealed token IDs and+ // sandbox env vars are unchanged — only the proxy session's value map+ // updates, so the next outbound HTTPS substitution uses the new value.+ UpdateSandboxSecret(ctx context.Context, in *UpdateSandboxSecretRequest, opts ...grpc.CallOption) (*UpdateSandboxSecretResponse, error)// Live migration between workersPreCopyDrives(ctx context.Context, in *PreCopyDrivesRequest, opts ...grpc.CallOption) (*PreCopyDrivesResponse, error)PrepareMigrationIncoming(ctx context.Context, in *PrepareMigrationIncomingRequest, opts ...grpc.CallOption) (*PrepareMigrationIncomingResponse, error)@@ -356,6 +364,16 @@ func (c *sandboxWorkerClient) SetSandboxLimits(ctx context.Context, in *SetSandbreturn out, nil}+func (c *sandboxWorkerClient) UpdateSandboxSecret(ctx context.Context, in *UpdateSandboxSecretRequest, opts ...grpc.CallOption) (*UpdateSandboxSecretResponse, error) {+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)+ out := new(UpdateSandboxSecretResponse)+ err := c.cc.Invoke(ctx, SandboxWorker_UpdateSandboxSecret_FullMethodName, in, out, cOpts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *sandboxWorkerClient) PreCopyDrives(ctx context.Context, in *PreCopyDrivesRequest, opts ...grpc.CallOption) (*PreCopyDrivesResponse, error) {cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)out := new(PreCopyDrivesResponse)@@ -443,6 +461,13 @@ type SandboxWorkerServer interface {BuildTemplate(context.Context, *BuildTemplateRequest) (*BuildTemplateResponse, error)GetSandboxStats(context.Context, *GetSandboxStatsRequest) (*GetSandboxStatsResponse, error)SetSandboxLimits(context.Context, *SetSandboxLimitsRequest) (*SetSandboxLimitsResponse, error)+ // UpdateSandboxSecret refreshes the value the proxy substitutes for a+ // sealed token, by env-var name. Used by the secret-store update flow:+ // when a customer PUTs a new value, the CP fans out this RPC to every+ // worker hosting a sandbox that uses the store. Sealed token IDs and+ // sandbox env vars are unchanged — only the proxy session's value map+ // updates, so the next outbound HTTPS substitution uses the new value.+ UpdateSandboxSecret(context.Context, *UpdateSandboxSecretRequest) (*UpdateSandboxSecretResponse, error)// Live migration between workersPreCopyDrives(context.Context, *PreCopyDrivesRequest) (*PreCopyDrivesResponse, error)PrepareMigrationIncoming(context.Context, *PrepareMigrationIncomingRequest) (*PrepareMigrationIncomingResponse, error)@@ -532,6 +557,9 @@ func (UnimplementedSandboxWorkerServer) GetSandboxStats(context.Context, *GetSanfunc (UnimplementedSandboxWorkerServer) SetSandboxLimits(context.Context, *SetSandboxLimitsRequest) (*SetSandboxLimitsResponse, error) {return nil, status.Error(codes.Unimplemented, "method SetSandboxLimits not implemented")}+func (UnimplementedSandboxWorkerServer) UpdateSandboxSecret(context.Context, *UpdateSandboxSecretRequest) (*UpdateSandboxSecretResponse, error) {+ return nil, status.Error(codes.Unimplemented, "method UpdateSandboxSecret not implemented")+}func (UnimplementedSandboxWorkerServer) PreCopyDrives(context.Context, *PreCopyDrivesRequest) (*PreCopyDrivesResponse, error) {return nil, status.Error(codes.Unimplemented, "method PreCopyDrives not implemented")}@@ -982,6 +1010,24 @@ func _SandboxWorker_SetSandboxLimits_Handler(srv interface{}, ctx context.Contexreturn interceptor(ctx, in, info, handler)}+func _SandboxWorker_UpdateSandboxSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UpdateSandboxSecretRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(SandboxWorkerServer).UpdateSandboxSecret(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: SandboxWorker_UpdateSandboxSecret_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(SandboxWorkerServer).UpdateSandboxSecret(ctx, req.(*UpdateSandboxSecretRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _SandboxWorker_PreCopyDrives_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(PreCopyDrivesRequest)if err := dec(in); err != nil {@@ -1167,6 +1213,10 @@ var SandboxWorker_ServiceDesc = grpc.ServiceDesc{MethodName: "SetSandboxLimits",Handler: _SandboxWorker_SetSandboxLimits_Handler,},+ {+ MethodName: "UpdateSandboxSecret",+ Handler: _SandboxWorker_UpdateSandboxSecret_Handler,+ },{MethodName: "PreCopyDrives",Handler: _SandboxWorker_PreCopyDrives_Handler,