blob: 5af925558fff62da8cb5d5d7da216f119c334358 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# create a simple slapd.conf (e.g. by running test003)
# define the attributes (replace MyOID with a valid OID)
attributetype ( MyOID:1 NAME 'validityStarts'
EQUALITY generalizedTimeMatch
ORDERING generalizedTimeOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )
attributetype ( MyOID:2 NAME 'validityEnds'
EQUALITY generalizedTimeMatch
ORDERING generalizedTimeOrderingMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )
# load the module
moduleload "now_dynacl.so"
# and apply the following access rules
access to dn.exact="dc=example,dc=com"
by * read
access to dn.children="dc=example,dc=com"
by dynacl/now=">=validityStarts" read break
access to dn.children="dc=example,dc=com"
by dynacl/now="<=validityEnds" read
# Then load the LDIF
dn: cn=Too Late,dc=example,dc=com
objectClass: device
objectClass: extensibleObject
cn: Too Late
validityStarts: 20000101000000Z
validityEnds: 20100101000000Z
dn: cn=Just in Time,dc=example,dc=com
objectClass: device
objectClass: extensibleObject
cn: Just in Time
validityStarts: 20100101000000Z
validityEnds: 20200101000000Z
dn: cn=Too Early,dc=example,dc=com
objectClass: device
objectClass: extensibleObject
cn: Too Early
validityStarts: 20200101000000Z
validityEnds: 20300101000000Z
# an anonymous ldapsearch should only find the entry
$ ldapsearch -x -H ldap://:9011 -b dc=example,dc=com -LLL 1.1
dn: cn=Just in Time,dc=example,dc=com
|