credentials static web identity credentials not picked up without an explicit profile option
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- aws, ruby
- Lĩnh vực
- authentication, cloud
Hướng nghiên cứu
Bắt đầu với gems/aws-sdk-core/lib/aws-sdk-core/credential_provider_chain.rb và gems/aws-sdk-core/lib/aws-sdk-core/plugins/credentials_configuration.rb, sau đó xem xét hành vi của cấu hình dùng chung được mô tả trong reproduction. Sử dụng hai lệnh gọi Aws::SQS::Client.new với cấu hình web identity để xác minh các yêu cầu STS hiện tại. Được xem là hoàn thành khi cấu hình dùng chung mặc định được sử dụng mà không có profile tường minh và các client được tạo lặp lại không refresh riêng từng client.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
We're using STS web identity token credentials to manage AWS SDK service call authentication via SigV4 (aws-sdk-core (3.211.0), should be the relevant bit). We noticed however, during load testing, some rate limiting happening, which we narrowed down to multiple calls to the STS token refresh endpoint, exacerbated by the scaling up of certain services. After some investigation, we figured out that multiple clients (for SQS, SNS, etc) were instantiated, and the token refresh path was called for each of them. This is not ideal, as there should be a single "refresh" happening, and the token should at best be shared across the multiple clients.
In the process, we found out that the AWS SDKs already support that via "shared config", and we proceeded to change our approach using it, replacing the env var setup using AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN with a AWS_CONFIG_FILE pointing to a file like this:
[default]
web_identity_token_file = $AWS_WEB_IDENTITY_TOKEN_FILE
role_arn = $AWS_ROLE_ARN
Expected Behavior
This should have worked, as in, when instantiating clients multiple times, there should only be one call to STS. This can be observed using this script:
Aws.config[:http_wire_trace] = true
Aws::SQS::Client.new
# one STS request log
Aws::SQS::Client.new
# no STS request log
Current Behavior
when instantiating two client instances, two STS requests are made.
While we noticed that Aws.shared_config was correctly filled up with the expected values, unfortunately calling i.e. Aws::SQS::Client.new was still going through this strategy and generating a token + refresh loop per client, because of this clause, i.e. the routine expects a profile to be set, however it's nil as per the option setup, although the docs say it's "default".
I believe this is a bug, as if "default", this would have worked. I also tried setting the AWS_PROFILE env var, but that doesn't fill it up either.
FWIW, setting Aws.config[:profile] = "default", or explicit option set a la Aws::SQS::Client.new(profile: "default"), work as expected (shared config is picked up). However, I'm looking for a "no config code" setup that can be rolled out across multiple services.
Reproduction Steps
Aws.config[:http_wire_trace] = true
Aws::SQS::Client.new
# one STS request log
Aws::SQS::Client.new
# no STS request log
Possible Solution
Perhaps initializing the profile option to whatever AWS_PROFILE defines?
Additional Information/Context
No response
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core 3.211.0
Environment details (Version of Ruby, OS environment)
"ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]"
- Ngôn ngữ chính
- Ruby
- Star
- 3.7k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-sdk-ruby
-
service-api
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
aws/aws-sdk-ruby#3395 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BedrockAgentCore: invoke_agent_runtime buffers entire response instead of streaming in real-timeĐang mởdocumentation p3 queued
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
aws/aws-sdk-ruby#3348 · 6 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
investigating service-api
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-sdk-ruby#3217 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
service-api
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
aws/aws-sdk-ruby#3191 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-sdk-ruby#3190 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws/aws-sdk-ruby
Issue tương tự
-
[Bug] Chatwoot v4.19.0 – Super Admin returns 500 due to missing superadmin.scss Vite manifest entryĐang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày
-
PRM baseline System 1 and 2 fans run continuously in unoccupied hours (low priority)Có thể đã có người làm @anchapin đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NatLabRockies/openstudio-standards#2167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
-
Ruby 4.0.9, 3.4.12, 3.3.13Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
internal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Kong/developer.konghq.com#7716 ·
Maintainer thường phản hồi trong vòng 1 ngày