MCPcopy Create free account
hub / github.com/cloudtools/ssh-cert-authority / TestSaveRequestAutoSign

Function TestSaveRequestAutoSign

sign_certd_test.go:182–200  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestSaveRequestAutoSign(t *testing.T) {
183 allConfig := SetupSignerdConfig(-1, 0)
184 environment := "testing"
185 envConfig := allConfig[environment]
186 requestHandler := makeCertRequestHandler(allConfig)
187
188 pubKey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(boringUserCertString))
189 if err != nil {
190 t.Fatalf("Parsing canned cert failed: %v", err)
191 }
192 cert := pubKey.(*ssh.Certificate)
193 signed, err := requestHandler.saveSigningRequest(envConfig, environment, "reason: testing", "DEADBEEFDEADBEEF", 1, cert)
194 if err != nil {
195 t.Fatalf("Should have succeeded. Failed with: %v", err)
196 }
197 if !signed {
198 t.Fatal("Should have auto signed. But we didn't.")
199 }
200}
201
202func TestSaveRequestValidCert(t *testing.T) {
203 allConfig := SetupSignerdConfig(1, 0)

Callers

nothing calls this directly

Calls 3

SetupSignerdConfigFunction · 0.85
makeCertRequestHandlerFunction · 0.85
saveSigningRequestMethod · 0.80

Tested by

no test coverage detected