]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapo-constraint.5
minor typo and clarification
[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>
31 Specifies the constraint which should apply to the attribute named as
32 the first parameter.
33 Two types of constraint are currently supported -
34 .B regex ,
35 .B size ,
36 .B count ,
37 and
38 .BR uri .
39
40 The parameter following the
41 .B regex
42 type is a Unix style regular expression (See
43 .BR regex (7)
44 ). The parameter following the
45 .B uri
46 type is an LDAP URI. The URI will be evaluated using an internal search.
47 It must not include a hostname, and it must include a list of attributes
48 to evaluate.
49
50 The 
51 .B size
52 type can be used to enforce a limit on an attribute length, and the
53 .B count
54 type limits the number of values of an attribute.
55
56 Any attempt to add or modify an attribute named as part of the
57 constraint overlay specification which does not fit the 
58 constraint listed will fail with a
59 LDAP_CONSTRAINT_VIOLATION error.
60 .SH EXAMPLES
61 .LP
62 .RS
63 .nf
64 overlay constraint
65 constraint_attribute jpegPhoto size 131072
66 constraint_attribute userPassword count 3
67 constraint_attribute mail regex ^[:alnum:]+@mydomain.com$
68 constraint_attribute title uri
69   ldap:///dc=catalog,dc=example,dc=com?title?sub?(objectClass=titleCatalog)
70 .fi
71
72 A specification like the above would reject any
73 .B mail
74 attribute which did not look like
75 .BR "<alpha-numeric string>@mydomain.com" .
76 It would also reject any
77 .B title
78 attribute whose values were not listed in the
79 .B title
80 attribute of any
81 .B titleCatalog
82 entries in the given scope.
83 .RE
84 .SH FILES
85 .TP
86 ETCDIR/slapd.conf
87 default slapd configuration file
88 .SH SEE ALSO
89 .BR slapd.conf (5).
90 .SH ACKNOWLEDGEMENTS
91 This module was written in 2005 by Neil Dunbar of Hewlett-Packard and subsequently
92 extended by Howard Chu and Emmanuel Dreyfus.
93 .so ../Project