-
Notifications
You must be signed in to change notification settings - Fork 256
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
feat: Provide opt-in debug logging #490
Conversation
9e18ab5
to
79b6566
Compare
e9b6fcf
to
e9c8a85
Compare
ceca647
to
d9f698d
Compare
@project_id ||= CredentialsLoader.load_gcloud_project_id | ||
@client.fetch_access_token! if @client.needs_access_token? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dazuma was this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tartakynov Yes it was. Auth clients should be fetching tokens just-in-time when a request is actually made, rather than eagerly up front. Did this cause an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dazuma This change also broke our codebase... We now get this error when trying to call BigQuery:
Google::Cloud::UnauthenticatedError: Unauthorized
Upgrading to 1.12.2
etc does not help.
Adds a
logger
attribute to each credential type (via BaseClient) and a pass-through from the high-level Credential class. The value isnil
by default, but when set, certain events such as JWT application and OAuth2 token exchange are logged. Tokens are obfuscated via sha256.