Support configurable TLS probes in the API and dashboard

This commit is contained in:
ayurishchev committed 2026-11-20 21:15:22 +03:00
1 parent 0bde5627f0
commit c7fdd2c430
38 files changed
+495 -203

No files matched your search

+6 -2
View File
@@ -15,6 +15,8 @@ import (
"sync"
"testing"
"time"
"cloudipvalidator/internal/inbound"
)
// fakeControlAPI is a minimal in-memory stand-in for control-api's
@@ -35,6 +37,7 @@ type fakeControlAPI struct {
fipSettleSeconds int
inboundPorts []int
inboundICMP bool
inboundTLS []inbound.TLSCheck
historyRetentionCycles int
selfCheckMaxAttempts int
@@ -661,7 +664,7 @@ func (f *fakeControlAPI) handler() http.Handler {
mux.HandleFunc("GET /api/v1/admin/config/inbound-checks", func(w http.ResponseWriter, r *http.Request) {
f.mu.Lock()
defer f.mu.Unlock()
writeJSON(w, http.StatusOK, inboundChecksDTO{Ports: f.inboundPorts, ICMP: f.inboundICMP})
writeJSON(w, http.StatusOK, inboundChecksDTO{Ports: f.inboundPorts, ICMP: f.inboundICMP, TLSChecks: f.inboundTLS})
})
mux.HandleFunc("PUT /api/v1/admin/config/inbound-checks", func(w http.ResponseWriter, r *http.Request) {
f.mu.Lock()
@@ -676,7 +679,8 @@ func (f *fakeControlAPI) handler() http.Handler {
}
f.inboundPorts = req.Ports
f.inboundICMP = req.ICMP
writeJSON(w, http.StatusOK, inboundChecksDTO{Ports: f.inboundPorts, ICMP: f.inboundICMP})
f.inboundTLS = req.TLSChecks
writeJSON(w, http.StatusOK, req)
})
mux.HandleFunc("GET /api/v1/admin/config/validators", func(w http.ResponseWriter, r *http.Request) {