Private pair authentication to api
evgmoskalenko opened this issue · 3 comments
evgmoskalenko commented
Hi, are you planning to add private pair authentication for rest client?
KeyPair ("client-crt.pem", "client-key.pem")
evgmoskalenko commented
func TestHealthy(t *testing.T) {
cert, err := tls.LoadX509KeyPair(settings.Get().ClientCRT, settings.Get().ClientKey)
if err != nil {
log.Fatalf("server: loadkeys: %s", err)
}
tr := &http.Transport{
TLSClientConfig: &tls.Config{
Certificates: []tls.Certificate{cert},
InsecureSkipVerify: true,
},
}
client := &http.Client{
Transport: tr,
}
t.Run("Validate healthcheck status", func(t *testing.T) {
apitest.New().
EnableNetworking(client).
Get("/api/health/").
Expect(t).
Status(http.StatusOK).
Assert(jsonpath.Equal(`$.db_default.status`, "SUCCESS")).
End()
})
}
steinfletcher commented
Hi @evgmoskalenko. I would be happy to take a PR for this. It's not something I have a use case for right now so I am not planning on implementing it myself. Many thanks
steinfletcher commented
Closing due to inactivity