Repository navigation
[#13845] fix(server): Support authorized existence probing for view loads - #13846
jarredhj0214 wants to merge 5 commits into
Conversation
|
This follows the table-like existence probing introduced in #12482. The gap is in existence-probe handling, rather than in the normal table/view read permissions:
This matters for Flink name resolution: This PR applies the same probe expression and decision flow to views, using the internal view dispatcher. It preserves 403 for existing views without load permission and does not allow existence checks when probe permission is denied. Regression tests cover these cases and endpoint/executor wiring. |
|
Updated in d4ac59e. When a catalog does not support view operations, the existence probe now preserves the original authorization denial (403) instead of failing with an internal authorization error. Other backend failures still propagate; supported-view probe behavior is unchanged. Added executor and interception regression tests covering the unsupported-view case, HTTP 403, skipped REST handler execution, and authorization-denial event delivery. The targeted server tests and spotless checks passed; Spark integration validation is pending CI. |
|
Thanks for the update in d4ac59e. The new
Validation on |
|
Addressed in b8bbe8e. An allowed absence probe now returns a terminal 404 without entering the load handler, closing the concurrent-create authorization gap. Added a dedicated non-importing probe path that delegates to the connector’s |
|
I disagree with 2nd option. It doesn't know our code context. |
Code Coverage Report
Files
|
|
Updated in 3f4fe3e. Removed the non-importing probe path. Both table and view probes now use internal loads: success retains 403; absence returns a terminal 404 without entering the REST handler. |
| } | ||
| GravitinoEnv.getInstance().internalViewDispatcher().loadView(viewIdentifier); | ||
| return false; | ||
| } catch (NoSuchViewException e) { |
There was a problem hiding this comment.
We don't need this. The client needs NoSuchViewException or NoSuchTableException. So we should return NoSuchViewException or NoSuchTableException.
| throw new MissingViewProbeException(viewIdentifier); | ||
| } | ||
| GravitinoEnv.getInstance().internalViewDispatcher().loadView(viewIdentifier); | ||
| return false; |
There was a problem hiding this comment.
return false will block the subsequent load operation. This is enough.
|
Updated in e0730d9 following your comments. Removed both custom missing-probe exception classes. Table and view probes now propagate the original After a successful internal load, the executors return The executor tests, interception tests (including concurrent-create regressions), view REST tests, and formatting checks passed. |
What changes were proposed in this pull request?
Add authorized existence probing to view loads using the existing table-like probe expression, and close the analogous absence-probe authorization gap for table loads.
After the primary load permission is denied, a caller with probe permission uses the existing internal
loadTableorloadViewpath. A successful internal load still returns an authorization denial. A missing object produces a terminal, standard 404 response in the interceptor without entering the REST load handler. View probes against catalogs without view support retain the original 403 behavior; other backend errors propagate.Both paths retain the existing internal loading and metadata import behavior. No new Core probe interface is introduced.
Why are the changes needed?
During Flink qualified name resolution, a missing candidate table can fall back to a view lookup. Returning 403 for that missing candidate view prevents resolution from continuing even when the actual source table is accessible.
An absence observation must not authorize a later load: another request could create the same-named table or view between the probe and the handler, exposing metadata without load permission. Terminal 404 responses close this gap for both table and view loads.
Fix: #13845
Does this PR introduce any user-facing change?
Authorized probes of missing tables and views return 404 without invoking the normal load handler. Existing objects remain forbidden without their primary load permission, and callers without probe permission cannot check existence. Probe-only requests cannot read metadata from an object created after the absence observation.
How was this patch tested?
Added table and view race regressions using real authorization executors, the interceptor, and REST resource methods with deterministic mocked reads: the internal load observes absence while a concurrent create makes the object available for a subsequent load. Both requests return their standard not-found error and never enter the handler.
Coverage also checks successful internal loads remaining forbidden, denied probes avoiding dispatcher calls, primary permission bypassing probes, unsupported view operations, backend error propagation, and endpoint wiring.
Passed
./gradlew spotlessApplyand./gradlew :server:test spotlessCheck -PskipITs --no-parallel(671 non-Docker Server tests). Docker-based integration validation remains pending CI.