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

feat: Provide opt-in debug logging #490

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

dazuma
Copy link
Member

@dazuma dazuma commented Aug 28, 2024

Adds a logger attribute to each credential type (via BaseClient) and a pass-through from the high-level Credential class. The value is nil by default, but when set, certain events such as JWT application and OAuth2 token exchange are logged. Tokens are obfuscated via sha256.

@dazuma dazuma requested a review from a team as a code owner August 28, 2024 00:03
@dazuma dazuma marked this pull request as draft August 28, 2024 00:04
@dazuma dazuma force-pushed the pr/logging branch 10 times, most recently from 9e18ab5 to 79b6566 Compare September 5, 2024 18:38
@dazuma dazuma force-pushed the pr/logging branch 2 times, most recently from e9b6fcf to e9c8a85 Compare October 24, 2024 22:09
@dazuma dazuma marked this pull request as ready for review October 30, 2024 16:52
@dazuma dazuma changed the title feat: provided opt-in debug logging feat: Provide opt-in debug logging Oct 30, 2024
@dazuma dazuma force-pushed the pr/logging branch 2 times, most recently from ceca647 to d9f698d Compare November 26, 2024 19:43
@dazuma dazuma requested a review from aandreassa November 26, 2024 19:43
@dazuma dazuma merged commit 5f97a26 into googleapis:main Dec 5, 2024
11 checks passed
@dazuma dazuma deleted the pr/logging branch December 5, 2024 20:20
@project_id ||= CredentialsLoader.load_gcloud_project_id
@client.fetch_access_token! if @client.needs_access_token?
Copy link

@tartakynov tartakynov Dec 18, 2024

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?

Copy link
Member Author

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dazuma yeah, I left a bug report here 👉 #508

Copy link

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.

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

Successfully merging this pull request may close these issues.

4 participants