Page MenuHomeSoftware Heritage

auth: Simplify authentication after changes in swh-web
ClosedPublic

Authored by anlambert on Aug 27 2020, 1:42 PM.

Details

Summary

Token renewal workflow is now delegated to swh-web for commodity of use when
a user wants to make authenticated API calls.

So remove no more needed code and update documentation regarding authentication.

Depends on D3849

Diff Detail

Repository
rDWCLI Web client
Branch
client-auth-simplify
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14829
Build 22844: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 22843: arc lint + arc unit

Unit TestsFailed

TimeTest
3 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.client.tests.test_cli::test_auth_login
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f56be9ed4a8> def test_auth_login(mocker):
2 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.client.tests.test_cli::test_auth_refresh
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f56be9a6e10> def test_auth_refresh(mocker):
1 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.client.tests.test_web_api_client::test_authenticate_failure
web_api_client = <swh.web.client.client.WebAPIClient object at 0x7f56be7ec5f8> web_api_mock = <requests_mock.mocker.Mocker object at 0x7f56be7ec8d0>
1 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.client.tests.test_web_api_client::test_authenticate_refresh_token
web_api_client = <swh.web.client.client.WebAPIClient object at 0x7f56be781550> web_api_mock = <requests_mock.mocker.Mocker object at 0x7f56be7817b8>
1 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.web.client.tests.test_web_api_client::test_authenticate_success
web_api_client = <swh.web.client.client.WebAPIClient object at 0x7f56be788ef0> web_api_mock = <requests_mock.mocker.Mocker object at 0x7f56be788cf8>
View Full Test Results (5 Failed · 8 Passed)

Event Timeline

Build has FAILED

Patch application report for D3850 (id=13599)

Rebasing onto ca947d48a2...

Current branch diff-target is up to date.
Changes applied before test
commit 89b1cf89cff5abfc7edcc91015ecacd94307ff71
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Thu Aug 27 13:39:05 2020 +0200

    auth: Simplify authentication after changes in swh-web
    
    Token renewal workflow is now delegated to swh-web for commodity of use when
    a user wants to make authenticated API calls.
    
    So remove no more needed code and update documentation regarding authentication.

Link to build: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/11/
See console output for more information: https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/11/console

Build is green

Patch application report for D3850 (id=13600)

Rebasing onto ca947d48a2...

Current branch diff-target is up to date.
Changes applied before test
commit 2821a32d73639901c68ee154a6b3b18854c37524
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Thu Aug 27 13:39:05 2020 +0200

    auth: Simplify authentication after changes in swh-web
    
    Token renewal workflow is now delegated to swh-web for commodity of use when
    a user wants to make authenticated API calls.
    
    So remove no more needed code and update documentation regarding authentication.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/12/ for more details.

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
docs/index.rst
12–44

I preferred it plural, it sounds more idiomatic

swh/web/client/auth.py
19

revoked

swh/web/client/client.py
136

d/get/do/

This revision is now accepted and ready to land.Aug 27 2020, 4:58 PM

Build is green

Patch application report for D3850 (id=13602)

Rebasing onto ca947d48a2...

Current branch diff-target is up to date.
Changes applied before test
commit f3d89ebc4ec1bcbb0b0de4cf9bdabab5ce1df09b
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Thu Aug 27 13:39:05 2020 +0200

    auth: Simplify authentication after changes in swh-web
    
    Token renewal workflow is now delegated to swh-web for commodity of use when
    a user wants to make authenticated API calls.
    
    So remove no more needed code and update documentation regarding authentication.

See https://jenkins.softwareheritage.org/job/DWCLI/job/tests-on-diff/13/ for more details.