Package flumotion :: Package component :: Package bouncers :: Module component :: Class AuthSessionBouncer
[hide private]

Class AuthSessionBouncer

source code

             object --+            
                      |            
common.common.InitMixin --+        
                          |        
extern.log.log.Loggable --+        
                          |        
    component.BaseComponent --+    
                              |    
                        Bouncer --+
                                  |
                                 AuthSessionBouncer
Known Subclasses:

I am a bouncer that handle pending authentication sessions. I am storing the last keycard of an authenticating session.

Nested Classes [hide private]

Inherited from Bouncer: componentMediumClass

Instance Methods [hide private]
 
init(self)
A subclass should do as little as possible in its init method.
source code
 
on_disabled(self)
Override to cleanup sub-class specific data when the bouncer is disabled.
source code
 
do_extractKeycardInfo(self, keycard, oldData)
Extracts session info from a keycard.
source code
bool
hasAuthSession(self, keycard)
Tells if a keycard is related to a pending authentication session.
source code
flumotion.common.keycards.Keycard or None
getAuthSessionInfo(self, keycard)
Returns: the last updated keycard for the authentication session associated with the specified keycard
source code
 
startAuthSession(self, keycard)
Starts an authentication session with a keycard.
source code
 
updateAuthSession(self, keycard)
Updates an authentication session with the last keycard.
source code
 
cancelAuthSession(self, keycard)
Cancels the authentication session associated with the specified keycard.
source code
 
confirmAuthSession(self, keycard)
Confirms the authentication session represented by the specified keycard is authenticated.
source code
 
updateAuthSessionInfo(self, keycard, data)
Updates the authentication session data.
source code
bool
do_expireKeycards(self, elapsed)
Override to expire keycards managed by sub-classes.
source code
 
_updateInfoFromKeycard(self, keycard) source code

Inherited from Bouncer: addKeycard, authenticate, do_authenticate, do_stop, do_validate, expireAllKeycards, expireKeycardId, expireKeycardIds, generateKeycardId, getDomain, getEnabled, hasKeycard, keepAlive, on_enabled, on_keycardAdded, on_keycardRemoved, removeKeycard, removeKeycardId, setDomain, setEnabled, typeAllowed

Inherited from Bouncer (private): _addKeycard, _expire, _expireNextKeycardBlock

Inherited from component.BaseComponent: __init__, __provides__, addMessage, adminCallRemote, checkPropertyType, check_properties, do_check, do_setup, fixRenamedProperties, getMood, getName, getWorkerName, modifyProperty, observerAppend, observerRemove, removeMessage, setMedium, setMood, setShutdownHook, setWorkerName, setup, setup_completed, stop, waitForHappy, warnDeprecatedProperties

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

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

Class Variables [hide private]

Inherited from Bouncer: KEYCARD_EXPIRE_INTERVAL, keycardClasses, logCategory

Inherited from component.BaseComponent: __implemented__

Instance Variables [hide private]

Inherited from component.BaseComponent: medium, name, uiState

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

init(self)

source code 

A subclass should do as little as possible in its init method. In particular, it should not try to access resources.

Failures during init are marshalled back to the manager through the worker's remote_create method, since there is no component state proxied to the manager yet at the time of init.

Overrides: component.BaseComponent.init
(inherited documentation)

on_disabled(self)

source code 

Override to cleanup sub-class specific data when the bouncer is disabled.

Overrides: Bouncer.on_disabled
(inherited documentation)

do_extractKeycardInfo(self, keycard, oldData)

source code 

Extracts session info from a keycard. Used by updateAuthSession to store session info. Must be overridden by subclasses.

hasAuthSession(self, keycard)

source code 

Tells if a keycard is related to a pending authentication session. It basically check if the id of the keycard is known.

Parameters:
  • keycard (flumotion.common.keycards.Keycard) - the keycard to check
Returns: bool
if a pending authentication session associated with the specified keycard exists.

getAuthSessionInfo(self, keycard)

source code 
Returns: flumotion.common.keycards.Keycard or None
the last updated keycard for the authentication session associated with the specified keycard

startAuthSession(self, keycard)

source code 

Starts an authentication session with a keycard. The keycard id will be generated and set. The session info will be extracted from the keycard by calling the method do_extractKeycardInfo, and can be retrieved by calling getAuthSessionInfo.

If a the keycard already have and id, and there is an authentication session with this id, the session info is updated from the keycard, and it return True.

Parameters:
  • keycard (flumotion.common.keycards.Keycard) - the keycard to update from.
Returns:
if the bouncer accepts the keycard.

updateAuthSession(self, keycard)

source code 

Updates an authentication session with the last keycard. The session info will be extracted from the keycard by calling the method do_extractKeycardInfo, and can be retrieved by calling getAuthSessionInfo.

Parameters:
  • keycard (flumotion.common.keycards.Keycard) - the keycard to update from.

cancelAuthSession(self, keycard)

source code 

Cancels the authentication session associated with the specified keycard. Used when doing challenge/response authentication.

Raises:
  • KeyError - when there is no session associated with the keycard.

confirmAuthSession(self, keycard)

source code 

Confirms the authentication session represented by the specified keycard is authenticated. This will add the specified keycard to the bouncer keycard list like addKeycard would do but without changing the keycard id. The authentication session data is cleaned up.

If the bouncer already have a keycard with the same id, the authentication is confirmed but the bouncer keycard is NOT updated. FIXME: is it what we want ? ? ?

Parameters:
  • keycard (flumotion.common.keycards.Keycard) - the keycard to add to the bouncer list.
Returns:
if the bouncer accepts the keycard.

updateAuthSessionInfo(self, keycard, data)

source code 

Updates the authentication session data. Can be used bu subclasses to modify the data directly.

do_expireKeycards(self, elapsed)

source code 

Override to expire keycards managed by sub-classes.

Parameters:
  • elapsed - time in second since the last expiration call.
Returns: bool
if there is more keycard to expire. If False is returned, the expirer poller MAY be stopped.
Overrides: Bouncer.do_expireKeycards
(inherited documentation)