Skip to content

Commit 4b636a7

Browse files
authored
SNOW-1473581: Fix SSO url validator for nested urls (#1974)
1 parent a92b91b commit 4b636a7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

DESCRIPTION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
1717
- Fixed a bug that status code shown as uploaded when PUT command failed with 400 error.
1818
- Fixed a bug that a PermissionError was raised when the current user does not have the right permission on parent directory of config file path.
1919
- Fixed a bug that OCSP GET url is not encoded correctly when it contains a slash.
20+
- Fixed a bug that an SSO URL didn't accept `:` in a query parameter, for instance, `https://sso.abc.com/idp/startSSO.ping?PartnerSpId=https://xyz.snowflakecomputing.com/`.
2021

2122
- v3.10.1(May 21, 2024)
2223

src/snowflake/connector/url_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
URL_VALIDATOR = re.compile(
15-
"^http(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z@:])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\&\\(\\)\\/\\\\\\+&%\\$#_=@]*)?$"
15+
"^http(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z@:])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\&\\(\\)\\/\\\\\\+&%\\$#_=@:]*)?$"
1616
)
1717

1818

test/unit/test_url_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def test_url_validator():
1717
assert is_valid_url("https://ssoTestURL.okta.com")
1818
assert is_valid_url("https://ssoTestURL.okta.com:8080")
1919
assert is_valid_url("https://ssoTestURL.okta.com/testpathvalue")
20+
assert is_valid_url(
21+
"https://sso.abc.com/idp/startSSO.ping?PartnerSpId=https://xyz.eu-central-1.snowflakecomputing.com/"
22+
)
2023

2124
assert not is_valid_url("-a Calculator")
2225
assert not is_valid_url("This is a random text")

0 commit comments

Comments
 (0)