isTrustedClientIP returns true if the given IP address is in the list of trusted IP ranges.
(ipAddr netip.Addr, trusted []netip.Prefix)
| 1079 | // isTrustedClientIP returns true if the given IP address is |
| 1080 | // in the list of trusted IP ranges. |
| 1081 | func isTrustedClientIP(ipAddr netip.Addr, trusted []netip.Prefix) bool { |
| 1082 | return slices.ContainsFunc(trusted, func(prefix netip.Prefix) bool { |
| 1083 | return prefix.Contains(ipAddr) |
| 1084 | }) |
| 1085 | } |
| 1086 | |
| 1087 | // trustedRealClientIP finds the client IP from the request assuming it is |
| 1088 | // from a trusted client. If there is no client IP headers, then the |
no outgoing calls
no test coverage detected