Skip to content

test: system_test coverage for encrypted folder share lifecycle and boundaries#1170

Open
nahom4 wants to merge 2 commits into
masterfrom
feat/encrypted-folder-share-tests
Open

test: system_test coverage for encrypted folder share lifecycle and boundaries#1170
nahom4 wants to merge 2 commits into
masterfrom
feat/encrypted-folder-share-tests

Conversation

@nahom4
Copy link
Copy Markdown

@nahom4 nahom4 commented Apr 27, 2026

Summary

  • Adds 20 subtests to TestShareFile covering the full lifecycle and security boundaries of encrypted folder sharing, validating the gosdk fix in fix/pre-reuse-folder-entropy (commit 9dfc92c4)
  • Every test materializes directory refs via zbox createdir to exercise the exact NewDirectoryRef() code path the fix targets
  • All 20 subtests pass against test.zus.network

What the tests cover

Baseline + add (Block A): empty-folder share then add file, pre-existing top-level file, pre-existing nested file, add top-level file after share, add nested folder after share, add deeply nested folders (3 levels) after share

Update (Block B): update top-level file content after share, update nested file content after share

Rename (Block C): rename top-level file, rename nested file, rename nested folder (proxy key survives path change)

Move (Block D): move file from outside share into shared folder, move file within shared folder

Delete (Block E): delete top-level file (sibling still works), delete nested file (parent and siblings still work), delete nested folder contents (top-level still works)

Security / negative (Block F+G): unrelated wallet cannot use recipient ticket, recipient cannot escape via --remotepath, recipient cannot escape via crafted --lookuphash (sha3-256 path-hash manipulation), recipient cannot list sibling folder via authticket

Test plan

  • Run against test.zus.network with -parallel=1 -timeout 120m
  • 20/20 subtests pass
  • Negative tests confirm blobbers return ref not found (not consensus_not_met) for denied access

Related

gosdk fix PR: fix/pre-reuse-folder-entropy

nahom4 added 2 commits April 26, 2026 23:23
Adds 20 subtests to TestShareFile covering the scenarios from Saswata's
review of fix/pre-reuse-folder-entropy: empty-folder share, pre-existing
files (top-level and nested), add file / nested folder / deep nesting after
share, update file (top-level and nested), rename file (top-level, nested)
and nested folder, move into and within shared folder, delete file and
nested folder, cross-wallet rejection, remotepath escape, lookuphash
escape, and sibling-folder list rejection.

Every test materialises shared directory refs via `zbox createdir` to
exercise NewDirectoryRef() - the code path the gosdk fix targets.

Existing "Share folder with encrypted file" test (uploads unencrypted
content despite its name) is left untouched; out of scope for this PR.
Blobbers return "Error while getting file ref: ref not found" for denied
or out-of-scope access, not "consensus_not_met" (which is a blockchain
tx failure). Updated 5 negative-case assertions and removed the
overly-specific lookuphash escape assertion (require.NotNil on err is
sufficient). Also added "allocation flag is missing" to the sibling-list
rejection check.

All 20 subtests now pass against test.zus.network.
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.

1 participant