password module

class password.Password(cfg=None)[source]

Bases: object

provide passwords for BIT either from keyring, Password_Cache or by asking User.

password(parent, profile_id, mode, pw_id=1, only_from_keyring=False)[source]

based on profile settings return password from keyring, Password_Cache or by asking User.

passwordFromCache(service_name, user_name)[source]

get password from Password_Cache

passwordFromKeyring(service_name, user_name)[source]

get password from system keyring (seahorse). The keyring is only available if User is logged in.

passwordFromUser(parent, profile_id=None, mode=None, pw_id=1, prompt=None)[source]

ask user for password. This does even work when run as cronjob and user is logged in.

setPassword(password, profile_id, mode, pw_id)[source]

store password to keyring and Password_Cache

setPasswordCache(service_name, user_name, password)[source]
setPasswordDb(service_name, user_name, password)[source]

internal Password cache. Prevent to ask password several times during runtime.

setPasswordKeyring(service_name, user_name, password)[source]
class password.Password_Cache(cfg=None, *args, **kwargs)[source]

Bases: tools.Daemon

Password_Cache get started on User login. It provides passwords for BIT cronjobs because keyring is not available when the User is not logged in. Does not start if there is no password to cache (e.g. no profile allows to cache).

PW_CACHE_VERSION = 3
checkVersion()[source]
cleanupHandler(signum, frame)[source]
collectPasswords()[source]

search all profiles in config and collect passwords from keyring.

reloadHandler(signum, frame)[source]

reload passwords during runtime.

run()[source]

wait for password request on FIFO and answer with password from self.db through FIFO.