Repository navigation
feat(auth): scope GLOBAL reads to owner policy - #6973
Merged
fujiajie666 merged 1 commit intoNov 3, 2026
Merged
Conversation
Co-authored-by: TRAE CLI <traecli@bytedance.com>
fujiajie666
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enable GLOBAL identities to read one explicit owner's policy-authorized user subtree within their account. Requests intersect the target scope with the owner's GLOBAL policy, retain both include and exclude rules, and preserve the authenticated actor. This covers
find,grep,ls,tree,glob,read,get,abstract, andoverview.The submitter recommends merging this implementation now and addressing the confirmed risks below in follow-up work. Security validation remains incomplete because the L0 summary disclosure is confirmed.
Human Involvement
Related Issue
#6183
Type of Change
Changes Made
Testing
Focused scope/CLI and grep regression:
.venv/bin/python -m pytest tests/server/test_global_policy_scope.py tests/storage/test_global_policy_scope.py tests/storage/test_viking_fs_grep.py -q --no-cov— 64 passed after syncing with current upstream main. The two local scope fixture files are excluded from this PR because the submitter requested committing only already-staged files.Live API-key CLI matrix on macOS: 2 owners × 24 target categories × 4 read commands = 192 cases. Permission statuses matched the current policy rules; content inspection identified the L0 issue described below. Supplementary checks covered exact allow rules, explicit sidecar denies, missing policy, URI encoding/traversal, account boundaries, and byte comparisons.
Related content/download/record-ID checks: 30 passed, 2 failed. Both failures were reproduced with the pre-change staged baseline:
test_read_contentmocks a text reader while the visible-read path uses a byte reader;test_read_directory_uri_returns_invalid_argumentexpects different directory-error wording.Ruff lint/format checks and Git whitespace checks passed on the changed implementation paths.
Remote index backends, signed-download/WebDAV surfaces, and concurrent policy-revocation behavior were not validated. The existing policy-cache consistency window is 600 seconds.
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
I have tested this on the following platforms:
Checklist
Additional Notes: known risks and merge recommendation
searchis outside the supported scope, but rejection is inconsistent. Explicit permitted owner targets can return a successful empty result. No cross-user response content was observed in the matrix; a uniform unsupported/rejection boundary remains follow-up work.getaccepts Viking URIs but rejects raw vector IDs.readresolves authorized L2 IDs, whereas the HTTP download route validates URI syntax before reaching the ID-capable byte reader. Rejected downloads did not create files. This is a capability limitation rather than an observed authorization bypass.The submitter has reviewed these findings and recommends merging the current scope first. The known issues above are intentionally left unresolved in this PR. Detailed local reports and reproduction artifacts remain outside this submission because they contain local credentials and security-sensitive reproduction details; the commit contains only the 12 implementation files that were already staged.