web2ldap  1.7.7
About: web2ldap is a full-featured web-based LDAPv3 client.
  Fossies Dox: web2ldap-1.7.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dds.py
Go to the documentation of this file.
1# -*- coding: ascii -*-
2"""
3web2ldap plugin classes for dynamic entries (see RFC 2589)
4"""
5
6import time
7
8from ...utctime import strftimeiso8601
9
10from ..schema.syntaxes import Timespan, DistinguishedName, syntax_registry
11
12
14 oid: str = 'EntryTTL-oid'
15 desc: str = 'Time-to-live of dynamic entry'
16
17 def display(self, vidx, links) -> str:
18 expiration_time = time.time()+int(self._av)
19 return '%s, expires %s' % (
20 Timespan.display(self, vidx, links),
21 strftimeiso8601(time.gmtime(expiration_time)),
22 )
23
24syntax_registry.reg_at(
25 EntryTTL.oid, [
26 '1.3.6.1.4.1.1466.101.119.3', # entryTTL
27 ]
28)
29
30
32 oid: str = 'DynamicSubtrees-oid'
33 desc: str = 'Subtrees with dynamic entries'
34
36 res = DistinguishedName._additional_links(self)
37 res.append(
38 self._app.anchor(
39 'search', 'Search',
40 [
41 ('dn', self.av_u),
42 ('search_root', self.av_u),
43 ('filterstr', '(objectClass=dynamicObject)'),
44 ('searchform_mode', 'exp'),
45 ],
46 title='Search for dynamic entries',
47 ),
48 )
49 return res
50
51syntax_registry.reg_at(
52 DynamicSubtrees.oid, [
53 '1.3.6.1.4.1.1466.101.119.4', # dynamicSubtrees
54 ]
55)
56
57
58# Register all syntax classes in this module
59syntax_registry.reg_syntaxes(__name__)
str display(self, vidx, links)
Definition: dds.py:17
def strftimeiso8601(t)
Definition: utctime.py:65