Repository navigation
feat(sandbox2,minimald-rpc,sessions): introduce trimodal NetworkMode enum #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9628014
3c8ec80
35166a2
c2210aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,33 @@ pub mod core; | |
| pub mod store; | ||
| pub mod wire; | ||
|
|
||
| /// The network isolation mode for a `PTask` (session). | ||
| /// | ||
| /// Defaults to [`NetworkMode::HostNet`] for backwards compatibility with | ||
| /// existing sessions that predate this field. | ||
| #[non_exhaustive] | ||
| #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub enum NetworkMode { | ||
| /// No network namespace; all network syscalls fail or see no interfaces. | ||
| NoNet, | ||
| /// Share the host (or VM) network namespace. Current default. | ||
| #[default] | ||
| HostNet, | ||
| /// Own IP via the gvproxy switch: new netns + tap + switch attachment. | ||
| OwnIp, | ||
| } | ||
|
|
||
| /// An IP transport protocol, used in egress/ingress policy rules. | ||
| #[non_exhaustive] | ||
| #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub enum IpProto { | ||
| Tcp, | ||
| Udp, | ||
| Icmp, | ||
| } | ||
|
|
||
| /// A session ID, a newtype over a UUID. | ||
| #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, PartialOrd, Ord)] | ||
| pub struct SessionId(Uuid); | ||
|
|
@@ -65,6 +92,12 @@ pub struct Record { | |
| /// The absolute path upon which this session was built from. | ||
| pub project_path: HostAbsPath, | ||
|
|
||
| /// The network isolation mode for this session. | ||
| /// | ||
| /// Defaults to [`NetworkMode::HostNet`] when absent (existing sessions). | ||
| #[serde(default)] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MEDIUM | Spec Compliance | R1.2
As a result a session whose record carries The fix is for the session-launch code (in If the intent is to defer this to the gvproxy infrastructure task, the task sub-issue should document that R1.2 enforcement is intentionally incomplete here — the proof artifact only tests compilation, not isolation behaviour. |
||
| pub network: NetworkMode, | ||
|
|
||
| /// Free-form attributes. | ||
| pub attrs: BTreeMap<String, String>, | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOW | Spec Compliance | R1.2 (task proof artifact)
The task sub-issue (#495) lists two additional files in scope that are absent from this PR:
vendor/gvproxy/(new) — vendored gvproxy Go source at a pinned commit.github/workflows/— CI step to build gvproxy from source with SHA-256 verificationAnd the corresponding proof artifact: "
vendor/gvproxy/go.sumexists at a pinned version — fails on base (directory absent)."PR #503 landed a pre-built binary approach (
chore(vendor): pin and verify pre-built gvproxy switch binary), which is a different strategy from "build from vendored Go source" that the spec's Technical Considerations section prefers ("building from source is preferred for reproducibility and eliminates supply-chain risk from a pre-built download"). Neithervendor/gvproxy/go.sumnor any.github/workflows/build step appears in this diff.This is low-severity because the pre-built binary in #503 may be an accepted alternative, but if Go-source vendoring is still required per the task sub-issue, it should either be included here or the task scope amended with a note that #503 satisfies the intent.