hello-stephen commented on code in PR #71205:
URL: https://github.com/apache/doris/pull/71205#discussion_r4767021309


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorProvider.java:
##########
@@ -94,6 +94,44 @@ public ConnectorSecuritySurface securitySurface() {
         // Keep secret masking and JDBC restrictions when REST decryption adds 
a KMS endpoint check.
         return 
ConnectorSecuritySurface.ofJdbcDriverUrls("iceberg.catalog.type", 
"iceberg.jdbc.driver_url")
                 .withSensitiveKeys(MetaStoreProviders.sensitivePropertyKeys())
-                .withSsrfEndpoints("kms.endpoint");
+                .withSsrfEndpoints("kms.endpoint", "iceberg.rest.uri", "uri", 
"iceberg.rest.oauth2.server-uri",
+                        "hive.metastore.uris", "metastore.thrift.uris", 
"s3tables.endpoint", "iceberg.jdbc.uri",
+                        "oauth2-server-uri", 
"client.refresh-credentials-endpoint", "dynamodb.endpoint",

Review Comment:
   [P2] Preserve relative Iceberg credential and OAuth paths
   
   With the checker enabled, a REST catalog with 
`iceberg.rest.uri=https://allowed.example.com` and 
`client.refresh-credentials-endpoint=/v1/credentials` now fails admission: 
`parseSingle` treats the leading slash as an empty authority. Doris forwards 
this option unchanged, while the pinned [Iceberg 1.12.0 credential 
configuration](https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/aws/src/main/java/org/apache/iceberg/aws/AwsClientProperties.java)
 resolves it against the catalog URI using 
[RESTUtil.resolveEndpoint](https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java),
 so its real destination remains the allowed server. The OAuth declarations 
have the same problem with `iceberg.rest.oauth2.server-uri=v1/oauth/tokens` (or 
raw `oauth2-server-uri`): the SDK accepts that relative request path and 
[appends it to the HTTP client 
base](https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/core/src/main/java/or
 g/apache/iceberg/rest/HTTPRequest.java). Consequently CREATE, lazy 
reconstruction and ALTER of catalogs storing these valid values fail even when 
every actual destination is permitted. Preserve each option's base/path 
semantics while checking absolute endpoints, and add enabled-policy acceptance 
cases for relative refresh/OAuth paths alongside absolute-endpoint rejection 
cases.



-- 
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]

Reply via email to