Support configurable TLS probes in the API and dashboard
This commit is contained in:
1 parent
0bde5627f0
commit
c7fdd2c430
38 files changed
+495
-203
No files matched your search
@@ -14,10 +14,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"cloudipvalidator/internal/inbound"
|
||||
|
||||
"cloudipvalidator/internal/config"
|
||||
"cloudipvalidator/internal/db"
|
||||
"cloudipvalidator/internal/openstack"
|
||||
@@ -857,18 +860,16 @@ func (o *Orchestrator) expectedCheckCount(ctx context.Context) (int, error) {
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
inbound, err := o.DB.GetInboundChecks(ctx)
|
||||
settings, err := o.DB.GetInboundChecks(ctx)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
inboundPerSite := len(inbound.Ports)
|
||||
if inbound.ICMP {
|
||||
inboundPerSite := len(settings.Ports) + len(inbound.EffectiveTLSChecks(settings.Ports, settings.TLSChecks))
|
||||
if settings.ICMP {
|
||||
inboundPerSite++
|
||||
}
|
||||
for _, p := range inbound.Ports {
|
||||
if p == 443 || p == 22 {
|
||||
inboundPerSite++
|
||||
}
|
||||
if slices.Contains(settings.Ports, 22) {
|
||||
inboundPerSite++
|
||||
}
|
||||
return egress + inboundPerSite*len(sites), nil
|
||||
}
|
||||
|
||||
@@ -703,7 +703,7 @@ func TestExpectedCheckCountReflectsInboundChecksConfigChange(t *testing.T) {
|
||||
// Shrink the inbound check config to a single TCP port, no ICMP — an
|
||||
// admin API change made between assignment and aggregation. Port 22
|
||||
// still auto-triggers the extra "ssh" check (see expectedCheckCount).
|
||||
if err := d.SetInboundChecks(ctx, []int{22}, false); err != nil {
|
||||
if err := d.SetInboundChecks(ctx, []int{22}, false, nil); err != nil {
|
||||
t.Fatalf("set inbound checks: %v", err)
|
||||
}
|
||||
|
||||
@@ -812,7 +812,7 @@ func TestExpectedCheckCountIncludesTLSAndSSHForPorts443And22(t *testing.T) {
|
||||
})
|
||||
_ = o.MarkEgressComplete(ctx, ip.ID)
|
||||
|
||||
if err := d.SetInboundChecks(ctx, []int{22, 443}, false); err != nil {
|
||||
if err := d.SetInboundChecks(ctx, []int{22, 443}, false, nil); err != nil {
|
||||
t.Fatalf("set inbound checks: %v", err)
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ func TestAggregationWaitsForTLSAndSSHResults(t *testing.T) {
|
||||
})
|
||||
_ = o.MarkEgressComplete(ctx, ip.ID)
|
||||
|
||||
if err := d.SetInboundChecks(ctx, []int{22, 443}, false); err != nil {
|
||||
if err := d.SetInboundChecks(ctx, []int{22, 443}, false, nil); err != nil {
|
||||
t.Fatalf("set inbound checks: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user