Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

CREDENTIAL_SCOPES: Add /auth/drive for bigquery tables backed by sheets #456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jdanbrown
Copy link
Contributor

  • Allow service accounts to query bq tables backed by sheets
  • Without this scope you get the following 403 error from bq, where
    "globbing file pattern" appears to come from gdrive:
datalab.utils._http.RequestException: HTTP request failed (status 403): Access Denied: BigQuery BigQuery: Permission denied while globbing file pattern.
  • Repro'ing is a bit complicated:
    • In gcp, make a "service account"
    • In gcp, create a "client id" for the service account
    • In gsuite, enable "domain-wide delegation" for the client id
    • Make a sheet
    • Share the sheet with the service account id (maybe not required?)
    • Make a bq table backed by the sheet
    • Query the table using the service account creds
  • Here's the most helpful reference I found:

- Allow service accounts to query bq tables backed by sheets
- Without this scope you get the following 403 error from bq, where
  "globbing file pattern" appears to come from gdrive:
```
datalab.utils._http.RequestException: HTTP request failed (status 403): Access Denied: BigQuery BigQuery: Permission denied while globbing file pattern.
```
- Repro'ing is a bit complicated:
  - In gcp, make a "service account"
  - In gcp, create a "client id" for the service account
  - In gsuite, enable "domain-wide delegation" for the client id
  - Make a sheet
  - Share the sheet with the service account id (maybe not required?)
  - Make a bq table backed by the sheet
  - Query the table using the service account creds
- Here's the most helpful reference I found:
  - https://stackoverflow.com/a/41676921/397334
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.884% when pulling acb9440 on jdanbrown:pr-drive-creds-scopes into bd9647f on googledatalab:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants