// Get IPs and subnets from configuration and parse them
// into comparable things.
// If IP address was specified without network mask - assume /32.
varsubnets[]*net.IPNet
allowedIPs:=configuration.Cfg.GetAllowedIPs()
for_,ip:=rangeallowedIPs{
ipToParse:=ip
if!strings.Contains(ip,"/"){
ipToParse=ip+"/32"
}
_,net,err:=net.ParseCIDR(ipToParse)
iferr!=nil{
log.Error().Err(err).Str("subnet",ipToParse).Msg("Failed to parse CIDR. /_api/ endpoint won't be accessible, this should be fixed manually in configuration file!")