VictoriaMetrics/app/vmauth
LHHDZ 41e4135371
app/vmauth: fix discovering backend IPs when url_prefix contains hostname with srv+ prefix (#6401)
This change fixes the following panic:
```
2024-06-04T11:16:52.899Z        warn    app/vmauth/auth_config.go:353   cannot discover backend SRV records for http://srv+localhost:8080: lookup localhost on 10.100.10.4:53: server misbehaving; use it literally
panic: runtime error: integer divide by zero

goroutine 9 [running]:
github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver.handlerWrapper.func1()
        /Users/lhhdz/wd/projects/go/VictoriaMetrics/lib/httpserver/httpserver.go:291 +0x58
panic({0x103115100?, 0x10338d700?})
        /Users/lhhdz/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.3.darwin-arm64/src/runtime/panic.go:770 +0x124
main.getLeastLoadedBackendURL({0x0?, 0x22?, 0x1400014757b?}, 0x1400013c120?)
        /Users/lhhdz/wd/projects/go/VictoriaMetrics/app/vmauth/auth_config.go:473 +0x210
main.(*URLPrefix).getBackendURL(0x140000aa080)
        /Users/lhhdz/wd/projects/go/VictoriaMetrics/app/vmauth/auth_config.go:312 +0xb8
```

---------

Co-authored-by: Haley Wang <haley@victoriametrics.com>
2024-06-12 11:47:44 +02:00
..
deployment app/vmauth: add initial version of vmauth. See https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmauth/README.md for details 2020-05-05 10:56:20 +03:00
multiarch all: run apk update && apk upgrade in base Alpine Docker image in order to get all the recent security fixes 2023-02-09 14:03:02 -08:00
auth_config.go app/vmauth: fix discovering backend IPs when url_prefix contains hostname with srv+ prefix (#6401) 2024-06-12 11:47:44 +02:00
auth_config_test.go app/vmauth: add test for LeastLoaded balance policy (#6144) 2024-04-30 10:30:14 +02:00
example_config.yml app/vmauth: adds metric_labels and backend_errors counter (#5585) 2024-01-22 01:09:51 +02:00
example_config_ent.yml vmauth: add browser authorization request for http requests without… (#5234) 2023-11-01 21:00:52 +01:00
main.go app/vmauth: adds idleConnTimeout flag, retry trivial errors (#6388) 2024-06-10 12:41:51 +02:00
main_test.go app/vmauth: retry requests at other backends on 5xx response status codes 2023-09-08 00:47:57 +02:00
Makefile Add build support for loong64 (#6222) 2024-05-10 14:32:05 +02:00
README.md all: replace old https://docs.victoriametrics.com/vmauth.html url with the new one - https://docs.victoriametrics.com/vmauth/ 2024-04-18 01:50:16 +02:00
target_url.go app/vmauth: follow-up for b155b20de4 2024-04-17 14:53:20 +02:00
target_url_test.go app/vmauth: fix discovering backend IPs when url_prefix contains hostname with srv+ prefix (#6401) 2024-06-12 11:47:44 +02:00

See vmauth docs here.

vmauth docs can be edited at docs/vmauth.md.