-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Reuse explicit credentials when creating 'database.spanner_api'. #3722
Conversation
@@ -154,8 +158,13 @@ def ddl_statements(self): | |||
def spanner_api(self): | |||
"""Helper for session-related API calls.""" | |||
if self._spanner_api is None: | |||
base_creds = self._instance._client.credentials | |||
scoped = base_creds.with_scopes((SPANNER_DATA_SCOPE,)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
- Preserves "custom" credentials (existing code worked only with implicit credentials from the environment). - Add tests ensuring scopes are set for correctly for all GAX apis (client uses admin scope, which do not grant data access, while database uses data scope, which does not grant admin access). Closes #3718.
65013ad
to
de8e18c
Compare
Github buried my comment, re-posting:
|
@jonparrott Who actually implements |
'google.auth.credentials.with_scopes_if_required' doesn't replace scopes, but only adds them if missing. Addresses: #3722 (comment).
@jonparrott See cf5b2df |
…gleapis#3722) - Preserves "custom" credentials (existing code worked only with implicit credentials from the environment). - Add tests ensuring scopes are set for correctly for all GAX apis (client uses admin scope, which do not grant data access, while database uses data scope, which does not grant admin access).
…gleapis#3722) - Preserves "custom" credentials (existing code worked only with implicit credentials from the environment). - Add tests ensuring scopes are set for correctly for all GAX apis (client uses admin scope, which do not grant data access, while database uses data scope, which does not grant admin access).
…gleapis#3722) - Preserves "custom" credentials (existing code worked only with implicit credentials from the environment). - Add tests ensuring scopes are set for correctly for all GAX apis (client uses admin scope, which do not grant data access, while database uses data scope, which does not grant admin access).
Closes #3718.