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


##########
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:
   Changed in 
[6e253c2](https://github.com/apache/iceberg-python/pull/962/commits/6e253c20b42761c1b7897641bded4e7583f0d2d2)



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to