New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions should normalize attribute names #3474
Comments
Comment from mhonek (@kenoh) at 2019-05-31 10:54:20 I believe better wording would be ... functions should normalize attribute names. Because currently the issue is they are case sensitive. |
Comment from mhonek (@kenoh) at 2019-05-31 10:54:21 Metadata Update from @kenoh:
|
Comment from vashirov (@vashirov) at 2019-05-31 12:09:28 It's a twofold issue... Functions should normalize attribute names for their internal representation (see 50373), but they should respect the case provided by the user and returned by the server. |
Comment from firstyear (@Firstyear) at 2019-06-03 09:43:32 @vashirov I think even if you were to do ldapsearch ... '(uid=name)' CN, you would get back the attribute as "cn: name". So Ithink that just normalising and deduping on the function call is fine, because we should respect the case the server returns to us in the result. |
Comment from vashirov (@vashirov) at 2019-06-03 09:58:21
This is true for openldap, but 389-ds returns attribute name as requested:
|
Comment from tbordaz (@tbordaz) at 2019-06-03 10:00:12 That is right it returns the first requested attribute name
|
Comment from firstyear (@Firstyear) at 2019-06-03 10:41:03 So then our normalise just has to dedup and remove the subsequent attribute names on request then? |
Comment from tbordaz (@tbordaz) at 2019-06-03 10:59:33 I think that if 'Accounts' wants to mimic the 389-ds behavior, it could build a list of requested attribute as they are provided by the client application. An attribute is added in the list at the condition it is not already present (case insensitive). Then when returning the attribute name/value, 'Accounts' returns the name as present in the list. |
Comment from firstyear (@Firstyear) at 2019-06-03 11:08:31 Actually we'd do this in DSLdapObject because then every type would get the behaviour that we want here. |
Comment from mreynolds (@mreynolds389) at 2019-06-13 17:20:18 Metadata Update from @mreynolds389:
|
Comment from mreynolds (@mreynolds389) at 2020-02-26 16:22:11 Metadata Update from @mreynolds389:
|
Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/50416
Issue Description:
Functions should normalize attribute names
with search_s:
topo.standalone.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, F4, ['cn', 'Cn', 'CN'])
[dn: uid=bhall,ou=People,dc=example,dc=com
cn: Benjamin Hall ]
with filter:
Accounts(topo.standalone, DEFAULT_SUFFIX).filter(F4)[0].get_attrs_vals_utf8(['cn', 'Cn', 'CN'])
{'cn': ['Benjamin Hall'], 'Cn': ['Benjamin Hall'], 'CN': ['Benjamin Hall']}
This filter should return only 'cn' value not Cn, CN
The text was updated successfully, but these errors were encountered: