module loghelper.pwd_helper
¶
Short summary¶
module pyquickhelper.loghelper.pwd_helper
Helpers to store and retrieve password.
Functions¶
function |
truncated documentation |
---|---|
Restores a password. By default, uses keyring. |
|
Stores a password. By default, uses keyring or keyrings.cryptfile. |
Documentation¶
Helpers to store and retrieve password.
- pyquickhelper.loghelper.pwd_helper.get_password(system, username, lib='keyrings.cryptfile', env='KEYRING_CRYPTFILE_PASSWORD', ask=True)[source]¶
Restores a password. By default, uses keyring.
- Parameters:
system – system
username – username
lib – which lib to use to store the password
env – see below
ask – ask for password if missing
- Returns:
password
If lib == ‘keyrings.cryptfile’, the function used the environment variable env, if present, no password is asked.
- pyquickhelper.loghelper.pwd_helper.set_password(system, username, password, lib='keyrings.cryptfile', env='KEYRING_CRYPTFILE_PASSWORD', ask=True)[source]¶
Stores a password. By default, uses keyring or keyrings.cryptfile.
- Parameters:
system – system
username – username
password – password
lib – which lib to use to store the password
env – see below
ask – ask for password if missing
If lib == ‘keyrings.cryptfile’, the function used the environment variable env, if present, no password is asked.