lishuxu commented on code in PR #544:
URL: https://github.com/apache/iceberg-cpp/pull/544#discussion_r2792450453
##########
src/iceberg/catalog/rest/http_client.cc:
##########
@@ -146,11 +147,18 @@ HttpClient::HttpClient(std::unordered_map<std::string,
std::string> default_head
HttpClient::~HttpClient() = default;
+Result<std::unordered_map<std::string, std::string>> HttpClient::AuthHeaders(
+ auth::AuthSession& session) {
+ std::unordered_map<std::string, std::string> headers;
+ ICEBERG_RETURN_UNEXPECTED(session.Authenticate(headers));
+ return headers;
+}
+
Result<HttpResponse> HttpClient::Get(
const std::string& path, const std::unordered_map<std::string,
std::string>& params,
- const std::unordered_map<std::string, std::string>& headers,
- const ErrorHandler& error_handler) {
- auto final_headers = MergeHeaders(default_headers_, headers);
+ const ErrorHandler& error_handler, auth::AuthSession& session) {
+ ICEBERG_ASSIGN_OR_RAISE(auto auth_headers, AuthHeaders(session));
+ auto final_headers = MergeHeaders(default_headers_, auth_headers);
Review Comment:
Good catch, done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]