fix(extension): confine egress only for packages that declare egress hosts

This commit is contained in:
sam committed 2026-10-07 22:15:06 +11:00
1 parent 1e062fd7f0
commit 4673b435b7
7 files changed
+67 -30

No files matched your search

-1
View File
@@ -143,7 +143,6 @@ const tones = {
</AlertDialogHeader>
<ul class="font-mono text-xs">
<li v-for="line in accepting ? grants(accepting.declared) : []" :key="line">{{ line }}</li>
<li v-if="accepting && !grants(accepting.declared).length">Nothing beyond its own process.</li>
</ul>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
+3 -1
View File
@@ -58,7 +58,9 @@ export function grants(authority: Authority): string[] {
["tool", authority.tools],
["env", authority.env],
];
return labelled.flatMap(([label, values]) => values.map((value) => `${label}: ${value}`));
const lines = labelled.flatMap(([label, values]) => values.map((value) => `${label}: ${value}`));
// A package that declares no egress hosts runs on the host's network.
return authority.egress_hosts.length ? lines : ["network: unrestricted", ...lines];
}
/** What an extension needs from the operator next, in the order it happens. */