Mercurial > bitten > bitten-test
changeset 545:d059cb6088a6
Allow authentication credentials to be specified in the configuration file `[Remy Blank]`.
The credentials are added to the `[authentication]` section:
{{{
[authentication]
username=myusername
password=mypassword
}}}
The authentication key is removed from the configuration file when the information has been extracted,
so that it doesn't get sent over the network or logged.
author | dfraser |
---|---|
date | Tue, 31 Mar 2009 17:25:40 +0000 |
parents | 20e10135f255 |
children | 51626fdd20bf |
files | bitten/slave.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bitten/slave.py +++ b/bitten/slave.py @@ -127,6 +127,11 @@ if not self.local: self.opener = urllib2.build_opener(SaneHTTPErrorProcessor) password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() + if not username: + username = self.config['authentication.username'] + if not password: + password = self.config['authentication.password'] + self.config.packages.pop('authentication', None) if username and password: log.debug('Enabling authentication with username %r', username) password_mgr.add_password(None, urls, username, password)