MCPcopy Create free account
hub / github.com/comaps/comaps / _add_auth_header

Method _add_auth_header

tools/python/opentable_restaurants.py:72–79  ·  view source on GitHub ↗
(self, headers)

Source from the content-addressed store, hash-verified

70 logging.debug('Token is %s', self.token)
71
72 def _add_auth_header(self, headers):
73 if self.token is None:
74 key = base64.b64encode('{}:{}'.format(self.login, self.password))
75 headers['Authorization'] = 'Basic {}'.format(key)
76 else:
77 headers['Authorization'] = '{} {}'.format(self.token['token_type'],
78 self.token['access_token'])
79 return headers
80
81
82def make_tsv(data_file, output_file):

Callers 2

downloadMethod · 0.95
_get_tokenMethod · 0.95

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected