Migration to kubernetes + vault-agent

This commit is contained in:
2025-01-13 17:00:23 +01:00
parent 4219a7d001
commit 60ab4ff110
13 changed files with 197 additions and 90 deletions

View File

@@ -50,9 +50,13 @@ func InitAllowedIPList(l string) []netip.Prefix {
}
// IPAllowed check if the IP is authorized to do BAN/PURGE requests
func IPAllowed(ip netip.Addr) bool {
func IPAllowed(ip string) bool {
ipAddr, err := netip.ParseAddr(ip)
if err != nil {
log.Printf("Ip address wrong format %s", err)
}
for i := 0; i < len(ClientList); i++ {
if ClientList[i].Contains(ip) {
if ClientList[i].Contains(ipAddr) {
return true
}
}