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

fix: restore credential logic #12690

Merged
merged 2 commits into from
Sep 21, 2023
Merged

fix: restore credential logic #12690

merged 2 commits into from
Sep 21, 2023

Conversation

dbolduc
Copy link
Member

@dbolduc dbolduc commented Sep 21, 2023

Modifies #12671 and #12672 to only forward the OTel tracing option in cases where the library is responsible for creating the default credentials.

Passing extra options was breaking at least authorized user credential authentication, and possibly more.


This change is Reviewable

@dbolduc dbolduc temporarily deployed to internal September 21, 2023 11:50 — with GitHub Actions Inactive
@dbolduc dbolduc marked this pull request as ready for review September 21, 2023 13:33
@dbolduc dbolduc requested a review from a team as a code owner September 21, 2023 13:33
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch coverage: 96.77% and no project coverage change.

Comparison is base (2915e8e) 93.58% compared to head (e06662c) 93.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12690   +/-   ##
=======================================
  Coverage   93.58%   93.58%           
=======================================
  Files        2069     2069           
  Lines      183018   183044   +26     
=======================================
+ Hits       171276   171304   +28     
+ Misses      11742    11740    -2     
Files Changed Coverage Δ
generator/internal/stub_factory_rest_generator.cc 0.00% <ø> (ø)
google/cloud/internal/populate_common_options.cc 97.72% <85.71%> (-2.28%) ⬇️
.../internal/golden_kitchen_sink_rest_stub_factory.cc 100.00% <100.00%> (ø)
.../v1/internal/golden_rest_only_rest_stub_factory.cc 100.00% <100.00%> (ø)
...1/internal/golden_thing_admin_rest_stub_factory.cc 100.00% <100.00%> (ø)
...gle/cloud/internal/populate_common_options_test.cc 96.00% <100.00%> (+0.65%) ⬆️
google/cloud/storage/client_options.cc 86.74% <100.00%> (+0.07%) ⬆️
google/cloud/storage/internal/grpc/stub.cc 98.93% <100.00%> (+<0.01%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

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

There is some obvious refactoring needed. This predates your PR though, so approved as-is.

@@ -91,7 +92,8 @@ std::shared_ptr<$stub_rest_class_name$>
CreateDefault$stub_rest_class_name$(Options const& options) {
Options opts = options;
if (!opts.has<UnifiedCredentialsOption>()) {
opts.set<UnifiedCredentialsOption>(MakeGoogleDefaultCredentials(options));
opts.set<UnifiedCredentialsOption>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like all the code generated here could go into a common function in google::cloud::internal or google::cloud::rest_internal. There is nothing specific to this stub from lines 93 to 107.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

@dbolduc dbolduc merged commit f3629f2 into googleapis:main Sep 21, 2023
54 checks passed
@dbolduc dbolduc deleted the fix-rest-creds branch September 21, 2023 16:02
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.

2 participants