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

Refactor AWS credentials to support credential expiry and greater modularity #119

Merged
merged 70 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
1ef2911
Move AwsCredentials into a separate header
sjperkins Sep 23, 2023
3ac4c5e
Split environment credential provider out into separate file
sjperkins Sep 23, 2023
9edd078
Split file credential provider out into separate files
sjperkins Sep 23, 2023
d5aeed6
Shorter filenames
sjperkins Sep 23, 2023
9fea6cb
Split EC2 Metadata credential provider into separate files
sjperkins Sep 23, 2023
e02941d
Cleanup imports
sjperkins Sep 23, 2023
dc2a529
Correct header guards
sjperkins Sep 23, 2023
c8975ed
Add an AnonymousCredentialProvider
sjperkins Sep 23, 2023
e34cdeb
Add a chained credential provider
sjperkins Sep 23, 2023
41cca5e
Split file provider tests into separate test unit
sjperkins Sep 23, 2023
5b831e1
Split out environment provider test cases into separate test unit
sjperkins Sep 23, 2023
2a23039
Update comments
sjperkins Sep 23, 2023
786ba4d
Add expiry concepts to AwsCredentialProvider
sjperkins Sep 23, 2023
a4a6bcb
Chained Credential Provider Test Cases
sjperkins Sep 23, 2023
97e68b3
Move s3 credentials functionality into credentials subfolder
sjperkins Sep 23, 2023
8ce0df8
Remove expiry date from AwsCredentials
sjperkins Sep 23, 2023
569a333
Add an ExpiresAt interface to AwsCredentialProvider
sjperkins Sep 23, 2023
e6e5040
CachedCredentialProvider
sjperkins Sep 23, 2023
dd7f691
Expiry credential provider test separate compilation unit and test cases
sjperkins Sep 30, 2023
3eae538
Update test cases
sjperkins Oct 2, 2023
9a4535e
Merge branch 'master' into aws-credentials-expiration
sjperkins Oct 2, 2023
9a813af
IWYU
sjperkins Oct 2, 2023
dffe7a1
Remove empty test case
sjperkins Oct 2, 2023
8955bf8
Forbid encapsulating nullptr's in CachedCredentialsProvider
sjperkins Oct 3, 2023
484b12b
Primary .h header include order
sjperkins Oct 3, 2023
0ae68ec
Fix CachedCredentialsProvider base case
sjperkins Oct 3, 2023
8023465
CachedCredentialProvider comments
sjperkins Oct 3, 2023
0988963
Merge branch 'master' into aws-credentials-expiration
sjperkins Oct 13, 2023
42c32a8
Remove caching in the EC2CredentialsProvider (as this occurs in the C…
sjperkins Oct 13, 2023
1e5174b
Don't query EC2 Metadata server if it doesn't respond timeously on fi…
sjperkins Oct 13, 2023
70850e1
Remove stray merge artifacts
sjperkins Oct 13, 2023
948f5ff
Fix IsExpired bug and implement ExpiresAt for Environment and File Pr…
sjperkins Oct 13, 2023
407923b
Add some leeway to EC2 timeout and check ExpiresAt in EC2 test case
sjperkins Oct 13, 2023
3b49ee3
Remove some unneeded #includes
sjperkins Oct 13, 2023
f9d9f9d
Merge branch 'master' into aws-credentials-expiration
sjperkins Oct 18, 2023
47ef623
clang-format
sjperkins Oct 23, 2023
463a651
Merge branch 'master' into aws-credentials-expiration
sjperkins Nov 2, 2023
c47e1fb
Merge branch 'master' into aws-credentials-expiration
sjperkins Nov 10, 2023
45d5296
Include CREDENTIALs in #includes
sjperkins Nov 10, 2023
a5f421f
Removed expired, chained and cached credential providers, replace wit…
sjperkins Nov 10, 2023
16f31e1
Default Credential Provider tests
sjperkins Nov 13, 2023
6bb81eb
Mark some tests as small
sjperkins Nov 13, 2023
5cd9f60
clang-format
sjperkins Nov 13, 2023
e5ceaf3
IWYU
sjperkins Nov 13, 2023
39ccfe0
Merge branch 'master' into aws-credentials-expiration
sjperkins Nov 13, 2023
eda9842
Set test_utils library test_only=11
sjperkins Nov 14, 2023
e947d63
IWYU reverts
sjperkins Nov 14, 2023
326a725
Refactor aws_credential_provider library into smaller libraries
sjperkins Nov 14, 2023
af52f41
File credential provider style nits
sjperkins Nov 14, 2023
9636486
Environment credential provider style nits
sjperkins Nov 14, 2023
4a07bb7
Remove use of future from environment_credential_provider_test.cc
sjperkins Nov 14, 2023
6eaa619
AwsCredentials updates
sjperkins Nov 14, 2023
a3101a5
Add FileCredentialProvider.Get{FileName,Profile} accessors
sjperkins Nov 14, 2023
9638945
EnvironmentCredentialProvider style nits
sjperkins Nov 14, 2023
44936fa
Support metadata_endpoint in the AwsCredentialsResource
sjperkins Nov 14, 2023
ff2e4ed
docstring nit
sjperkins Nov 14, 2023
4c2b8da
Set default timeout period once credentials have been retrieved
sjperkins Nov 14, 2023
a9a4ad7
Test metadata service endpoint configuration
sjperkins Nov 14, 2023
1d39c46
More EC2 Metadata Endpoint Testing
sjperkins Nov 15, 2023
c3bebf6
Apply clangd IWYU suggestions
sjperkins Nov 15, 2023
8b23ef0
clang-format
sjperkins Nov 15, 2023
968d3bd
Fix subprocess_test on windows+mingw: include PATH in the environment
laramiel Nov 15, 2023
6ed2030
Test Anonymous Credentials and Environment Credentials
sjperkins Nov 15, 2023
840bc0d
Credentials IWYU scan
sjperkins Nov 15, 2023
3812b8b
some autos
sjperkins Nov 15, 2023
24271d7
Cut whitespace down
sjperkins Nov 15, 2023
77bf8cf
clang-format
sjperkins Nov 15, 2023
1040153
Remove unnecessary includes in environment_credential_provider_test.cc
sjperkins Nov 15, 2023
4295487
Fix schema.yml indent
sjperkins Nov 15, 2023
0901374
Merge branch 'master' into aws-credentials-expiration
sjperkins Nov 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 6 additions & 69 deletions tensorstore/kvstore/s3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ tensorstore_cc_library(
],
hdrs = ["s3_metadata.h"],
deps = [
":aws_credential_provider",
":s3_endpoint",
":s3_request_builder",
":s3_resource",
Expand All @@ -47,6 +46,7 @@ tensorstore_cc_library(
"//tensorstore/kvstore:key_range",
"//tensorstore/kvstore/gcs:validate",
"//tensorstore/kvstore/gcs_http:rate_limiter",
"//tensorstore/kvstore/s3/credentials:default_credential_provider",
"//tensorstore/serialization",
"//tensorstore/util:executor",
"//tensorstore/util:future",
Expand Down Expand Up @@ -150,11 +150,11 @@ tensorstore_cc_library(
"s3_request_builder.h",
],
deps = [
":aws_credential_provider",
":s3_uri_utils",
"//tensorstore/internal:uri_utils",
"//tensorstore/internal/digest:sha256",
"//tensorstore/internal/http",
"//tensorstore/kvstore/s3/credentials:aws_credential_provider",
"//tensorstore/internal/log:verbose_flag",
"//tensorstore/kvstore:byte_range",
"@com_google_absl//absl/base:core_headers",
Expand All @@ -172,9 +172,9 @@ tensorstore_cc_test(
size = "small",
srcs = ["s3_request_builder_test.cc"],
deps = [
":aws_credential_provider",
":s3_request_builder",
"//tensorstore/internal/http",
"//tensorstore/kvstore/s3/credentials:aws_credential_provider",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/time",
Expand Down Expand Up @@ -208,71 +208,6 @@ tensorstore_cc_test(
],
)

tensorstore_cc_library(
name = "aws_credential_provider",
srcs = [
"aws_credential_provider.cc",
"aws_metadata_credential_provider.cc",
],
hdrs = [
"aws_credential_provider.h",
"aws_metadata_credential_provider.h",
],
deps = [
"//tensorstore/internal:env",
"//tensorstore/internal:no_destructor",
"//tensorstore/internal:path",
"//tensorstore/internal/http",
"//tensorstore/internal/json",
"//tensorstore/internal/json_binding",
"//tensorstore/internal/json_binding:absl_time",
"//tensorstore/internal/json_binding:bindable",
"//tensorstore/util:result",
"//tensorstore/util:status",
"//tensorstore/util:str_cat",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:cord",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
)

tensorstore_cc_test(
name = "aws_credential_provider_test",
srcs = ["aws_credential_provider_test.cc"],
deps = [
":aws_credential_provider",
"//tensorstore/internal:env",
"//tensorstore/internal:path",
"//tensorstore/internal:test_util",
"//tensorstore/internal/http:curl_transport",
"//tensorstore/util:result",
"//tensorstore/util:status_testutil",
"@com_google_googletest//:gtest_main",
],
)

tensorstore_cc_test(
name = "aws_metadata_credential_provider_test",
srcs = ["aws_metadata_credential_provider_test.cc"],
deps = [
":aws_credential_provider",
"//tensorstore/internal/http",
"//tensorstore/util:result",
"//tensorstore/util:status_testutil",
"//tensorstore/util:str_cat",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:cord",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)

tensorstore_cc_test(
name = "localstack_test",
srcs = ["localstack_test.cc"],
Expand All @@ -287,7 +222,7 @@ tensorstore_cc_test(
"skip-cmake",
],
deps = [
":aws_credential_provider",
"//tensorstore/kvstore/s3/credentials:aws_credential_provider",
":s3",
":s3_request_builder",
"//tensorstore:context",
Expand All @@ -314,6 +249,7 @@ tensorstore_cc_test(
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
size = "small"
)

tensorstore_cc_library(
Expand All @@ -336,6 +272,7 @@ tensorstore_cc_library(

tensorstore_cc_test(
name = "s3_endpoint_test",
size = "small",
srcs = ["s3_endpoint_test.cc"],
deps = [
":s3_endpoint",
Expand Down
257 changes: 0 additions & 257 deletions tensorstore/kvstore/s3/aws_credential_provider.cc

This file was deleted.

Loading
Loading