fix: suppress deprecation warning for userAttr when not set (#4539)

Signed-off-by: maksim.nabokikh <max.nabokih@gmail.com>
This commit is contained in:
Maksim Nabokikh
2026-02-13 13:19:20 +01:00
committed by GitHub
parent 76d7ed49ed
commit 489e37d07a
+3 -1
View File
@@ -198,7 +198,9 @@ func userMatchers(c *Config, logger *slog.Logger) []UserMatcher {
return c.GroupSearch.UserMatchers
}
logger.Warn(`use "groupSearch.userMatchers" option instead of "userAttr/groupAttr" fields`, "deprecated", true)
if c.GroupSearch.UserAttr != "" || c.GroupSearch.GroupAttr != "" {
logger.Warn(`use "groupSearch.userMatchers" option instead of "userAttr/groupAttr" fields`, "deprecated", true)
}
return []UserMatcher{
{
UserAttr: c.GroupSearch.UserAttr,