ndrluis commented on code in PR #962:
URL: https://github.com/apache/iceberg-python/pull/962#discussion_r1693503897


##########
pyiceberg/catalog/rest.py:
##########
@@ -290,11 +293,38 @@ def url(self, endpoint: str, prefixed: bool = True, 
**kwargs: Any) -> str:
 
     @property
     def auth_url(self) -> str:
-        if url := self.properties.get(AUTH_URL):
+        if self.properties.get(AUTH_URL):
+            deprecation_message(
+                deprecated_in="0.7.0",
+                removed_in="0.8.0",
+                help_message=f"The property {AUTH_URL} is deprecated. Please 
use {OAUTH2_SERVER_URI} instead",
+            )
+
+        self._warn_oauth_tokens_deprecation()
+
+        if url := PropertyUtil.get_first_property_value(self.properties, 
AUTH_URL, OAUTH2_SERVER_URI):
             return url
         else:
             return self.url(Endpoints.get_token, prefixed=False)
 
+    def _warn_oauth_tokens_deprecation(self) -> None:
+        has_oauth_server_uri = OAUTH2_SERVER_URI in self.properties
+        has_credential = CREDENTIAL in self.properties
+        has_init_token = TOKEN in self.properties
+        has_sigv4_enabled = strtobool(self.properties.get(SIGV4, "false"))
+
+        if not has_oauth_server_uri and (has_init_token or has_credential) and 
not has_sigv4_enabled:
+            deprecation_message(
+                deprecated_in="0.7.0",
+                removed_in="future Iceberg release",

Review Comment:
   [I am following what is described in the Java 
implementation](https://github.com/apache/iceberg/pull/10603/files#diff-86450612dbe323d6d06cbc3846aa1913f042eaedadc0ca027c36bfbe08d3a46cR200-R204).
 In the deprecation proposal, [it is aimed to be removed in version 1.8.0 or 
2.0.0](https://docs.google.com/document/d/1Xi5MRk8WdBWFC3N_eSmVcrLhk3yu5nJ9x_wC0ec6kVQ/edit?pli=1).
 I believe that 1.8.0 could be released before pyiceberg 1.0.0, but we cannot 
know if the endpoint will be removed in version 1.8.0.
   
   So, I don't have a strong opinion; I am open to what you think is better.
   
   



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