MatchRemoteIP matches based on the remote IP of the connection. Specific IPs or CIDR ranges can be specified. Note that IPs can sometimes be spoofed, so do not rely on this as a replacement for actual authentication.
| 308 | // Note that IPs can sometimes be spoofed, so do not rely |
| 309 | // on this as a replacement for actual authentication. |
| 310 | type MatchRemoteIP struct { |
| 311 | // The IPs or CIDR ranges to match. |
| 312 | Ranges []string `json:"ranges,omitempty"` |
| 313 | |
| 314 | // The IPs or CIDR ranges to *NOT* match. |
| 315 | NotRanges []string `json:"not_ranges,omitempty"` |
| 316 | |
| 317 | cidrs []netip.Prefix |
| 318 | notCidrs []netip.Prefix |
| 319 | logger *zap.Logger |
| 320 | } |
| 321 | |
| 322 | // CaddyModule returns the Caddy module information. |
| 323 | func (MatchRemoteIP) CaddyModule() caddy.ModuleInfo { |
nothing calls this directly
no outgoing calls
no test coverage detected