CalvinKirs opened a new pull request, #69323:
URL: https://github.com/apache/doris/pull/69323
### What problem does this PR solve?
Issue Number: N/A
Problem Summary:
Nereids could construct a LOCAL TVF and list files or discover their schema
before enforcing the ADMIN/OPERATOR privilege requirement. The local-storage
branch of FILE TVF reached the same constructor.
Check ADMIN or OPERATOR privileges at the start of LOCAL TVF construction,
before property parsing and file access. Recheck these privileges through
`checkAuth` and preserve the inherited Resource USAGE check. The FILE wrapper
uses the same checks.
Add unit coverage for denied access before file-service interactions,
separate ADMIN and OPERATOR access, and permission revocation. Add SQL
regression coverage for LOCAL/FILE through SELECT and EXPLAIN.
### Release note
LOCAL TVF and FILE TVF with local storage require ADMIN or OPERATOR
privileges before file listing or schema discovery.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
Validation: `LocalTableValuedFunctionAuthTest` passed all 5 focused tests
against the compiled FE classes. Checkstyle passed for both changed Java files.
The added `test_local_tvf_privilege` SQL regression suite has not been
executed. Local read-only code review completed with no findings; it did not
rerun tests.
- Behavior changed:
- [ ] No.
- [x] Yes. Ordinary users are rejected before LOCAL TVF file access;
ADMIN and OPERATOR remain allowed.
- Does this need documentation?
- [x] No. Restores the existing privilege requirement.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]