[Yum-devel] [PATCH 1/2] add username/password basic auth options and document in man page

Seth Vidal skvidal at fedoraproject.org
Mon Aug 30 20:46:31 UTC 2010


---
 docs/yum.conf.5 |   19 +++++++++++++++++++
 yum/config.py   |    4 ++++
 yum/yumRepo.py  |    2 ++
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 25b2c7d..8acc8f4 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -365,6 +365,14 @@ username to use for proxy
 password for this proxy
 
 .IP
+\fBusername \fR
+username to use for basic authentication to a repo or really any url.
+
+.IP
+\fBpassword \fR
+password to use with the username for basic authentication.
+
+.IP
 \fBplugins \fR
 Either `0' or `1'. Global switch to enable or disable yum plugins. Default is
 `0' (plugins disabled). See the \fBPLUGINS\fR section of the \fByum(8)\fR man
@@ -738,6 +746,17 @@ If this is unset it inherits it from the global setting
 password for this proxy.
 If this is unset it inherits it from the global setting
 
+
+.IP
+\fBusername \fR
+username to use for basic authentication to a repo or really any url.
+If this is unset it inherits it from the global setting
+
+.IP
+\fBpassword \fR
+password to use with the username for basic authentication.
+If this is unset it inherits it from the global setting
+
 .IP
 \fBcost \fR
 relative cost of accessing this repository. Useful for weighing one repo's packages
diff --git a/yum/config.py b/yum/config.py
index 650d7b9..49411e3 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -645,6 +645,8 @@ class YumConf(StartupConf):
     proxy = UrlOption(schemes=('http', 'ftp', 'https'), allow_none=True)
     proxy_username = Option()
     proxy_password = Option()
+    username = Option()
+    password = Option()
     installonlypkgs = ListOption(['kernel', 'kernel-bigmem',
             'kernel-enterprise','kernel-smp', 'kernel-modules', 'kernel-debug',
             'kernel-unsupported', 'kernel-source', 'kernel-devel', 'kernel-PAE',
@@ -794,6 +796,8 @@ class RepoConf(BaseConfig):
     proxy_password = Inherit(YumConf.proxy_password)
     retries = Inherit(YumConf.retries)
     failovermethod = Inherit(YumConf.failovermethod)
+    username = Inherit(YumConf.username)
+    password = Inherit(YumConf.password)
 
     # FIXME: rename gpgcheck to pkgs_gpgcheck
     gpgcheck = Inherit(YumConf.gpgcheck)
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index dd595f0..37b4b3d 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -501,6 +501,8 @@ class YumRepository(Repository, config.RepoConf):
                  'ssl_cert': self.sslclientcert,
                  'ssl_key': self.sslclientkey,
                  'user_agent': default_grabber.opts.user_agent,
+                 'username': self.username,
+                 'password': self.password,
                  }
         return opts
 
-- 
1.7.2.1



More information about the Yum-devel mailing list