plusplusjiajia commented on code in PR #616:
URL: https://github.com/apache/iceberg-cpp/pull/616#discussion_r3076944844
##########
src/iceberg/catalog/rest/auth/auth_managers.cc:
##########
@@ -98,4 +105,28 @@ Result<std::unique_ptr<AuthManager>> AuthManagers::Load(
return it->second(name, properties);
}
+#ifdef ICEBERG_BUILD_SIGV4
+Result<std::unique_ptr<AuthManager>> MakeSigV4AuthManager(
+ std::string_view name,
+ const std::unordered_map<std::string, std::string>& properties) {
+ // Determine the delegate auth type. Default to OAuth2 if not specified.
+ std::string delegate_type = AuthProperties::kAuthTypeOAuth2;
+ auto it = properties.find(AuthProperties::kSigV4DelegateAuthType);
+ if (it != properties.end() && !it->second.empty()) {
+ delegate_type = StringUtils::ToLower(it->second);
+ }
+
+ // Prevent circular delegation (sigv4 -> sigv4 -> ...).
+ ICEBERG_PRECHECK(delegate_type != AuthProperties::kAuthTypeSigV4,
+ "Cannot delegate a SigV4 auth manager to another SigV4 auth
manager");
Review Comment:
> add delegate_type in error message?
Good idea, 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]