Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support authorised user credentials #452

Open
v01dXYZ opened this issue Apr 21, 2022 · 0 comments
Open

Support authorised user credentials #452

v01dXYZ opened this issue Apr 21, 2022 · 0 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@v01dXYZ
Copy link

v01dXYZ commented Apr 21, 2022

Currently we only support service accounts because we directly use google.oauth2.service_account:

if credentials_path:
credentials = service_account.Credentials.from_service_account_file(
credentials_path
)
credentials = credentials.with_scopes(SCOPES)
default_project = credentials.project_id
elif credentials_info:
credentials = service_account.Credentials.from_service_account_info(
credentials_info
)

A possible solution to that, depending on the credential argument:

  • credential_path: directly use load_credentials_from_file from google.auth
  • credential_info/credential_base64: Unfortunately the _load_credentials_from_info is private to google.auth, but we can add a utility function to mimic its behaviour for service accounts and authorised users since that's just dispatch for those cases.

google.auth.load_credentials_from_file: https://github.com/googleapis/google-auth-library-python/blob/f3b72e161ec8302251f04b0121d59476a167a729/google/auth/_default.py#L82

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label Apr 21, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 22, 2022
@meredithslota meredithslota added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants