bastion 0.60.0
ci / personal-data (push) Successful in 4s
ci / test (push) Successful in 3m36s
ci / fuzz (push) Successful in 3m35s

This commit is contained in:
Privatae
2026-11-02 00:10:58 +00:00
parent 4a5c310482
commit 4f8285ef18
100 changed files with 11537 additions and 840 deletions
+8 -2
View File
@@ -28,6 +28,12 @@ import (
func agentsTestBox(t *testing.T, seen ...agentObs) {
t.Helper()
uiTestConfigDir(t)
// Marking takes the owner's code (markCodeRefusal); the box has one.
d, err := machineFactorDir()
if err != nil {
t.Fatal(err)
}
enrolFactorAt(t, d, machineTestSecret)
prev := observedAgents
t.Cleanup(func() { observedAgents = prev })
observedAgents = func() ([]agentObs, error) { return seen, nil }
@@ -122,7 +128,7 @@ func TestMarkingAndUnmarkingThroughThePage(t *testing.T) {
cookie := uiSignedIn(t, u)
id := sanctionIdentityOf(mine).fingerprint()
w := uiPost(t, h, "/agents/mark", url.Values{"id": {id}}, cookie)
w := uiPost(t, h, "/agents/mark", url.Values{"id": {id}, "code": {codeFor(t, machineTestSecret)}}, cookie)
if w.Code != http.StatusOK {
t.Fatalf("mark = %d: %s", w.Code, w.Body.String())
}
@@ -207,7 +213,7 @@ func TestNothingOnThisPageCanTerminateAnything(t *testing.T) {
id := sanctionIdentityOf(mine).fingerprint()
body := agentsGet(t, h, "/agents", cookie).Body.String()
uiPost(t, h, "/agents/mark", url.Values{"id": {id}}, cookie)
uiPost(t, h, "/agents/mark", url.Values{"id": {id}, "code": {codeFor(t, machineTestSecret)}}, cookie)
uiPost(t, h, "/agents/unmark", url.Values{"id": {id}}, cookie)
if len(killed) != 0 {
t.Fatalf("this page terminated %v — containment is host-directed and marking "+