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

impl(oauth2): building blocks for AWS external accounts #10439

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Dec 14, 2022

As with the other external accounts, we need to build a subject token for AWS external accounts. Building this subject token requires obtaining a number of pieces of information. These can be found on environment variables or via the VM's metadata service. The functions to get them are complex enough that they deserve their own tests.

Part of the work for #5915


This change is Reviewable

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: cb3c18fde23954be2bb8bb2fb8d01a5d4e2c8b03

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Dec 14, 2022

Codecov Report

Base: 93.86% // Head: 93.86% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (dae9615) compared to base (aaef42e).
Patch coverage: 97.53% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #10439    +/-   ##
========================================
  Coverage   93.86%   93.86%            
========================================
  Files        1612     1612            
  Lines      146356   146640   +284     
========================================
+ Hits       137370   137647   +277     
- Misses       8986     8993     +7     
Impacted Files Coverage Δ
...loud/internal/external_account_token_source_aws.cc 92.45% <91.78%> (-1.49%) ⬇️
...internal/external_account_token_source_aws_test.cc 99.69% <99.52%> (-0.31%) ⬇️
...loud/spanner/internal/logging_result_set_reader.cc 88.00% <0.00%> (-4.00%) ⬇️
...e/cloud/pubsublite/internal/alarm_registry_impl.cc 97.05% <0.00%> (-2.95%) ⬇️
...integration_tests/schema_admin_integration_test.cc 98.88% <0.00%> (-1.12%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 97.82% <0.00%> (-0.51%) ⬇️
google/cloud/storage/parallel_upload.cc 98.28% <0.00%> (-0.35%) ⬇️
...le/cloud/spanner/database_admin_connection_test.cc 99.70% <0.00%> (+0.19%) ⬆️
google/cloud/spanner/database_admin_connection.cc 85.59% <0.00%> (+0.28%) ⬆️
...le/cloud/internal/default_completion_queue_impl.cc 97.15% <0.00%> (+0.56%) ⬆️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coryan coryan marked this pull request as ready for review December 14, 2022 17:45
@coryan coryan requested a review from a team as a code owner December 14, 2022 17:45
google/cloud/internal/external_account_token_source_aws.cc Outdated Show resolved Hide resolved
google/cloud/internal/external_account_token_source_aws.cc Outdated Show resolved Hide resolved
google/cloud/internal/external_account_token_source_aws.cc Outdated Show resolved Hide resolved
auto role = GetMetadata(info.url, metadata_token, cf, opts);
if (!role) return std::move(role).status();
auto path = info.url;
if (path.back() != '/') path.push_back('/');
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need check path.empty()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to leave this as-is for now. This will only be used with an info initialized with ParseExternalAccountTokenSourceAws() and I will be adding some code to prevent empty url values to that function.

@coryan coryan force-pushed the feat-oauth2-workload-identity-federation-pr23 branch from cb3c18f to 8c8e147 Compare December 15, 2022 02:18
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 8c8e14797e6c491d2a6c685c21237fbd31f29c3c

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

As with the other external accounts, we need to build a subject token
for AWS external accounts. Building this subject token requires
obtaining a number of pieces of information. These can be found on
environment variables or via the VM's metadata service. The functions
to get them are complex enough that they deserve their own tests.
@coryan coryan force-pushed the feat-oauth2-workload-identity-federation-pr23 branch from 8c8e147 to dae9615 Compare December 15, 2022 13:32
@coryan coryan enabled auto-merge (squash) December 15, 2022 13:33
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: dae9615eecf294efd784d26c32a862c95db027a0

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@coryan coryan merged commit 1c767b0 into googleapis:main Dec 15, 2022
@coryan coryan deleted the feat-oauth2-workload-identity-federation-pr23 branch December 15, 2022 14:07
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.

3 participants