1 .TH SLAPO-CONSTRAINT 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2005-2006 Hewlett-Packard Company
3 .\" Copyright 2006-2014 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
7 slapo\-constraint \- Attribute Constraint Overlay to slapd
11 The constraint overlay is used to ensure that attribute values match
12 some constraints beyond basic LDAP syntax. Attributes can
13 have multiple constraints placed upon them, and all must be satisfied
14 when modifying an attribute value under constraint.
16 This overlay is intended to be used to force syntactic regularity upon
17 certain string represented data which have well known canonical forms,
18 like telephone numbers, post codes, FQDNs, etc.
20 It constrains only LDAP \fIadd\fP, \fImodify\fP and \fIrename\fP commands
21 and only seeks to control the \fIadd\fP and \fIreplace\fP values
22 of \fImodify\fP and \fIrename\fP requests.
24 No constraints are applied for operations performed with the
30 option applies to the constraint overlay.
31 It should appear after the
35 .B constraint_attribute <attribute_name>[,...] <type> <value> [<extra> [...]]
36 Specifies the constraint which should apply to the comma-separated
37 attribute list named as the first parameter.
38 Five types of constraint are currently supported -
46 The parameter following the
48 type is a Unix style regular expression (See
50 ). The parameter following the
52 type is an LDAP URI. The URI will be evaluated using an internal search.
53 It must not include a hostname, and it must include a list of attributes
56 The parameter following the
58 type is a string that is interpreted according to the syntax in use
59 for ACL sets. This allows to construct constraints based on the contents
64 type can be used to enforce a limit on an attribute length, and the
66 type limits the number of values of an attribute.
68 Extra parameters can occur in any order after those described above.
71 .B <extra> : restrict=<uri>
75 This extra parameter allows to restrict the application of the corresponding
76 constraint only to entries that match the
81 portions of the LDAP URI.
84 if present, must be within the naming context of the database.
89 is present; it defaults to
91 The other parameters of the URI are not allowed.
95 Any attempt to add or modify an attribute named as part of the
96 constraint overlay specification which does not fit the
97 constraint listed will fail with a
98 LDAP_CONSTRAINT_VIOLATION error.
104 constraint_attribute jpegPhoto size 131072
105 constraint_attribute userPassword count 3
106 constraint_attribute mail regex ^[[:alnum:]]+@mydomain.com$
107 constraint_attribute title uri
108 ldap:///dc=catalog,dc=example,dc=com?title?sub?(objectClass=titleCatalog)
109 constraint_attribute cn,sn,givenName set
110 "(this/givenName + [ ] + this/sn) & this/cn"
111 restrict="ldap:///ou=People,dc=example,dc=com??sub?(objectClass=inetOrgPerson)"
115 A specification like the above would reject any
117 attribute which did not look like
118 .BR "<alpha-numeric string>@mydomain.com" .
119 It would also reject any
121 attribute whose values were not listed in the
125 entries in the given scope. (Note that the
126 "dc=catalog,dc=example,dc=com" subtree ought to reside
127 in a separate database, otherwise the initial set of
128 titleCatalog entries could not be populated while the
129 constraint is in effect.)
130 Finally, it requires the values of the attribute
132 to be constructed by pairing values of the attributes
136 separated by a space, but only for entries derived from the objectClass
142 default slapd configuration file
145 .BR slapd\-config (5),
147 This module was written in 2005 by Neil Dunbar of Hewlett-Packard and subsequently
148 extended by Howard Chu and Emmanuel Dreyfus.