Skip to content

Commit 758b498

Browse files
martelliLeandro Martelli
andauthored
Limit split so colons are allowed in the password (#2706)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change As of now, pyiceberg will fail if the provided catalog secret contains a colon. By limiting the split, this gets fixed. ## Are these changes tested? Yes, locally with `make test` (the test was modified to include a colon in the secret) and also with a live system. ## Are there any user-facing changes? Not exactly, just a bug fix. <!-- In the case of user-facing changes, please add the changelog label. --> Co-authored-by: Leandro Martelli <leandro@mazehq.com>
1 parent e759044 commit 758b498

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyiceberg/catalog/rest/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595

9696
def _fetch_access_token(self, credential: str) -> str:
9797
if COLON in credential:
98-
client_id, client_secret = credential.split(COLON)
98+
client_id, client_secret = credential.split(COLON, maxsplit=1)
9999
else:
100100
client_id, client_secret = None, credential
101101

tests/catalog/test_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from pyiceberg.utils.config import Config
5151

5252
TEST_URI = "https://iceberg-test-catalog/"
53-
TEST_CREDENTIALS = "client:secret"
53+
TEST_CREDENTIALS = "client:secret_with:colon"
5454
TEST_OAUTH2_SERVER_URI = "https://auth-endpoint/"
5555
TEST_TOKEN = "some_jwt_token"
5656
TEST_SCOPE = "openid_offline_corpds_ds_profile"

0 commit comments

Comments
 (0)