Package flumotion :: Package component :: Package bouncers :: Module plug :: Class BouncerPlug
[hide private]

Class BouncerPlug

source code

extern.log.log.Loggable --+        
                          |        
            plugs.base.Plug --+    
                              |    
       plugs.base.ComponentPlug --+
                                  |
                     object --+   |
                              |   |
        common.common.InitMixin --+
                                  |
                                 BouncerPlug
Known Subclasses:


I am the base class for all bouncer plugs.

FIXME: expireKeycardIds has been added to the component bouncer.
       Because the plug version is not yet used, and will be
       refactored/redesigned in a near future, the modifications
       have not been duplicated here.

@cvar keycardClasses: tuple of all classes of keycards this bouncer can
                      authenticate, in order of preference
@type keycardClasses: tuple of L{flumotion.common.keycards.Keycard}
                      class objects

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
init(self) source code
 
typeAllowed(self, keycard)
Verify if the keycard is an instance of a Keycard class specified in the bouncer's keycardClasses variable.
source code
 
setEnabled(self, enabled) source code
 
setMedium(self, medium) source code
 
stop(self, component) source code
 
_expire(self) source code
 
authenticate(self, keycard) source code
 
do_authenticate(self, keycard)
Must be overridden by subclasses.
source code
 
hasKeycard(self, keycard) source code
 
generateKeycardId(self) source code
 
addKeycard(self, keycard)
Adds a keycard to the bouncer.
source code
 
removeKeycard(self, keycard) source code
 
removeKeycardId(self, keycardId) source code
 
keepAlive(self, issuerName, ttl) source code
 
expireAllKeycards(self) source code
 
expireKeycardId(self, keycardId) source code

Inherited from plugs.base.ComponentPlug: restart, start

Inherited from extern.log.log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  keycardClasses = ()
  logCategory = 'bouncer'
Implementors can provide a category to log their messages under.
  KEYCARD_EXPIRE_INTERVAL = 120

Inherited from extern.log.log.Loggable: __implemented__, __provides__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • args - The plug args
Overrides: object.__init__
(inherited documentation)

stop(self, component)

source code 
Overrides: plugs.base.ComponentPlug.stop

do_authenticate(self, keycard)

source code 

Must be overridden by subclasses.

Authenticate the given keycard. Return the keycard with state AUTHENTICATED to authenticate, with state REQUESTING to continue the authentication process, or None to deny the keycard, or a deferred which should have the same eventual value.

addKeycard(self, keycard)

source code 

Adds a keycard to the bouncer. Can be called with the same keycard more than one time. If the keycard has already been added successfully, adding it again will succeed and return True.

Parameters:
  • keycard - the keycard to add.
Returns:
if the bouncer accepts the keycard.