Skip to content

Commit 2ceaf44

Browse files
authored
REST: Remove deprecated AUTH_URL (#1691)
1 parent 8cb8793 commit 2ceaf44

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

pyiceberg/catalog/rest.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties
8080
from pyiceberg.types import transform_dict_value_to_str
8181
from pyiceberg.utils.deprecated import deprecation_message
82-
from pyiceberg.utils.properties import get_first_property_value, get_header_properties, property_as_bool
82+
from pyiceberg.utils.properties import get_header_properties, property_as_bool
8383

8484
if TYPE_CHECKING:
8585
import pyarrow as pa
@@ -137,7 +137,6 @@ class IdentifierKind(Enum):
137137
SIGV4 = "rest.sigv4-enabled"
138138
SIGV4_REGION = "rest.signing-region"
139139
SIGV4_SERVICE = "rest.signing-name"
140-
AUTH_URL = "rest.authorization-url"
141140
OAUTH2_SERVER_URI = "oauth2-server-uri"
142141

143142
NAMESPACE_SEPARATOR = b"\x1f".decode(UTF8)
@@ -318,16 +317,9 @@ def url(self, endpoint: str, prefixed: bool = True, **kwargs: Any) -> str:
318317

319318
@property
320319
def auth_url(self) -> str:
321-
if self.properties.get(AUTH_URL):
322-
deprecation_message(
323-
deprecated_in="0.8.0",
324-
removed_in="0.9.0",
325-
help_message=f"The property {AUTH_URL} is deprecated. Please use {OAUTH2_SERVER_URI} instead",
326-
)
327-
328320
self._warn_oauth_tokens_deprecation()
329321

330-
if url := get_first_property_value(self.properties, AUTH_URL, OAUTH2_SERVER_URI):
322+
if url := self.properties.get(OAUTH2_SERVER_URI):
331323
return url
332324
else:
333325
return self.url(Endpoints.get_token, prefixed=False)

tests/catalog/test_rest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
TEST_URI = "https://iceberg-test-catalog/"
5151
TEST_CREDENTIALS = "client:secret"
52-
TEST_AUTH_URL = "https://auth-endpoint/"
52+
TEST_OAUTH2_SERVER_URI = "https://auth-endpoint/"
5353
TEST_TOKEN = "some_jwt_token"
5454
TEST_SCOPE = "openid_offline_corpds_ds_profile"
5555
TEST_AUDIENCE = "test_audience"
@@ -257,9 +257,9 @@ def test_token_with_custom_scope(rest_mock: Mocker) -> None:
257257
@pytest.mark.filterwarnings(
258258
"ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
259259
)
260-
def test_token_200_w_auth_url(rest_mock: Mocker) -> None:
260+
def test_token_200_w_oauth2_server_uri(rest_mock: Mocker) -> None:
261261
rest_mock.post(
262-
TEST_AUTH_URL,
262+
TEST_OAUTH2_SERVER_URI,
263263
json={
264264
"access_token": TEST_TOKEN,
265265
"token_type": "Bearer",
@@ -271,7 +271,7 @@ def test_token_200_w_auth_url(rest_mock: Mocker) -> None:
271271
)
272272
# pylint: disable=W0212
273273
assert (
274-
RestCatalog("rest", uri=TEST_URI, credential=TEST_CREDENTIALS, **{OAUTH2_SERVER_URI: TEST_AUTH_URL})._session.headers[
274+
RestCatalog("rest", uri=TEST_URI, credential=TEST_CREDENTIALS, **{OAUTH2_SERVER_URI: OAUTH2_SERVER_URI})._session.headers[
275275
"Authorization"
276276
]
277277
== f"Bearer {TEST_TOKEN}"

0 commit comments

Comments
 (0)