fix(permissions): validate network access flow

This commit is contained in:
2026-07-26 10:52:46 +02:00
parent 3047dc9195
commit 13fb538880
70 changed files with 4784 additions and 158 deletions

View File

@ -344,7 +344,9 @@ function NetworkPermissionEditor({
const wanted = resolved?.wanted ?? source?.network ?? inherited?.network ?? null;
const effective = resolved?.effective ?? null;
const runtimeLocked = resolved?.runtimeLock.state === "locked";
const lockReason = resolved?.runtimeLock.reason ?? resolved?.control.reason ?? null;
const runtimeReadOnly = resolved?.runtimeControl.mode === "readOnly";
const runtimeReason = resolved?.runtimeLock.reason ?? resolved?.runtimeControl.reason ?? null;
const runtimeUnobserved = resolved?.runtimeLock.state === "none" && runtimeReadOnly;
return (
<section className="rounded-md border border-border bg-surface">
@ -371,7 +373,15 @@ function NetworkPermissionEditor({
/>
<StatusLine
label="Runtime"
value={runtimeLocked ? "Verrouillé par le runtime" : "Aucun verrou connu"}
value={
runtimeLocked
? "Runtime verrouillé"
: runtimeUnobserved
? "Aucun runtime actif"
: runtimeReadOnly
? "Runtime en lecture seule"
: "Runtime modifiable"
}
/>
<StatusLine
label="Control"
@ -381,7 +391,19 @@ function NetworkPermissionEditor({
{readOnly && (
<p className="rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning">
{lockReason ?? "Le runtime actif ne permet pas de modifier cette permission."}
{resolved?.control.reason ?? "Cette configuration réseau est en lecture seule."}
</p>
)}
{!readOnly && runtimeUnobserved && (
<p className="rounded-md border border-primary/30 bg-primary/10 px-3 py-2 text-xs text-primary">
Aucun runtime actif. La configuration sera appliquée au prochain lancement.
</p>
)}
{!readOnly && runtimeLocked && (
<p className="rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning">
{runtimeReason ?? "Le runtime actif expose un état réseau en lecture seule."}
</p>
)}