[csw-devel] SF.net SVN: gar:[14343] csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

Maciej Bliziński maciej at opencsw.org
Wed Apr 20 18:24:17 CEST 2011


2011/4/20 Ben Walton <bwalton at opencsw.org>:
> Excerpts from wahwah's message of Wed Apr 20 10:54:31 -0400 2011:
>
>
> Hi Maciej,
>
>> +  def _SetAuth(self, c):
>> +    """Set basic HTTP auth options on given Curl object."""
>> +    if self.username:
>> +      logging.debug("Using basic AUTH for user %s", self.username)
>> +      c.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY)
>> +      c.setopt(pycurl.USERPWD, "%s:%s" % (self.username, self.password))
>> +    else:
>> +      logging.debug("User and password not set, not using HTTP AUTH")
>> +    return c
>> +
>
> This is what I planned to tackle last night but I forgot about a
> parent council meeting for my daughter's school.  It looks as though
> the file read bit still needs to happen though, right?  (eg:
> ~/.csw-upload-pkg storing u/p)

Yes.  The above bit was from the http-auth branch I mentioned earlier.
 What's left to do is reading users' passwords, and falling back to
getpass if unavailable.  Passwords will be stored in
/etc/opt/csw/releases/auth/<username>.secrets (or similar of your
choice, under /etc/opt/csw).

Maciej


More information about the devel mailing list