[Pulp-list] Question on basic_auth_username, basic_auth_password attributes

Jeremy Cline jcline at redhat.com
Thu Sep 8 13:46:17 UTC 2016


On 09/07/2016 07:05 PM, Partha Aji wrote:
> Lately I have been playing with these attributes to sync repos from private
> docker registries. Question I have is if these attributes are applicable to
> other content types that pulp supports like yum, puppet, ostree.  Reason I
> ask is I see these in the generic place
> https://github.com/pulp/pulp/blob/master/common/pulp/common/plugins/importer_constants.py#L60
> 
> So in the case where the user supplies this information for a yum repo does
> that mean the yum repo is protected by an http username/password basic
> authentication??

Correct. All it does is set the Authorization header in the HTTP
requests to the authentication type ("Basic") and the base64 encoding
of the username and password. You can see this for yourself:


[vagrant at dev ~]$ cat /etc/pulp/server/plugins.conf.d/yum_importer.json
{
    "basic_auth_username": "AzureDiamond",
    "basic_auth_password": "hunter2"
}
[vagrant at dev ~]$ pulp-admin rpm repo create --repo-id test --feed
http://127.0.0.1:8080/test
Successfully created repository [test]

[vagrant at dev ~]$ pulp-admin rpm repo sync run --repo-id test


Then in a separate shell run

[vagrant at dev ~]$ nc -l 127.0.0.1 8080
GET /test/repodata/repomd.xml HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.10.0
Authorization: Basic QXp1cmVEaWFtb25kOmh1bnRlcjI=

[vagrant at dev ~]$ ipython
In [1]: import base64

In [2]: base64.b64decode('QXp1cmVEaWFtb25kOmh1bnRlcjI=')
Out[2]: 'AzureDiamond:hunter2'


See https://tools.ietf.org/html/rfc7235 for more information. Does
that answer your question?

-- 
Jeremy Cline
XMPP: jeremy at jcline.org
IRC:  jcline

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/pulp-list/attachments/20160908/99d2aa78/attachment.sig>


More information about the Pulp-list mailing list