X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fnaming%2FLdapAttrs.java;h=1a6642f05ace073efe66571448ceb252a68ed94a;hb=3c1cdc594d954520b14646102b366290bdad58c7;hp=5253579e428313db8b1883c681e800fab6d5aec2;hpb=55d1a78150b6be0004f6bcb28703bcdd6daf55a1;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/naming/LdapAttrs.java b/org.argeo.util/src/org/argeo/util/naming/LdapAttrs.java index 5253579e4..1a6642f05 100644 --- a/org.argeo.util/src/org/argeo/util/naming/LdapAttrs.java +++ b/org.argeo.util/src/org/argeo/util/naming/LdapAttrs.java @@ -2,6 +2,10 @@ package org.argeo.util.naming; import java.util.function.Supplier; +import javax.xml.namespace.QName; + +import org.argeo.util.internal.DisplayQName; + /** * Standard LDAP attributes as per:
* - Standard LDAP
@@ -9,7 +13,7 @@ import java.util.function.Supplier; * "https://github.com/krb5/krb5/blob/master/src/plugins/kdb/ldap/libkdb_ldap/kerberos.schema">Kerberos * LDAP (partial) */ -public enum LdapAttrs implements SpecifiedName, Supplier, QNamed { +public enum LdapAttrs implements SpecifiedName, Supplier { /** */ uid("0.9.2342.19200300.100.1.1", "RFC 4519"), /** */ @@ -285,6 +289,19 @@ public enum LdapAttrs implements SpecifiedName, Supplier, QNamed { countryOfCitizenship("1.3.6.1.5.5.7.9.4", "RFC 2985"), /** */ countryOfResidence("1.3.6.1.5.5.7.9.5", "RFC 2985"), + + // RFC 2307bis (partial) + /** */ + uidNumber("1.3.6.1.1.1.1.0", "RFC 2307bis"), + /** */ + gidNumber("1.3.6.1.1.1.1.1", "RFC 2307bis"), + /** */ + homeDirectory("1.3.6.1.1.1.1.3", "RFC 2307bis"), + /** */ + loginShell("1.3.6.1.1.1.1.4", "RFC 2307bis"), + /** */ + memberUid("1.3.6.1.1.1.1.12", "RFC 2307bis"), + // ; @@ -293,10 +310,16 @@ public enum LdapAttrs implements SpecifiedName, Supplier, QNamed { // private final static String LDAP_ = "ldap:"; private final String oid, spec; + private final QName value; LdapAttrs(String oid, String spec) { this.oid = oid; this.spec = spec; + this.value = new DisplayQName(LdapObjs.LDAP_NAMESPACE_URI, name(), LdapObjs.LDAP_DEFAULT_PREFIX); + } + + public QName qName() { + return value; } @Override @@ -319,19 +342,9 @@ public enum LdapAttrs implements SpecifiedName, Supplier, QNamed { return get(); } - public String get() { - String prefix = getDefaultPrefix(); - return prefix != null ? prefix + ":" + name() : name(); - } - @Override - public String getDefaultPrefix() { - return LdapObjs.LDAP_DEFAULT_PREFIX; - } - - @Override - public String getNamespace() { - return LdapObjs.LDAP_NAMESPACE_URI; + public String get() { + return LdapObjs.LDAP_DEFAULT_PREFIX + ":" + name(); } @Override