shangxinli commented on code in PR #1041:
URL: https://github.com/apache/iceberg-cpp/pull/1041#discussion_r4350357179
##########
src/iceberg/catalog/rest/rest_catalog.cc:
##########
@@ -511,6 +514,30 @@ Result<std::shared_ptr<RestCatalog>> RestCatalog::Make(
ICEBERG_ASSIGN_OR_RAISE(auto client, client_factory(final_config));
ICEBERG_PRECHECK(client != nullptr, "HTTP client factory returned null");
+
+ // Warn if oauth2-server-uri is neither explicitly configured nor protected
from
+ // server overrides while using credential auth.
Review Comment:
Warns only on credential, but Java's warnIfOAuthServerUriNotSet at
OAuth2Manager.java:294 also fires when token is set, so a token-only client
gets no warning.
##########
src/iceberg/catalog/rest/auth/auth_properties.h:
##########
@@ -128,4 +128,20 @@ class ICEBERG_REST_EXPORT AuthProperties : public
ConfigBase<AuthProperties> {
std::optional<int64_t> expires_at_millis_;
};
+/// \brief Resolve the OAuth2 server URI from a properties map.
+///
+/// This function resolves the OAuth2 server URI by examining the
+/// `oauth2-server-uri` key in the provided properties map. The resolution
logic:
+/// - If the value starts with `http://` or `https://`, it is returned as-is
+/// (absolute URL).
+/// - If the value is empty, it is returned as-is.
+/// - Otherwise, the value is treated as a relative path and resolved against
the
+/// `uri` key from the properties map. If the relative path starts with `/`,
it
+/// is appended directly; otherwise, a `/` separator is inserted.
+///
+/// \param properties Properties map containing `oauth2-server-uri` and `uri`
keys.
+/// \return Resolved OAuth2 server URI.
+Result<std::string> ResolveOAuth2ServerUri(
Review Comment:
nit: missing ICEBERG_REST_EXPORT, which AuthProperties in this same header
has - this is now the only declaration here without it.
--
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]