Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: deduplicate x-goog-api-client headers#17616
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
7658d027d266a3852c5b10d8865a76274cae42f0a3fc05e08e6957fb50283ba9a1ce95978b26719a0099358d71c840843ab2dde95049f10bcc47ba60bff55cc90d46994c1203a38f0f9c4d6539e19d420File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -254,11 +254,20 @@ def _create_composite_credentials( | ||
| request = google.auth.transport.requests.Request() | ||
| # Create the metadata plugin for inserting the authorization header. | ||
| metadata_plugin = google.auth.transport.grpc.AuthMetadataPlugin( | ||
| credentials, | ||
| request, | ||
| default_host=default_host, | ||
| ) | ||
| try: | ||
| metadata_plugin = google.auth.transport.grpc.AuthMetadataPlugin( | ||
| credentials, | ||
| request, | ||
| default_host=default_host, | ||
| suppress_metrics_header=True, | ||
| ) | ||
| except TypeError: | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just double checking it is intended/desirable to catch/handle ALL TypeErrors that could be raised? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TypeError is what Python raises when an invalid kwarg argument is passed, so this is as specific as we can be here. If something else is causing the error, we would expect to see it on the next line | ||
| # Support older versions of google-auth that do not accept suppress_metrics_header | ||
| metadata_plugin = google.auth.transport.grpc.AuthMetadataPlugin( | ||
| credentials, | ||
| request, | ||
| default_host=default_host, | ||
| ) | ||
| # Create a set of grpc.CallCredentials using the metadata plugin. | ||
| google_auth_credentials = grpc.metadata_call_credentials(metadata_plugin) | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
This return type tuple doc string seems to be reversed from the actual return tuple which is the string first and then the metadata
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.
Good catch, fixed