mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
- adds the option to use ldap groups for authorization in combination with an auth proxy - adds an option to limit where auth proxy requests come from by configure a list of ip's - fixes a security issue, session could be reused
24 lines
345 B
Go
24 lines
345 B
Go
package login
|
|
|
|
type LdapUserInfo struct {
|
|
DN string
|
|
FirstName string
|
|
LastName string
|
|
Username string
|
|
Email string
|
|
MemberOf []string
|
|
}
|
|
|
|
func (u *LdapUserInfo) isMemberOf(group string) bool {
|
|
if group == "*" {
|
|
return true
|
|
}
|
|
|
|
for _, member := range u.MemberOf {
|
|
if member == group {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|