diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2198c63b4..da8849c90 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -92,9 +92,9 @@ gspread uses [vcrpy](https://github.com/kevin1024/vcrpy) to record and replay HT ### `GS_CREDS_FILENAME` environment variable -You must provide service account credentials using the `GS_CREDS_FILENAME` environment variable in order to make HTTP requests to the Sheets API. +You must provide OAuth Client credentials using the `GS_CREDS_FILENAME` environment variable in order to make HTTP requests to the Sheets API. -[Obtain service account credentials from Google Developers Console](https://docs.gspread.org/en/latest/oauth2.html#for-bots-using-service-account). +[Obtain OAuth Client credentials from Google Developers Console](https://docs.gspread.org/en/latest/oauth2.html#for-end-users-using-oauth-client-id). ### `GS_RECORD_MODE` environment variable diff --git a/tests/conftest.py b/tests/conftest.py index 82f17da48..91dfd42c6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,6 @@ import pytest from google.auth.credentials import Credentials from google.oauth2.credentials import Credentials as UserCredentials -from google.oauth2.service_account import Credentials as ServiceAccountCredentials from requests import Response from vcr import VCR from vcr.errors import CannotOverwriteExistingCassetteException @@ -20,7 +19,7 @@ RECORD_MODE = os.getenv("GS_RECORD_MODE", "none") SCOPE = [ - "https://spreadsheets.google.com/feeds", + "https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive.file", ] DUMMY_ACCESS_TOKEN = "" @@ -29,7 +28,7 @@ def read_credentials(filename: str) -> Credentials: - return ServiceAccountCredentials.from_service_account_file(filename, scopes=SCOPE) + return UserCredentials.from_authorized_user_file(filename, scopes=SCOPE) def prefixed_counter(prefix: str, start: int = 1) -> Generator[str, None, None]: