Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/core/lister_transports.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | def request_instance_credentials(self): | ||||
"""Returns dictionary of any credentials configuration needed by the | """Returns dictionary of any credentials configuration needed by the | ||||
forge instance to list. | forge instance to list. | ||||
The 'credentials' configuration is expected to be a dict of multiple | The 'credentials' configuration is expected to be a dict of multiple | ||||
levels. The first level is the lister's name, the second is the | levels. The first level is the lister's name, the second is the | ||||
lister's instance name, which value is expected to be a list of | lister's instance name, which value is expected to be a list of | ||||
credential structures (typically a couple username/password). | credential structures (typically a couple username/password). | ||||
For example: | For example:: | ||||
credentials: | credentials: | ||||
github: # github lister | github: # github lister | ||||
github: # has only one instance (so far) | github: # has only one instance (so far) | ||||
- username: some | - username: some | ||||
password: somekey | password: somekey | ||||
- username: one | - username: one | ||||
password: onekey | password: onekey | ||||
- ... | - ... | ||||
gitlab: # gitlab lister | gitlab: # gitlab lister | ||||
riseup: # has many instances | riseup: # has many instances | ||||
- username: someone | - username: someone | ||||
password: ... | password: ... | ||||
- ... | - ... | ||||
gitlab: | gitlab: | ||||
- username: someone | - username: someone | ||||
password: ... | password: ... | ||||
- ... | - ... | ||||
Returns: | Returns: | ||||
list of credential dicts for the current lister. | list of credential dicts for the current lister. | ||||
""" | """ | ||||
all_creds = self.config.get('credentials') | all_creds = self.config.get('credentials') | ||||
if not all_creds: | if not all_creds: | ||||
return [] | return [] | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |