opensandbox-server 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/.gitignore +4 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/PKG-INFO +1 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/credential_vault.py +8 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/lifecycle.py +11 -89
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/network_policy.py +8 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/pool.py +0 -35
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/proxy.py +63 -2
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/schema.py +412 -220
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/templates.py +2 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/config.py +15 -7
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/extensions/codec.py +0 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/extensions/keys.py +0 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/activity.py +0 -4
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/probe.py +45 -10
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/sweeper.py +13 -27
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/__init__.py +0 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/intent.py +2 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/logutil.py +0 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/main.py +2 -13
- opensandbox_server-1.2.1/opensandbox_server/middleware/__init__.py +13 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/middleware/auth.py +0 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/templates/sqlite.py +0 -7
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/composite_service.py +2 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/constants.py +14 -4
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/container_ops.py +40 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/docker_diagnostics.py +1 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/docker_service.py +28 -23
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/networking.py +1 -10
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/ossfs_mixin.py +3 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/runtime.py +3 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/snapshot_runtime.py +13 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/volumes.py +113 -58
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/windows_profile.py +6 -3
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/factory.py +5 -16
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/create_mapping.py +85 -4
- opensandbox_server-1.2.1/opensandbox_server/services/fast_sandbox/generated/fastpath_pb2.py +188 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/generated/fastpath_pb2_grpc.py +1 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/network_policy.py +38 -24
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/service.py +70 -8
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/snapshot_runtime.py +28 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/vault.py +94 -13
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/helpers.py +11 -8
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/agent_sandbox_provider.py +0 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/batchsandbox_provider.py +2 -2
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/client.py +7 -23
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/image_pull_secret_helper.py +5 -19
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/informer.py +107 -4
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/k8s_diagnostics.py +145 -8
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/kubernetes_service.py +75 -26
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/list_helpers.py +25 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/pool_service.py +21 -2
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/provider_common.py +24 -19
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/rate_limiter.py +1 -6
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/workload_provider.py +19 -112
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/runtime_resolver.py +6 -52
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/sandbox_service.py +5 -37
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_models.py +2 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_restore.py +2 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_runtime.py +22 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_runtime_factory.py +17 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_service.py +27 -7
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/templates/template_models.py +3 -1
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/templates/template_service.py +51 -14
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/validators.py +27 -80
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/pyproject.toml +5 -0
- opensandbox_server-1.2.0/opensandbox_server/__init__.py +0 -16
- opensandbox_server-1.2.0/opensandbox_server/integrations/renew_intent/runner.py +0 -39
- opensandbox_server-1.2.0/opensandbox_server/services/fast_sandbox/generated/fastpath_pb2.py +0 -180
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/LICENSE +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/README.md +0 -0
- {opensandbox_server-1.2.0/opensandbox_server/api → opensandbox_server-1.2.1/opensandbox_server}/__init__.py +0 -0
- {opensandbox_server-1.2.0/opensandbox_server/middleware → opensandbox_server-1.2.1/opensandbox_server/api}/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/devops.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/metrics.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/cli.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/constants.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/.gitkeep +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/e2e.batchsandbox-template.yaml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/example.batchsandbox-template.yaml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/example.config.k8s.toml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/example.config.k8s.zh.toml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/example.config.toml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/examples/example.config.zh.toml +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/extensions/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/extensions/validation.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/constants.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/decision.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/executor.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/inventory.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/locking.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/logutil.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/metrics.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/policy.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/idle_pause/redis_client.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/otel/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/otel/metrics.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/constants.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/consumer.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/controller.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/proxy_renew.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/integrations/renew_intent/redis_client.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/logging_config.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/middleware/date_header.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/middleware/http_metrics.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/middleware/request_id.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/py.typed +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/snapshots/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/snapshots/factory.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/snapshots/migrate.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/snapshots/postgresql.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/snapshots/sqlite.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/templates/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/templates/factory.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/repositories/templates/postgresql.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/activity_recorder.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/diagnostics.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/metadata.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/docker/port_allocator.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/endpoint_auth.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/extension_service.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/cr_mapping.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/cr_reader.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/endpoint.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/fastpath_client.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/generated/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/policy_relay.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/fast_sandbox/status_mapping.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/agent_sandbox_template.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/batchsandbox_template.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/create_helpers.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/egress_helper.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/endpoint_resolver.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/error_helpers.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/label_selector.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/provider_factory.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/security_context.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/snapshot_runtime.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/status_helpers.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/template_manager.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/volume_helper.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/windows_profile.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/workload_access.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/k8s/workload_mapper.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/signing.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/snapshot_repository.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/templates/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/services/windows_common.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/startup_guard.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/__init__.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/context.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/file_provider.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/http_provider.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/models.py +0 -0
- {opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/tenants/provider.py +0 -0
|
@@ -294,3 +294,7 @@ obj/
|
|
|
294
294
|
# fast-sandbox pinned source checkout (materialized by
|
|
295
295
|
# manifests/release/build-fast-sandbox.sh from manifests/third-party/fast-sandbox.commit)
|
|
296
296
|
.fast-sandbox/
|
|
297
|
+
|
|
298
|
+
# Test-only localhost certificate pair for the egress OSEP-0025 resolver stub
|
|
299
|
+
# (fixtures/README.md documents regeneration; these certify nothing).
|
|
300
|
+
!components/egress/tests/resolver/fixtures/*.pem
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: opensandbox-server
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: FastAPI control plane for OpenSandbox that manages sandbox lifecycle on Docker (ready) and Kubernetes (planned) runtimes.
|
|
5
5
|
Project-URL: Homepage, https://github.com/opensandbox-group/OpenSandbox
|
|
6
6
|
Project-URL: Repository, https://github.com/opensandbox-group/OpenSandbox
|
{opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/credential_vault.py
RENAMED
|
@@ -29,6 +29,7 @@ from opensandbox_server.api.schema import (
|
|
|
29
29
|
CredentialVaultState,
|
|
30
30
|
)
|
|
31
31
|
from opensandbox_server.services.composite_service import CompositeSandboxService
|
|
32
|
+
from opensandbox_server.services.constants import SandboxErrorCodes
|
|
32
33
|
from opensandbox_server.services.fast_sandbox import FastSandboxService
|
|
33
34
|
|
|
34
35
|
router = APIRouter(tags=["Sandboxes"])
|
|
@@ -39,7 +40,13 @@ def _fsb_service():
|
|
|
39
40
|
if not isinstance(service, (FastSandboxService, CompositeSandboxService)):
|
|
40
41
|
from fastapi import HTTPException
|
|
41
42
|
|
|
42
|
-
raise HTTPException(
|
|
43
|
+
raise HTTPException(
|
|
44
|
+
404,
|
|
45
|
+
detail={
|
|
46
|
+
"code": SandboxErrorCodes.FSB_SANDBOX_NOT_FOUND,
|
|
47
|
+
"message": "Fsb sandbox not found.",
|
|
48
|
+
},
|
|
49
|
+
)
|
|
43
50
|
return service
|
|
44
51
|
|
|
45
52
|
|
|
@@ -102,16 +102,6 @@ async def create_sandbox(
|
|
|
102
102
|
Creates a new sandbox from a container image with optional resource limits,
|
|
103
103
|
environment variables, and metadata. Sandboxes are provisioned directly from
|
|
104
104
|
the specified image without requiring a pre-created template.
|
|
105
|
-
|
|
106
|
-
Args:
|
|
107
|
-
request: Sandbox creation request
|
|
108
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
109
|
-
|
|
110
|
-
Returns:
|
|
111
|
-
CreateSandboxResponse: Accepted sandbox creation request
|
|
112
|
-
|
|
113
|
-
Raises:
|
|
114
|
-
HTTPException: If sandbox creation scheduling fails
|
|
115
105
|
"""
|
|
116
106
|
validate_extensions(request.extensions)
|
|
117
107
|
validate_renew_policy_conflict(request.lifecycle, request.extensions)
|
|
@@ -146,16 +136,6 @@ def list_sandboxes(
|
|
|
146
136
|
|
|
147
137
|
List all sandboxes with optional filtering and pagination using query parameters.
|
|
148
138
|
All filter conditions use AND logic. Multiple `state` parameters use OR logic within states.
|
|
149
|
-
|
|
150
|
-
Args:
|
|
151
|
-
state: Filter by lifecycle state.
|
|
152
|
-
metadata: Arbitrary metadata key-value pairs for filtering.
|
|
153
|
-
page: Page number for pagination.
|
|
154
|
-
page_size: Number of items per page.
|
|
155
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
156
|
-
|
|
157
|
-
Returns:
|
|
158
|
-
ListSandboxesResponse: Paginated list of sandboxes
|
|
159
139
|
"""
|
|
160
140
|
metadata_dict = {}
|
|
161
141
|
if metadata:
|
|
@@ -204,16 +184,6 @@ def get_sandbox(
|
|
|
204
184
|
|
|
205
185
|
Returns the complete sandbox information including image specification,
|
|
206
186
|
status, metadata, and timestamps.
|
|
207
|
-
|
|
208
|
-
Args:
|
|
209
|
-
sandbox_id: Unique sandbox identifier
|
|
210
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
211
|
-
|
|
212
|
-
Returns:
|
|
213
|
-
Sandbox: Complete sandbox information
|
|
214
|
-
|
|
215
|
-
Raises:
|
|
216
|
-
HTTPException: If sandbox not found or access denied
|
|
217
187
|
"""
|
|
218
188
|
return sandbox_service.get_sandbox(sandbox_id)
|
|
219
189
|
|
|
@@ -270,16 +240,6 @@ def delete_sandbox(
|
|
|
270
240
|
Request sandbox deletion. Runtime cleanup may continue after the response.
|
|
271
241
|
For Kubernetes BatchSandbox workloads, queries report Stopping during cleanup
|
|
272
242
|
and return 404 once the resource is removed.
|
|
273
|
-
|
|
274
|
-
Args:
|
|
275
|
-
sandbox_id: Unique sandbox identifier
|
|
276
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
277
|
-
|
|
278
|
-
Returns:
|
|
279
|
-
Response: 204 No Content
|
|
280
|
-
|
|
281
|
-
Raises:
|
|
282
|
-
HTTPException: If sandbox not found or deletion fails
|
|
283
243
|
"""
|
|
284
244
|
sandbox_service.delete_sandbox(sandbox_id)
|
|
285
245
|
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
|
@@ -310,16 +270,6 @@ def pause_sandbox(
|
|
|
310
270
|
|
|
311
271
|
Pauses a running sandbox while preserving its state.
|
|
312
272
|
Poll GET /sandboxes/{sandboxId} to track state transition through Pausing and eventually Paused.
|
|
313
|
-
|
|
314
|
-
Args:
|
|
315
|
-
sandbox_id: Unique sandbox identifier
|
|
316
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
317
|
-
|
|
318
|
-
Returns:
|
|
319
|
-
Response: 202 Accepted
|
|
320
|
-
|
|
321
|
-
Raises:
|
|
322
|
-
HTTPException: If sandbox not found or cannot be paused
|
|
323
273
|
"""
|
|
324
274
|
sandbox_service.pause_sandbox(sandbox_id)
|
|
325
275
|
return Response(status_code=status.HTTP_202_ACCEPTED)
|
|
@@ -346,16 +296,6 @@ def resume_sandbox(
|
|
|
346
296
|
|
|
347
297
|
Resumes execution of a paused sandbox.
|
|
348
298
|
Poll GET /sandboxes/{sandboxId} to track state transition through Resuming and eventually Running.
|
|
349
|
-
|
|
350
|
-
Args:
|
|
351
|
-
sandbox_id: Unique sandbox identifier
|
|
352
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
353
|
-
|
|
354
|
-
Returns:
|
|
355
|
-
Response: 202 Accepted
|
|
356
|
-
|
|
357
|
-
Raises:
|
|
358
|
-
HTTPException: If sandbox not found or cannot be resumed
|
|
359
299
|
"""
|
|
360
300
|
sandbox_service.resume_sandbox(sandbox_id)
|
|
361
301
|
return Response(status_code=status.HTTP_202_ACCEPTED)
|
|
@@ -386,17 +326,6 @@ def renew_sandbox_expiration(
|
|
|
386
326
|
Sets the absolute expiration time of a sandbox to the supplied future timestamp.
|
|
387
327
|
This may shorten, preserve, or extend the current expiration.
|
|
388
328
|
The creation-time limit server.max_sandbox_timeout_seconds does not apply.
|
|
389
|
-
|
|
390
|
-
Args:
|
|
391
|
-
sandbox_id: Unique sandbox identifier
|
|
392
|
-
request: Renewal request with new expiration time
|
|
393
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
394
|
-
|
|
395
|
-
Returns:
|
|
396
|
-
RenewSandboxExpirationResponse: Updated expiration time
|
|
397
|
-
|
|
398
|
-
Raises:
|
|
399
|
-
HTTPException: If sandbox not found or renewal fails
|
|
400
329
|
"""
|
|
401
330
|
return sandbox_service.renew_expiration(sandbox_id, request)
|
|
402
331
|
|
|
@@ -537,7 +466,15 @@ def get_sandbox_endpoint(
|
|
|
537
466
|
request: Request,
|
|
538
467
|
sandbox_id: str,
|
|
539
468
|
port: int,
|
|
540
|
-
use_server_proxy: bool = Query(
|
|
469
|
+
use_server_proxy: bool = Query(
|
|
470
|
+
False,
|
|
471
|
+
deprecated=True,
|
|
472
|
+
description=(
|
|
473
|
+
"Deprecated: the server-proxied data path is in maintenance mode "
|
|
474
|
+
"(security and bug fixes only); deploy the ingress gateway for "
|
|
475
|
+
"data-plane traffic. When true, returns a server-proxied URL."
|
|
476
|
+
),
|
|
477
|
+
),
|
|
541
478
|
expires: Optional[int] = Query(None, description="Request a signed route token with this Unix epoch second expiration. Requires ingress gateway with secure_access configured."),
|
|
542
479
|
x_request_id: Optional[str] = Header(None, alias="X-Request-ID", description="Unique request identifier for tracing"),
|
|
543
480
|
response: Response = None, # type: ignore[assignment]
|
|
@@ -552,23 +489,8 @@ def get_sandbox_endpoint(
|
|
|
552
489
|
When the ``expires`` query parameter is provided, the endpoint is wrapped in a
|
|
553
490
|
cryptographically signed route token (OSEP-0011) instead of returning a plain URL.
|
|
554
491
|
This requires the ingress gateway to be configured with secure_access signing keys.
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
request: FastAPI request object
|
|
558
|
-
sandbox_id: Unique sandbox identifier
|
|
559
|
-
port: Port number where the service is listening inside the sandbox (1-65535)
|
|
560
|
-
use_server_proxy: Whether to return a server-proxied URL
|
|
561
|
-
expires: Unix epoch seconds for signed route token expiration. Must be a
|
|
562
|
-
non-negative uint64 value. When omitted or invalid, a plain (unsigned)
|
|
563
|
-
endpoint is returned.
|
|
564
|
-
x_request_id: Unique request identifier for tracing (optional; server generates if omitted).
|
|
565
|
-
|
|
566
|
-
Returns:
|
|
567
|
-
Endpoint: Public endpoint URL
|
|
568
|
-
|
|
569
|
-
Raises:
|
|
570
|
-
HTTPException: If sandbox not found, endpoint not available, or signed
|
|
571
|
-
routes are not supported by the runtime/configuration (400).
|
|
492
|
+
``expires`` must be a non-negative Unix epoch second value; when omitted or
|
|
493
|
+
invalid, a plain (unsigned) endpoint is returned.
|
|
572
494
|
"""
|
|
573
495
|
if use_server_proxy and expires is not None:
|
|
574
496
|
raise HTTPException(
|
{opensandbox_server-1.2.0 → opensandbox_server-1.2.1}/opensandbox_server/api/network_policy.py
RENAMED
|
@@ -13,6 +13,7 @@ from opensandbox_server.api import lifecycle
|
|
|
13
13
|
from opensandbox_server.api.proxy import _proxy_http_request
|
|
14
14
|
from opensandbox_server.api.schema import NetworkPolicy, NetworkRule
|
|
15
15
|
from opensandbox_server.services.composite_service import CompositeSandboxService
|
|
16
|
+
from opensandbox_server.services.constants import SandboxErrorCodes
|
|
16
17
|
from opensandbox_server.services.fast_sandbox import FastSandboxService
|
|
17
18
|
|
|
18
19
|
router = APIRouter(tags=["Sandboxes"])
|
|
@@ -21,7 +22,13 @@ router = APIRouter(tags=["Sandboxes"])
|
|
|
21
22
|
def _fsb_service():
|
|
22
23
|
service = lifecycle.sandbox_service
|
|
23
24
|
if not isinstance(service, (FastSandboxService, CompositeSandboxService)):
|
|
24
|
-
raise HTTPException(
|
|
25
|
+
raise HTTPException(
|
|
26
|
+
404,
|
|
27
|
+
detail={
|
|
28
|
+
"code": SandboxErrorCodes.FSB_SANDBOX_NOT_FOUND,
|
|
29
|
+
"message": "Fsb sandbox not found.",
|
|
30
|
+
},
|
|
31
|
+
)
|
|
25
32
|
return service
|
|
26
33
|
|
|
27
34
|
|
|
@@ -94,13 +94,6 @@ def create_pool(
|
|
|
94
94
|
Creates a Pool CRD resource that manages a set of pre-warmed pods.
|
|
95
95
|
Once created, sandboxes can reference the pool via ``extensions.poolRef``
|
|
96
96
|
during sandbox creation to benefit from reduced cold-start latency.
|
|
97
|
-
|
|
98
|
-
Args:
|
|
99
|
-
request: Pool creation request including name, pod template, and capacity spec.
|
|
100
|
-
x_request_id: Optional request tracing identifier.
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
PoolResponse: The newly created pool.
|
|
104
97
|
"""
|
|
105
98
|
pool_service = _get_pool_service()
|
|
106
99
|
return pool_service.create_pool(request)
|
|
@@ -124,12 +117,6 @@ def list_pools(
|
|
|
124
117
|
List all pre-warmed resource pools.
|
|
125
118
|
|
|
126
119
|
Returns all Pool resources in the configured namespace.
|
|
127
|
-
|
|
128
|
-
Args:
|
|
129
|
-
x_request_id: Optional request tracing identifier.
|
|
130
|
-
|
|
131
|
-
Returns:
|
|
132
|
-
ListPoolsResponse: Collection of all pools.
|
|
133
120
|
"""
|
|
134
121
|
pool_service = _get_pool_service()
|
|
135
122
|
return pool_service.list_pools()
|
|
@@ -153,13 +140,6 @@ def get_pool(
|
|
|
153
140
|
) -> PoolResponse:
|
|
154
141
|
"""
|
|
155
142
|
Retrieve a pool by name.
|
|
156
|
-
|
|
157
|
-
Args:
|
|
158
|
-
pool_name: Name of the pool to retrieve.
|
|
159
|
-
x_request_id: Optional request tracing identifier.
|
|
160
|
-
|
|
161
|
-
Returns:
|
|
162
|
-
PoolResponse: Current state of the pool including runtime status.
|
|
163
143
|
"""
|
|
164
144
|
pool_service = _get_pool_service()
|
|
165
145
|
return pool_service.get_pool(pool_name)
|
|
@@ -189,14 +169,6 @@ def update_pool(
|
|
|
189
169
|
Only ``capacitySpec`` (bufferMax, bufferMin, poolMax, poolMin) can be
|
|
190
170
|
modified after creation. To change the pod template, delete and recreate
|
|
191
171
|
the pool.
|
|
192
|
-
|
|
193
|
-
Args:
|
|
194
|
-
pool_name: Name of the pool to update.
|
|
195
|
-
request: Update request with the new capacity spec.
|
|
196
|
-
x_request_id: Optional request tracing identifier.
|
|
197
|
-
|
|
198
|
-
Returns:
|
|
199
|
-
PoolResponse: Updated pool state.
|
|
200
172
|
"""
|
|
201
173
|
pool_service = _get_pool_service()
|
|
202
174
|
return pool_service.update_pool(pool_name, request)
|
|
@@ -222,13 +194,6 @@ def delete_pool(
|
|
|
222
194
|
|
|
223
195
|
Removes the Pool CRD resource. Pre-warmed pods managed by the pool will
|
|
224
196
|
be terminated by the pool controller.
|
|
225
|
-
|
|
226
|
-
Args:
|
|
227
|
-
pool_name: Name of the pool to delete.
|
|
228
|
-
x_request_id: Optional request tracing identifier.
|
|
229
|
-
|
|
230
|
-
Returns:
|
|
231
|
-
Response: 204 No Content.
|
|
232
197
|
"""
|
|
233
198
|
pool_service = _get_pool_service()
|
|
234
199
|
pool_service.delete_pool(pool_name)
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
"""
|
|
16
16
|
HTTP and WebSocket proxy routes for reaching services inside sandboxes via the lifecycle API.
|
|
17
|
+
|
|
18
|
+
DEPRECATED — maintenance mode. The server-proxied data path couples data-plane
|
|
19
|
+
traffic to the control-plane server; it receives no new features and is maintained
|
|
20
|
+
for security fixes and bug fixes only. Deploy the ingress gateway and route
|
|
21
|
+
data-plane traffic through it instead.
|
|
17
22
|
"""
|
|
18
23
|
|
|
19
24
|
import asyncio
|
|
@@ -106,6 +111,25 @@ WEBSOCKET_HANDSHAKE_HEADERS = {
|
|
|
106
111
|
|
|
107
112
|
router = APIRouter(tags=["Sandboxes"])
|
|
108
113
|
|
|
114
|
+
# RFC 9745 Section 2.1: the Deprecation field is a Structured Field Date
|
|
115
|
+
# (@<unix seconds>) recording when the deprecation took effect. The proxy data
|
|
116
|
+
# path was declared deprecated on 2026-11-02T00:00:00Z.
|
|
117
|
+
DEPRECATION_HEADER_VALUE = "@1793577600"
|
|
118
|
+
|
|
119
|
+
_deprecation_warned = False
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def _warn_proxy_deprecated() -> None:
|
|
123
|
+
"""Log the maintenance-mode notice once per process."""
|
|
124
|
+
global _deprecation_warned
|
|
125
|
+
if not _deprecation_warned:
|
|
126
|
+
_deprecation_warned = True
|
|
127
|
+
logger.warning(
|
|
128
|
+
"The sandbox server proxy (/sandboxes/{id}/proxy/{port}) is deprecated and in "
|
|
129
|
+
"maintenance mode: no new features, security and bug fixes only. Route "
|
|
130
|
+
"data-plane traffic through the ingress gateway instead."
|
|
131
|
+
)
|
|
132
|
+
|
|
109
133
|
|
|
110
134
|
def _build_proxy_target_url(
|
|
111
135
|
endpoint: Endpoint,
|
|
@@ -225,6 +249,20 @@ def _set_forwarded_headers(
|
|
|
225
249
|
headers["X-Forwarded-For"] = request.client.host
|
|
226
250
|
|
|
227
251
|
|
|
252
|
+
def _request_has_body(request: Request) -> bool:
|
|
253
|
+
"""Whether the client request carries a body to forward.
|
|
254
|
+
|
|
255
|
+
Any method may carry one; its framing headers (RFC 9112, section 6) say
|
|
256
|
+
whether it does. Content-Length is forwarded as is, so a declared body
|
|
257
|
+
must be streamed with it.
|
|
258
|
+
"""
|
|
259
|
+
return (
|
|
260
|
+
request.method in ("POST", "PUT", "PATCH", "DELETE")
|
|
261
|
+
or "content-length" in request.headers
|
|
262
|
+
or "transfer-encoding" in request.headers
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
|
|
228
266
|
def _rewrite_proxy_location(
|
|
229
267
|
location: str,
|
|
230
268
|
request: Request,
|
|
@@ -374,6 +412,11 @@ async def _proxy_http_request(
|
|
|
374
412
|
internal: bool = False,
|
|
375
413
|
) -> StreamingResponse:
|
|
376
414
|
resolve_internal = get_config().proxy.resolve_internal
|
|
415
|
+
if not internal:
|
|
416
|
+
# Only the external /proxy/{port} path is deprecated; internal callers
|
|
417
|
+
# such as network-policy and credential-vault routes are supported
|
|
418
|
+
# control-plane operations and must not consume the one-time warning.
|
|
419
|
+
_warn_proxy_deprecated()
|
|
377
420
|
# get_endpoint does blocking Docker/Kubernetes I/O; keep it off the event loop.
|
|
378
421
|
endpoint = await asyncio.to_thread(
|
|
379
422
|
lifecycle.sandbox_service.get_endpoint,
|
|
@@ -406,12 +449,11 @@ async def _proxy_http_request(
|
|
|
406
449
|
# observed by this trusted proxy, so clients cannot spoof transport state.
|
|
407
450
|
_set_forwarded_headers(headers, request)
|
|
408
451
|
|
|
409
|
-
stream_body = request.method in ("POST", "PUT", "PATCH", "DELETE")
|
|
410
452
|
req = client.build_request(
|
|
411
453
|
method=request.method,
|
|
412
454
|
url=target_url,
|
|
413
455
|
headers=headers,
|
|
414
|
-
content=request.stream() if
|
|
456
|
+
content=request.stream() if _request_has_body(request) else None,
|
|
415
457
|
)
|
|
416
458
|
|
|
417
459
|
resp = await client.send(req, stream=True)
|
|
@@ -438,6 +480,10 @@ async def _proxy_http_request(
|
|
|
438
480
|
for key, value in resp.headers.raw
|
|
439
481
|
if key.decode("latin-1").lower() not in response_header_exclusions
|
|
440
482
|
]
|
|
483
|
+
if not internal:
|
|
484
|
+
response_headers.append(
|
|
485
|
+
(b"deprecation", DEPRECATION_HEADER_VALUE.encode())
|
|
486
|
+
)
|
|
441
487
|
|
|
442
488
|
return _ProxyStreamingResponse(
|
|
443
489
|
resp,
|
|
@@ -457,6 +503,17 @@ async def _proxy_http_request(
|
|
|
457
503
|
"message": f"Could not connect to the backend sandbox {endpoint.endpoint}: {e}",
|
|
458
504
|
},
|
|
459
505
|
) from e
|
|
506
|
+
except httpx.PoolTimeout as e:
|
|
507
|
+
# Every connection of the shared client is busy (for example held by
|
|
508
|
+
# long-lived streamed responses): the server, not the sandbox, is out
|
|
509
|
+
# of capacity.
|
|
510
|
+
raise HTTPException(
|
|
511
|
+
status_code=503,
|
|
512
|
+
detail={
|
|
513
|
+
"code": "PROXY_POOL_EXHAUSTED",
|
|
514
|
+
"message": f"No proxy connection to the backend sandbox {endpoint.endpoint} became free in time: {e}",
|
|
515
|
+
},
|
|
516
|
+
) from e
|
|
460
517
|
except (httpx.ReadTimeout, httpx.WriteTimeout) as e:
|
|
461
518
|
raise HTTPException(
|
|
462
519
|
status_code=504,
|
|
@@ -586,6 +643,8 @@ async def _proxy_websocket_request(
|
|
|
586
643
|
if not await _authenticate_websocket_tenant(websocket):
|
|
587
644
|
return
|
|
588
645
|
|
|
646
|
+
_warn_proxy_deprecated()
|
|
647
|
+
|
|
589
648
|
try:
|
|
590
649
|
resolve_internal = get_config().proxy.resolve_internal
|
|
591
650
|
endpoint = await asyncio.to_thread(
|
|
@@ -734,6 +793,7 @@ for _method in _PROXY_HTTP_METHODS:
|
|
|
734
793
|
methods=[_method],
|
|
735
794
|
response_class=StreamingResponse,
|
|
736
795
|
openapi_extra=_PROXY_OPENAPI_EXTRA,
|
|
796
|
+
deprecated=True,
|
|
737
797
|
)
|
|
738
798
|
|
|
739
799
|
router.add_api_route(
|
|
@@ -750,6 +810,7 @@ for _method in _PROXY_HTTP_METHODS:
|
|
|
750
810
|
methods=[_method],
|
|
751
811
|
response_class=StreamingResponse,
|
|
752
812
|
openapi_extra=_PROXY_OPENAPI_EXTRA,
|
|
813
|
+
deprecated=True,
|
|
753
814
|
)
|
|
754
815
|
|
|
755
816
|
|