-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
Description
Hi,
I'm using this client library with google-auth to make calls to several Google APIs (Drive mainly), it works fine however it seems that when using a Batch request it doesn't use the credentials of each request in the batch, only the credentials from the first one.
Which means that when I impersonate two different users in two different requests in the same batch, both requests are made impersonating the first user.
For example here's how I proceed to list the files of two users:
creds_one = google.oauth2.service_account.Credentials.from_service_account_file(path_to_json, scopes=scopes, subject='user1@xxx.com')
creds_two = google.oauth2.service_account.Credentials.from_service_account_file(path_to_json, scopes=scopes, subject='user2@xxx.com')
drive_service_one = build('drive', 'v3', credentials=creds_one)
drive_service_two = build('drive', 'v3', credentials=creds_two)
_batch = BatchHttpRequest()
_batch.add(request=drive_service_one.files().list(), request_id='u1')
_batch.add(request=drive_service_two.files().list(), request_id='u2')
_batch.execute()
What I observe in this case is that both requests return the list of files from the first user.
Am I missing something here ?
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.