MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / TestEnrollTokenNotFound

Function TestEnrollTokenNotFound

internal/serverapi/enroll_test.go:111–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestEnrollTokenNotFound(t *testing.T) {
112 ca := newTestCA(t)
113 store := enrolltokens.NewMemoryStore()
114 mux := http.NewServeMux()
115 RegisterEnrollEndpoint(mux, ca, store, "https://x")
116
117 w := doEnroll(t, mux, enrollRequest{NodeID: "n", CSRPem: newTestCSR(t, "n"), Token: "missing"})
118 if w.Code != http.StatusUnauthorized {
119 t.Fatalf("status=%d", w.Code)
120 }
121}
122
123func TestEnrollTokenAlreadyConsumed(t *testing.T) {
124 ca := newTestCA(t)

Callers

nothing calls this directly

Calls 5

NewMemoryStoreFunction · 0.92
RegisterEnrollEndpointFunction · 0.85
doEnrollFunction · 0.85
newTestCSRFunction · 0.85
newTestCAFunction · 0.70

Tested by

no test coverage detected