Add ability to lowercase the LDAP name for use as PG role name
This commit is contained in:
parent
f5be151bd6
commit
1df48950f5
@ -21,6 +21,8 @@ ldap_users:
|
|||||||
filter: (&(objectClass=person)(objectClass=organizationalPerson)(givenName=*)(sn=*)(sAMAccountName=*))
|
filter: (&(objectClass=person)(objectClass=organizationalPerson)(givenName=*)(sn=*)(sAMAccountName=*))
|
||||||
# this attribute is used as PG role name
|
# this attribute is used as PG role name
|
||||||
name_attribute: sAMAccountName
|
name_attribute: sAMAccountName
|
||||||
|
# lowercase name for use as PG role name
|
||||||
|
lowercase_name: true
|
||||||
|
|
||||||
# Search parameters for LDAP groups which should be synchronized
|
# Search parameters for LDAP groups which should be synchronized
|
||||||
ldap_groups:
|
ldap_groups:
|
||||||
@ -28,6 +30,8 @@ ldap_groups:
|
|||||||
filter: (cn=company.*)
|
filter: (cn=company.*)
|
||||||
# this attribute is used as PG role name
|
# this attribute is used as PG role name
|
||||||
name_attribute: cn
|
name_attribute: cn
|
||||||
|
# lowercase name for use as PG role name
|
||||||
|
lowercase_name: false
|
||||||
# this attribute must reference to all member DN's of the given group
|
# this attribute must reference to all member DN's of the given group
|
||||||
member_attribute: member
|
member_attribute: member
|
||||||
|
|
||||||
|
@ -17,6 +17,9 @@ mapping:
|
|||||||
"name_attribute":
|
"name_attribute":
|
||||||
type: str
|
type: str
|
||||||
required: yes
|
required: yes
|
||||||
|
"lowercase_name":
|
||||||
|
type: bool
|
||||||
|
required: no
|
||||||
|
|
||||||
"ldap_groups":
|
"ldap_groups":
|
||||||
type: map
|
type: map
|
||||||
@ -31,6 +34,9 @@ mapping:
|
|||||||
"name_attribute":
|
"name_attribute":
|
||||||
type: str
|
type: str
|
||||||
required: yes
|
required: yes
|
||||||
|
"lowercase_name":
|
||||||
|
type: bool
|
||||||
|
required: no
|
||||||
"member_attribute":
|
"member_attribute":
|
||||||
type: str
|
type: str
|
||||||
required: yes
|
required: yes
|
||||||
|
@ -85,6 +85,7 @@ class Application
|
|||||||
log.warn "user attribute #{ldap_user_conf[:name_attribute].inspect} not defined for #{entry.dn}"
|
log.warn "user attribute #{ldap_user_conf[:name_attribute].inspect} not defined for #{entry.dn}"
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
name.downcase! if ldap_user_conf[:lowercase_name]
|
||||||
|
|
||||||
log.info "found user-dn: #{entry.dn}"
|
log.info "found user-dn: #{entry.dn}"
|
||||||
user = LdapRole.new name, entry.dn
|
user = LdapRole.new name, entry.dn
|
||||||
@ -111,6 +112,7 @@ class Application
|
|||||||
log.warn "user attribute #{ldap_group_conf[:name_attribute].inspect} not defined for #{entry.dn}"
|
log.warn "user attribute #{ldap_group_conf[:name_attribute].inspect} not defined for #{entry.dn}"
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
name.downcase! if ldap_group_conf[:lowercase_name]
|
||||||
|
|
||||||
log.info "found group-dn: #{entry.dn}"
|
log.info "found group-dn: #{entry.dn}"
|
||||||
group = LdapRole.new name, entry.dn, entry[ldap_group_conf[:member_attribute]]
|
group = LdapRole.new name, entry.dn, entry[ldap_group_conf[:member_attribute]]
|
||||||
|
Reference in New Issue
Block a user