1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 from flumotion.component import component
24
25
26 __all__ = ['Bouncer']
27
28
30
31 logCategory = 'bouncermedium'
33 """
34 Authenticates the given keycard.
35
36 @type keycard: L{flumotion.common.keycards.Keycard}
37 """
38 return self.comp.authenticate(keycard)
39
41 """
42 Resets the expiry timeout for keycards issued by issuerName.
43
44 @param issuerName: the issuer for which keycards should be kept
45 alive; that is to say, keycards with the
46 attribute 'issuerName' set to this value will
47 have their ttl values reset.
48 @type issuerName: str
49 @param ttl: the new expiry timeout
50 @type ttl: number
51 """
52 return self.comp.keepAlive(issuerName, ttl)
53
55 try:
56 self.comp.removeKeycardId(keycardId)
57
58 except KeyError:
59 self.warning('Could not remove keycard id %s' % keycardId)
60
62 """
63 Called by bouncer views to expire keycards.
64 """
65 return self.comp.expireKeycardId(keycardId)
66
69
70
71 BOUNCER_SOCKET = 'flumotion.component.bouncers.plug.BouncerPlug'
72
73
74 -class Bouncer(component.BaseComponent):
75 """
76 I am the base class for all bouncers.
77 """
78 componentMediumClass = BouncerMedium
79 logCategory = 'bouncer'
80
83
87
91
94
97
100
103
106
109