jerryshao opened a new pull request, #10799: URL: https://github.com/apache/gravitino/pull/10799
### What changes were proposed in this pull request? Add a `encode_path_segment()` helper in `utils.py` using `urllib.parse.quote(segment, safe="")` and apply it to every user-supplied identifier embedded in URL paths across all plain REST client operation classes (`catalog`, `schema`, `table`, `model`, `topic`, `fileset`, `tag`, `job`, `policy`, `statistic`). Query parameters previously concatenated into f-strings are moved to the httpx `params=` argument. Also adds 29 unit tests covering various special-character inputs for all affected operation classes. ### Why are the changes needed? User-supplied identifiers (metalake name, catalog name, schema name, table name, etc.) were concatenated directly into URL paths using f-strings without encoding. Characters like `/`, `?`, `#`, and `%` in resource names could alter the intended request target, causing unexpected behavior. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added 29 unit tests in `tests/unit/client/test_url_encoding.py` that pass special-character inputs into every affected operation method and assert the encoded form appears in the URL. -- 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]
