Error during sending a signed http request to ElasticSearch
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với việc xây dựng request và lệnh gọi Aws::Client::AWSAuthV4Signer::SignRequest được nêu trong issue, sau đó tái hiện request tới Elasticsearch bằng region đã cấu hình và thông tin xác thực từ môi trường. So sánh các đầu vào dùng để ký với phản hồi của service; hoàn tất khi xác nhận được lỗi của library bằng một bản tái hiện tối thiểu hoặc ghi lại cách sửa cấu hình của bên gọi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
hey,
I am running into an error while making a httprequest to Elastic Search The error is
The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method
Following is the code. Any pointers to bug in my code or library would be appreciated.
`invocation_response my_handler(invocation_request const& request)
{
ClientConfiguration config;
config.region = Aws::Environment::GetEnv("AWS_REGION");
config.caFile = "/etc/pki/tls/certs/ca-bundle.crt";
auto credentialsProvider = Aws::MakeShared<Aws::Auth::EnvironmentAWSCredentialsProvider>("es");
auto client = CreateHttpClient(config);
auto httpRequest = CreateHttpRequest(URL, HttpMethod::HTTP_GET,
Aws::Utils::Stream::DefaultResponseStreamFactoryMethod);
httpRequest->SetContentType("application/json");
nlohmann::json query1 = {};
query1.emplace("size", 25);
std::shared_ptr<Aws::StringStream> sstream = make_shared<Aws::StringStream>();
*sstream << query1;
httpRequest->AddContentBody(sstream);
Aws::Client::AWSAuthV4Signer signer(credentialsProvider, "es", config.region);
auto req = httpRequest.get();
signer.SignRequest(*req);
auto outcome = client->MakeRequest(httpRequest);
if (outcome->GetResponseCode() == HttpResponseCode::OK) {
cout << "SUCCESS" << endl;
} else {
// print the response from the http request
cout << "ERROR" << endl;
cout << outcome->GetResponseBody().rdbuf() << endl;
cout << outcome->GetResponseCode() << endl;
}`
- Ngôn ngữ chính
- C++
- Star
- 465
- Fork
- 98
- Merge trung bình
- 1 giờ 16 phút
- Pull request đã merge (30 ngày)
- 2
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 awslabs/aws-lambda-cpp
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
awslabs/aws-lambda-cpp#205 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
awslabs/aws-lambda-cpp#196 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
awslabs/aws-lambda-cpp#195 · 11 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
awslabs/aws-lambda-cpp#194 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
awslabs/aws-lambda-cpp#170 ·
Tất cả issue của awslabs/aws-lambda-cpp
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AXERA-TECH/ax-llm#77 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
games-on-whales/wolf#509 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
bug-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NVIDIA/cuda-samples#453 ·