Page MenuHomeSoftware Heritage

phabricator.lister: Use credentials setup from config file
ClosedPublic

Authored by ardumont on Jun 14 2019, 6:23 PM.

Details

Summary

Prior to this commit, this expected the api.token to be provided at task
initialization. That behavior has been kept for cli purposes. It's no good for
production purposes though (as this leaks the credentials in the scheduler db).

So now, the credentials is fetched from the lister's configuration file as the
other listers do.

Another change is the authentication mechanism which is slighly different. It's
not using a basic auth mechanism. It's expecting an api.token query
parameter so the request_params is overriden to provide that.

Related T1809

Annex:
gitlab.lister: Remove request_params method override (as the
default implementation is generic enough for most listers since
b816212). This should have been removed in that same commit.

Related b816212
Related T1772

Test Plan

tox

docker-dev ~> listed our forge with swhbot's credential

Diff Detail

Repository
rDLS Listers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont retitled this revision from gitlab.lister: Remove request_params method override to wip: phabricator.lister: Fallback credentials setup from config file.
ardumont edited the summary of this revision. (Show Details)
ardumont edited the test plan for this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)

Fix pep8 violations

And no, too optimistic:

docker-dev:

(swh) tony@corellia $ swh scheduler --url $SCHEDULER_API_URL task add list-phabricator-full --policy recurring
Created 1 tasks

Task 1
  Next run: just now (2019-06-17 12:53:50+00:00)
  Interval: 90 days, 0:00:00
  Type: list-phabricator-full
  Policy: recurring
  Args:
  Keyword args:

doco logs -d:

(swh) tony@corellia $ ...
...
swh-lister_1                  | TypeError: request() got an unexpected keyword argument 'api.token'
...
  • phabricator.lister: Use credentials setup from configuration file
ardumont retitled this revision from wip: phabricator.lister: Fallback credentials setup from config file to wip: phabricator.lister: Use credentials setup from config file.Jun 17 2019, 4:25 PM
ardumont edited the summary of this revision. (Show Details)
ardumont edited the test plan for this revision. (Show Details)
ardumont retitled this revision from wip: phabricator.lister: Use credentials setup from config file to phabricator.lister: Use credentials setup from config file.Jun 17 2019, 5:15 PM
swh/lister/gitlab/lister.py
57

As mentioned in the description, this should have gone away in rDLSb81621274b78f379d630047ba5320bb5700162ee.

This revision is now accepted and ready to land.Jun 17 2019, 5:44 PM
This revision was automatically updated to reflect the committed changes.