'Add headers required by the OpenNebula.org OCCI interface.
Includes adding Basic HTTP Authorization headers for authenticating
against the OpenNebula.org OCCI interface.
:type  headers: ``dict``
:param headers: Dictionary containing HTTP headers.
:rtype:  ``dict``
:return: Dictionary containing updated headers.'

def add_default_headers(self, headers):

    if self.plain_auth:
        passwd = self.key
    else:
        passwd = hashlib.sha1(b(self.key)).hexdigest()
    headers['Authorization'] = ('Basic    %s' % b64encode(b(('%s:%s' % (self.user_id, passwd)))).decode('utf-8'))
    return headers
