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