Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/phabricator/lister.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | def request_params(self, identifier): | ||||
- username: <account> | - username: <account> | ||||
password: <api-token> | password: <api-token> | ||||
""" | """ | ||||
creds = self.request_instance_credentials() | creds = self.request_instance_credentials() | ||||
if not creds: | if not creds: | ||||
raise ValueError( | raise ValueError( | ||||
'Phabricator forge needs authentication credential to list.') | 'Phabricator forge needs authentication credential to list.') | ||||
api_token = random.choice(creds)['password'] | |||||
login = random.choice(list(creds)) | |||||
api_token = creds[login]['password'] | |||||
return {'headers': self.request_headers() or {}, | return {'headers': self.request_headers() or {}, | ||||
'params': {'api.token': api_token}} | 'params': {'api.token': api_token}} | ||||
def request_headers(self): | def request_headers(self): | ||||
""" | """ | ||||
(Override) Set requests headers to send when querying the | (Override) Set requests headers to send when querying the | ||||
Phabricator API | Phabricator API | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |