feat: add default roles to LDAP config (#114) (#130)

* chore: add anonymous roles to fix the issue (#114)

* docs: add release notes

* chore: change config key

* docs: update release notes

* chore: update comment

---------

Co-authored-by: hardy <luohf@infinilabs.com>
This commit is contained in:
Hardy 2025-02-13 23:18:21 +08:00 committed by GitHub
parent 1b6855673b
commit ea73bf9510
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@ Information about release notes of INFINI Console is provided here.
- Add Copy request to alerting chart - Add Copy request to alerting chart
- Add credential settings for agent in enrolling agent - Add credential settings for agent in enrolling agent
- Add collection mode to cluster editing - Add collection mode to cluster editing
- Add default roles to fix the issue (#114) (#130)
## 1.28.1 (2025-01-24) ## 1.28.1 (2025-01-24)

View File

@ -23,6 +23,7 @@ title: "版本历史"
- 在注册 Agent 中新增 Agent 凭据设置 - 在注册 Agent 中新增 Agent 凭据设置
- 在集群编辑中新增采集模式 - 在集群编辑中新增采集模式
- 当使用 Easysearch 存储指标时,自动为系统集群创建 Agent 指标写入最小权限用户 (#120) - 当使用 Easysearch 存储指标时,自动为系统集群创建 Agent 指标写入最小权限用户 (#120)
- 修复 LDAP 用户映射增加默认权限组 (#114) (#130)
## 1.28.1 (2025-01-24) ## 1.28.1 (2025-01-24)

View File

@ -48,7 +48,8 @@ type LDAPConfig struct {
UidAttribute string `config:"uid_attribute"` UidAttribute string `config:"uid_attribute"`
GroupAttribute string `config:"group_attribute"` GroupAttribute string `config:"group_attribute"`
RoleMapping struct { DefaultRoles []string `config:"default_roles"`
RoleMapping struct {
Group map[string][]string `config:"group"` Group map[string][]string `config:"group"`
Uid map[string][]string `config:"uid"` Uid map[string][]string `config:"uid"`
} `config:"role_mapping"` } `config:"role_mapping"`
@ -93,6 +94,9 @@ func (r *LDAPRealm) mapLDAPRoles(authInfo auth.Info) []string {
} }
} }
//auto append default roles
ret = append(ret, r.config.DefaultRoles...)
return ret return ret
} }