mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
app/vmauth: allow -auth.config without users
section of unauthorized_user
section is present here
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4083
This commit is contained in:
parent
6aa8029f30
commit
b22bcb6f0a
1 changed files with 2 additions and 2 deletions
|
@ -392,8 +392,8 @@ func parseAuthConfig(data []byte) (*AuthConfig, error) {
|
||||||
|
|
||||||
func parseAuthConfigUsers(ac *AuthConfig) (map[string]*UserInfo, error) {
|
func parseAuthConfigUsers(ac *AuthConfig) (map[string]*UserInfo, error) {
|
||||||
uis := ac.Users
|
uis := ac.Users
|
||||||
if len(uis) == 0 {
|
if len(uis) == 0 && ac.UnauthorizedUser == nil {
|
||||||
return nil, fmt.Errorf("`users` section cannot be empty in AuthConfig")
|
return nil, fmt.Errorf("Missing `users` or `unauthorized_user` sections")
|
||||||
}
|
}
|
||||||
byAuthToken := make(map[string]*UserInfo, len(uis))
|
byAuthToken := make(map[string]*UserInfo, len(uis))
|
||||||
for i := range uis {
|
for i := range uis {
|
||||||
|
|
Loading…
Reference in a new issue