v0.4.1 authentication impelemented, not tested and docs not updated

This commit is contained in:
2025-09-23 12:03:42 -04:00
parent 4248d399b3
commit 45b2093569
21 changed files with 1779 additions and 453 deletions

View File

@ -3,7 +3,6 @@ package config
import (
"fmt"
"net"
"strings"
)
@ -29,37 +28,6 @@ type RateLimitConfig struct {
MaxEntrySizeBytes int64 `toml:"max_entry_size_bytes"`
}
func validateNetAccess(pipelineName string, cfg *NetAccessConfig) error {
if cfg == nil {
return nil
}
// Validate CIDR notation
for _, cidr := range cfg.IPWhitelist {
if !strings.Contains(cidr, "/") {
cidr = cidr + "/32"
}
if _, _, err := net.ParseCIDR(cidr); err != nil {
if net.ParseIP(cidr) == nil {
return fmt.Errorf("pipeline '%s': invalid IP whitelist entry: %s", pipelineName, cidr)
}
}
}
for _, cidr := range cfg.IPBlacklist {
if !strings.Contains(cidr, "/") {
cidr = cidr + "/32"
}
if _, _, err := net.ParseCIDR(cidr); err != nil {
if net.ParseIP(cidr) == nil {
return fmt.Errorf("pipeline '%s': invalid IP blacklist entry: %s", pipelineName, cidr)
}
}
}
return nil
}
func validateRateLimit(pipelineName string, cfg *RateLimitConfig) error {
if cfg == nil {
return nil