]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapo-constraint.5
fix previous commit (person does not allow givenName; ITS#5704)
[openldap] / doc / man / man5 / slapo-constraint.5
1 .TH SLAPO-CONSTRAINT 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 2005-2006 Hewlett-Packard Company
3 .\" Copyright 2006-2008 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .\" $OpenLDAP$
6 .SH NAME
7 slapo-constraint \- Attribute Constraint Overlay to slapd
8 .SH SYNOPSIS
9 ETCDIR/slapd.conf
10 .SH DESCRIPTION
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.
15 .LP
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.
19 .LP
20 It constrains only LDAP adds and modify commands and only seeks to
21 control the add and modify value of a modify request.
22 .SH CONFIGURATION
23 This
24 .B slapd.conf
25 option applies to the constraint overlay.
26 It should appear after the
27 .B overlay
28 directive.
29 .TP
30 .B constraint_attribute <attribute_name>[,...] <type> <value> [<extra> [...]]
31 Specifies the constraint which should apply to the comma-separated
32 attribute list named as the first parameter.
33 Two types of constraint are currently supported -
34 .BR regex ,
35 .BR size ,
36 .BR count ,
37 .BR uri ,
38 and
39 .BR set .
40
41 The parameter following the
42 .B regex
43 type is a Unix style regular expression (See
44 .BR regex (7)
45 ). The parameter following the
46 .B uri
47 type is an LDAP URI. The URI will be evaluated using an internal search.
48 It must not include a hostname, and it must include a list of attributes
49 to evaluate.
50
51 The parameter following the
52 .B set
53 type is a string that is interpreted according to the syntax in use
54 for ACL sets.  This allows to construct constraints based on the contents
55 of the entry.
56
57 The 
58 .B size
59 type can be used to enforce a limit on an attribute length, and the
60 .B count
61 type limits the number of values of an attribute.
62
63 Extra parameters can occur in any order after those described above.
64 .RS
65 .TP
66 .B <extra> : restrict=<uri>
67 .RE
68
69 .RS
70 This extra parameter allows to restrict the application of the corresponding
71 constraint only to entries that match the
72 .IR base ,
73 .I scope
74 and
75 .I filter
76 portions of the LDAP URI.
77 The
78 .IR base ,
79 if present, must be within the naming context of the database.
80 The
81 .I scope
82 is only used when the
83 .I base
84 is present; it defaults to
85 .BR base .
86 The other parameters of the URI are not allowed.
87 .RE
88
89 .LP
90 Any attempt to add or modify an attribute named as part of the
91 constraint overlay specification which does not fit the 
92 constraint listed will fail with a
93 LDAP_CONSTRAINT_VIOLATION error.
94 .SH EXAMPLES
95 .LP
96 .RS
97 .nf
98 overlay constraint
99 constraint_attribute jpegPhoto size 131072
100 constraint_attribute userPassword count 3
101 constraint_attribute mail regex ^[:alnum:]+@mydomain.com$
102 constraint_attribute title uri
103   ldap:///dc=catalog,dc=example,dc=com?title?sub?(objectClass=titleCatalog)
104 constraint_attribute cn,sn,givenName set
105   "(this/givenName + [ ] + this/sn) & this/cn"
106   restrict="ldap:///ou=People,dc=example,dc=com??sub?(objectClass=inetOrgPerson)"
107 .fi
108
109 .RE
110 A specification like the above would reject any
111 .B mail
112 attribute which did not look like
113 .BR "<alpha-numeric string>@mydomain.com" .
114 It would also reject any
115 .B title
116 attribute whose values were not listed in the
117 .B title
118 attribute of any
119 .B titleCatalog
120 entries in the given scope.
121 Finally, it requires the values of the attribute
122 .B cn
123 to be constructed by pairing values of the attributes
124 .B sn
125 and 
126 .BR givenName ,
127 separated by a space, but only for entries derived from the objectClass
128 .BR inetOrgPerson .
129 .RE
130 .SH FILES
131 .TP
132 ETCDIR/slapd.conf
133 default slapd configuration file
134 .SH SEE ALSO
135 .BR slapd.conf (5).
136 .SH ACKNOWLEDGEMENTS
137 This module was written in 2005 by Neil Dunbar of Hewlett-Packard and subsequently
138 extended by Howard Chu and Emmanuel Dreyfus.
139 .so ../Project