revoke access token after CI run

This commit is contained in:
samschott 2023-02-04 22:24:05 +01:00
parent 503aff6b82
commit 4ee58fe222

View File

@ -93,10 +93,10 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install -U .[test] python -m pip install -U .[test]
- name: Get short-lived Dropbox token - name: Get short-lived Oauth2 access token
# We generate a short-lived auth token which is passed to the test runner as # We generate a short-lived auth token which is passed to the test runner as
# an environment variable. At no point does the test code, potentially from a # an environment variable. At no point does the test code, potentially from an
# malicious PR, get access to a long-lived token. # untrusted 3rd party, get access to a long-lived token.
run: | run: |
auth_result=$(curl https://api.dropbox.com/oauth2/token \ auth_result=$(curl https://api.dropbox.com/oauth2/token \
-d grant_type=refresh_token \ -d grant_type=refresh_token \
@ -110,6 +110,11 @@ jobs:
run: | run: |
pytest -v --cov=maestral --cov-report=xml tests/linked/unit pytest -v --cov=maestral --cov-report=xml tests/linked/unit
- name: Revoke access token
run: |
curl -X POST https://api.dropboxapi.com/2/auth/token/revoke \
--header "Authorization: Bearer $DROPBOX_ACCESS_TOKEN"
- name: Upload Code Coverage - name: Upload Code Coverage
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with: