github-actions[bot] commented on code in PR #70725:
URL: https://github.com/apache/doris/pull/70725#discussion_r4624232428


##########
fe/fe-connector/fe-connector-lance/src/main/java/org/apache/doris/connector/lance/LanceCatalogProperties.java:
##########
@@ -160,36 +211,157 @@ private static void validateWarehouse(String warehouse) {
             return;
         }
         String scheme = uri.getScheme().toLowerCase(Locale.ROOT);
-        if (!"file".equals(scheme) && !"s3".equals(scheme)) {
+        if (!"file".equals(scheme) && !"s3".equals(scheme) && 
!"oss".equals(scheme)) {
             throw new IllegalArgumentException("Unsupported Lance filesystem 
warehouse scheme '" + scheme
-                    + "'; supported schemes are local/file and s3");
+                    + "'; supported schemes are local/file, s3, and oss");
         }
         // An object-store root names its bucket in the authority. Lance reads 
that authority as the
         // bucket and fails deep inside the store when it is absent, so reject 
the no-authority form
         // here where the message can still name the property.
-        if ("s3".equals(scheme) && StringUtils.isBlank(uri.getAuthority())) {
+        if (("s3".equals(scheme) || "oss".equals(scheme)) && 
StringUtils.isBlank(uri.getAuthority())) {
             throw new IllegalArgumentException(
                     "Lance " + scheme + " warehouse must name a bucket, as in 
" + scheme
                             + "://bucket/path, but was: " + warehouse);
         }
     }
 
+    private void validateRestProperties() {
+        if (raw.containsKey(WAREHOUSE)) {
+            throw new IllegalArgumentException("Property 'warehouse' is not 
valid for Lance REST catalog");
+        }
+        if (StringUtils.isBlank(restUri)) {
+            throw new IllegalArgumentException(
+                    "Missing required property '" + REST_URI + "' for Lance 
REST catalog");
+        }
+        validateRestUri(restUri);
+
+        boolean bearerTokenConfigured = raw.containsKey(REST_BEARER_TOKEN);

Review Comment:
   [P2] Allow cleared credentials when changing REST authentication
   
   `ALTER CATALOG` merges updates into the existing property map and cannot 
remove a key. For a bearer catalog, changing to `api_key` while setting 
`lance.rest.bearer-token` to `""` still leaves `bearerTokenConfigured=true`, so 
the API-key branch rejects the change. The reverse transition and switching 
either mode to `none` fail for the same reason. This forces catalog recreation 
when a namespace changes its authentication method. Treat an explicitly cleared 
inactive credential as unset, while continuing to require a nonblank active 
credential, and cover these merged-map ALTER transitions.



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