# HG changeset patch # User dfraser # Date 1238520340 0 # Node ID d059cb6088a678d3a5ef4750c5e022b8351bb86e # Parent 20e10135f255748e3eec2562a9cde6ad79de2156 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. diff --git a/bitten/slave.py b/bitten/slave.py --- 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)