Skip to content

fix(download): minimally restore path-authorized ZIP tickets - #46

Merged
opendev9 merged 9 commits into
devfrom
fix/zip-path-authorization
Oct 26, 2026
Merged

opendev9 merged 9 commits into
devfrom
fix/zip-path-authorization

Conversation

@servicememeai

@servicememeai servicememeai commented Oct 26, 2026 •

Copy link
Copy Markdown

DEV ZIP creation fails with Path-qualified authorization required: the existing ZIP RPC issues unbound native tickets even when this operation needs path authority.

This PR is limited to that ticket compatibility gap:

  • Keep ordinary CE ZIP issuance unchanged, including native directory payloads without parent_dir, empty-user public-share multi-selection and SeaDoc display-name aliases.
  • Only when the existing native unscoped guard requires path authority, validate and bind authenticated ZIP selections using the existing object lookup and whole-subtree permission checks. Preserve canonical nested relative selections and reject traversal, missing objects and unverifiable targets.
  • Let the Go file service recognize these native path-bound ZIP tickets. Unbound tickets retain the existing guard.

Final diff: 2 implementation files and one existing Go test file (133 additions, 1 deletion). No new RPC, schema, configuration, background tasks, Hub/Etech changes or test framework. Archive streaming/error handling is outside this PR; the previously added stream-abort change and large native/archive test harnesses have been removed from the diff.

Validation for this revision:

  • Existing Go file/ZIP scope tests pass.
  • Local ad-hoc native token probe: 8 groups pass, including ordinary CE compatibility and authenticated nested selections. This probe is kept outside the PR.
  • gofmt and git diff --check pass.

Linux integration status remains unresolved, so keep this PR Draft. On the preceding revision ea5a90e, run 40301891244 compiled C/Go and passed the first Go-fileserver test phase (103 passed, 9 skipped, 191 subtests, including the native ZIP test). Its second C-fileserver phase failed during initialization with a missing RPC socket; the separate checks job also hits the known cloudfile-docker tool-path mismatch. Neither quick CI nor the local probes prove complete Linux/DEV acceptance. No merge, deployment or environment mutation has been performed.

Minimal CI repair (c52830e)

  • Correct shared gate paths to cloudfile-docker/tools/gates/.
  • V2 runner selects the supported Go fileserver because native startup explicitly rejects C HTTP mode; full C compilation and the integration suite remain enabled. Upstream runner defaults remain unchanged.
  • Python syntax and three backend-selection cases pass. Run 40304922992 executed the corrected cross-repository checks. That job reports six failing Hub/Docker test groups (storage fixture collection, root contracts, Hub identity/ACL tests, configuration generation); the full workflow is not green. Server build-c result is tracked separately in the run.

servicememeai and others added 8 commits October 26, 2026 18:00
The native ZIP ticket validation ran for every library and required a
parent_dir plus a non-empty username, so it rejected payloads that are
part of the existing contract: the CE download-dir ticket has only
obj_id/dir_name, the public folder-share multi ticket is minted with an
empty username, SeaDoc's image export uses a display-name alias, and
multi-level selections use relative 'dir/file' entries. That broke
tests/test_file_operation/test_zip_download.py and turned previously
working downloads into 500s.

Only an ACL-protected repository needs the ticket itself to carry the
path proof: issue_access_token() already refuses unbound tickets there,
and the redemption guard still refuses them if ACL rows appear later.
Unprotected libraries keep the native unbound ticket. Nested relative
selections are accepted and checked per resolved entry, matching the
native contract and the Go archiver.

Extend the token-manager harness with the unprotected-library contract,
nested selections and the rejected entry shapes.
@servicememeai servicememeai changed the title fix(download): restore ZIP downloads with native path-bound tickets fix(download): minimally restore path-authorized ZIP tickets Oct 26, 2026
@opendev9
opendev9 marked this pull request as ready for review October 26, 2026 10:12
@opendev9
opendev9 merged commit 5ec0428 into dev Oct 26, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants