(self,
base_url=os.environ.get('SUPER_DB', 'http://localhost:9867'),
config_dir=os.path.expanduser('~/.super'))
| 14 | |
| 15 | class Client(): |
| 16 | def __init__(self, |
| 17 | base_url=os.environ.get('SUPER_DB', 'http://localhost:9867'), |
| 18 | config_dir=os.path.expanduser('~/.super')): |
| 19 | self.base_url = base_url.rstrip('/') |
| 20 | self.session = requests.Session() |
| 21 | self.session.headers.update({'Accept': 'application/x-jsup'}) |
| 22 | token = self.__get_auth_token(config_dir) |
| 23 | if token is not None: |
| 24 | self.session.headers.update({'Authorization': 'Bearer ' + token}) |
| 25 | |
| 26 | def __get_auth_token(self, config_dir): |
| 27 | creds_path = os.path.join(config_dir, 'credentials.json') |
no test coverage detected