tanmayrauth commented on code in PR #1369:
URL: https://github.com/apache/iceberg-go/pull/1369#discussion_r3523637643


##########
catalog/rest/rest.go:
##########
@@ -501,19 +517,28 @@ func fromProps(props iceberg.Properties, o *options) 
error {
                }
        }
 
+       // oauth2-server-uri is the portable, preferred key and takes 
precedence over
+       // the rest.authorization-url alias when both are set.

Review Comment:
   Good catch, thanks — you're right that the global alias resolution broke 
layer precedence.
     
     Fixed in b7236fc. Instead of resolving 
oauth2-server-uri/rest.authorization-url globally after the merge, I now 
collapse the alias within each source layer before merging in fetchConfig. A 
new resolveAuthURLAlias helper
     canonicalizes each layer to the single oauth2-server-uri key 
(oauth2-server-uri still wins over the alias within a layer), so the defaults → 
client → overrides map merge preserves precedence naturally. A server
     rest.authorization-url override now correctly wins over a client-provided 
oauth2-server-uri.
   
     Added TestFetchConfigAuthURLOverridePrecedence covering exactly the 
WithAuthURI(A) + /config override rest.authorization-url=B case — asserts B 
wins. fromProps's existing precedence switch is unchanged since it's still 
correct for the single-layer newCatalogFromProps path.



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