Re: [PR] [python] Add REST permission management [paimon]
JingsongLi commented on PR #10322: URL: https://github.com/apache/paimon/pull/10322#issuecomment-5967496316 +1 -- 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]
Re: [PR] [python] Add REST permission management [paimon]
JingsongLi merged PR #10322: URL: https://github.com/apache/paimon/pull/10322 -- 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]
Re: [PR] [python] Add REST permission management [paimon]
plusplusjiajia commented on PR #10322: URL: https://github.com/apache/paimon/pull/10322#issuecomment-5950544858 @JingsongLi Fixed, the OpenAPI signer now decodes the path with unquote_plus, like Java's URLDecoder; -- 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]
Re: [PR] [python] Add REST permission management [paimon]
JingsongLi commented on PR #10322: URL: https://github.com/apache/paimon/pull/10322#issuecomment-5936765291 Re-reviewed `6c4ea3f042`: the original `/` prefix finding is fixed. All 23 permission-management tests and 92 REST/API/client/catalog/signer regression tests passed (plus 6 subtests). Repository-configured Flake8 and Python 3.6 grammar checks passed for all 17 changed files. The real HTTP tests now cover list/grant/revoke with encoded prefixes and the path actually sent. **[P2] Keep the encoded prefix compatible with the existing Java OpenAPI signing contract** At `resource_paths.py:44`, a prefix containing a space now becomes `catalog+id`. However, Python `DLFOpenApiSigner._build_canonicalized_resource` uses `unquote`, leaving `+` in the canonical resource, while the existing Java `DLFOpenApiSigner` uses `RESTUtil.decodeString`/`URLDecoder`, restoring the space. This changes previously matching Java/Python signatures for the space-containing prefix that the new tests explicitly support. The OpenAPI signer is automatically selected for `dlfnext` endpoints; the new HTTP test uses bearer auth and only records `parameter.path`, so it cannot catch this difference. I ran both actual signers with the same GET path, empty query/body, fixed date/nonce and test-only credentials: ```text prefix: catalog id wire/signing input path: /v1/catalog+id/permissions Python canonical resource: /v1/catalog+id/permissions Java canonical resource: /v1/catalog id/permissions Python Authorization: acs TestAKId:BNMSl5OSsGHdIcfK56Ds4YrZqzQ= Java Authorization: acs TestAKId:x37eWUnTGZTEQVUxYmkLf2RGxWM= ``` The pre-fix raw-space prefix produced the Java signature. Slash, literal `+`, tilde/asterisk and Unicode controls still agree. A verifier using the existing Java canonicalization will reject the new Python signature; this is a reproduced signing-contract mismatch, not a claim that I exercised a live DLF gateway. Please align the OpenAPI path canonicalization with Java (for example, `unquote_plus` for this form-encoded path) and add a fixed Java/Python Authorization parity test for both a space and a literal `+` prefix. Keep the new encoded routing and the `~` wire-path handling. -- 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]
Re: [PR] [python] Add REST permission management [paimon]
plusplusjiajia commented on PR #10322: URL: https://github.com/apache/paimon/pull/10322#issuecomment-5935140272 @JingsongLi Fixed in a1570bb. ResourcePaths now encodes the prefix once with Java's URLEncoder rules, as Java's constructor does. -- 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]
Re: [PR] [python] Add REST permission management [paimon]
JingsongLi commented on PR #10322: URL: https://github.com/apache/paimon/pull/10322#issuecomment-5934293794 Review of `663b06378c`: the Python permission-management port has useful end-to-end value. I ran the 21 new tests and 61 existing REST tests (plus 6 subtests); all passed. Changed files also passed Flake8 and Python 3.6 grammar checks. **[P2] Preserve encoded catalog prefixes in the new permission routes** At `pypaimon/api/resource_paths.py:144-151`, all three new routes reuse an unencoded `base_path`. With the accepted catalog prefix `catalog/id`, the actual client sends: ```text GET /v1/catalog/id/permissions?resourceType=CATALOG POST /v1/catalog/id/permissions/grant POST /v1/catalog/id/permissions/revoke ``` The Java permission-management contract requires `/v1/catalog%2Fid/permissions...`; this is explicitly covered by `ResourcePathsTest#testPermissionManagementUsesPrefix`. I reproduced all three Python operations against a local HTTP server implementing that route, and each raised `NoSuchResourceException` (404). The raw-prefix helper predates this PR, so this is an incomplete acceptance case for the newly added Java port, rather than a regression to existing Python operations. Please encode the prefix as one path segment and port the encoded-prefix assertions/HTTP cases for list, grant and revoke. The new HTTP tests currently use only `prefix="catalog"`, which misses this case. -- 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]
