-class UserPassAuth(Auth):
- """
- Basic auth authentication using email/username and
- password. Deprecated.
- """
- def __init__(self, username, password):
- self.username = username
- self.password = password
-
- def encode_params(self, base_url, method, params):
- # We could consider automatically converting unicode to utf8 strings
- # before encoding...
- return urllib.urlencode(params)
-
- def generate_headers(self):
- return {"Authorization": "Basic " + encodestring("%s:%s" %(
- self.username, self.password)).strip('\n')}
-
-class NoAuth(UserPassAuth):