mirror of
https://github.com/usestrix/strix.git
synced 2026-09-06 08:15:56 +00:00
fix(backends): default supports_mount_free to not supports_bind_mounts for fail-closed safety
This commit is contained in:
parent
3774c2eefd
commit
4206df8d81
1 changed files with 5 additions and 4 deletions
|
|
@ -81,16 +81,17 @@ def register_backend(
|
|||
backend: SandboxBackend,
|
||||
*,
|
||||
supports_bind_mounts: bool = False,
|
||||
supports_mount_free: bool = True,
|
||||
supports_mount_free: bool | None = None,
|
||||
) -> None:
|
||||
"""Register a custom backend under ``name``.
|
||||
|
||||
Intended for downstream users who ship their own runtime — register
|
||||
before any ``session_manager.create_or_reuse`` call. Re-registering
|
||||
an existing name overwrites the prior entry. ``supports_bind_mounts``
|
||||
defaults to False: a remote runtime cannot see the caller's filesystem, so
|
||||
it is handed local sources as manifest entries to upload instead.
|
||||
an existing name overwrites the prior entry. Remote backends without bind
|
||||
mounts default to mount-free support, while bind-mount backends must explicitly opt in.
|
||||
"""
|
||||
if supports_mount_free is None:
|
||||
supports_mount_free = not supports_bind_mounts
|
||||
_BACKENDS[name] = backend
|
||||
if supports_bind_mounts:
|
||||
_BIND_MOUNT_BACKENDS.add(name)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue