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

S3: add support for STS session tokens #1472

Merged
merged 1 commit into from
Jan 13, 2020
Merged

Conversation

ihnorton
Copy link
Member

Some AWS credentials are issued via the AWS STS, which requires to pass an additional "session token" to the AWSCredentials object.

Fixes issue raised by user in the forum: https://forum.tiledb.com/t/tile-db-s3-documentation/132/5

[ch1468]

@@ -224,6 +224,9 @@ Status S3::init(const Config& config, ThreadPool* const thread_pool) {
auto aws_secret_access_key =
config.get("vfs.s3.aws_secret_access_key", &found);
assert(found);
auto aws_session_token =
config.get("vfs.s3.aws_session_token", &found);
assert(found);
Copy link
Contributor

Choose a reason for hiding this comment

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

The commit message leads me to believe that tokens are not always required. Should we really have an assert here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Consistency with the others -- the dict entry is also still expected for the key and secret, even if empty.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, thanks!

Copy link
Contributor

@joe-maley joe-maley left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -224,6 +224,9 @@ Status S3::init(const Config& config, ThreadPool* const thread_pool) {
auto aws_secret_access_key =
config.get("vfs.s3.aws_secret_access_key", &found);
assert(found);
auto aws_session_token =
config.get("vfs.s3.aws_session_token", &found);
assert(found);
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, thanks!

@ihnorton ihnorton force-pushed the ihn/s3_support_sts_token branch 2 times, most recently from 80a7f33 to 17f6f3a Compare January 13, 2020 15:21
If the user has set a session token (for AWS Security Token Service)
then use it:
    - https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html

For testing run: `aws sts get-session-token --duration-seconds 900`. See:
    - https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html
@ihnorton ihnorton force-pushed the ihn/s3_support_sts_token branch from 17f6f3a to 2a55836 Compare January 13, 2020 16:04
@ihnorton ihnorton merged commit 06a6b63 into dev Jan 13, 2020
@ihnorton ihnorton deleted the ihn/s3_support_sts_token branch January 13, 2020 17:21
ihnorton added a commit that referenced this pull request Jan 16, 2020
ihnorton added a commit that referenced this pull request Jan 16, 2020
ihnorton added a commit to ihnorton/TileDB that referenced this pull request Mar 6, 2020
(cherry picked from commit b46407c)
ihnorton added a commit that referenced this pull request Mar 6, 2020
(cherry picked from commit b46407c)
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