Skip to content

test: reconcile encrypted-parts attributes test with #119 write validation - #135

Merged
Vonng merged 1 commit into
mainfrom
fix/attributes-encrypted-parts-test-reconcile
Sep 6, 2026
Merged

Vonng merged 1 commit into
mainfrom
fix/attributes-encrypted-parts-test-reconcile

Conversation

@Vonng

@Vonng Vonng commented Sep 6, 2026

Copy link
Copy Markdown
Member

Description

Fix-forward for the main Go CI failure that surfaced only after #128 and #119 were both merged. Individually green, they interact: test-only, no product change.

TestAPIGetObjectAttributesEncryptedPartLengths (added in #128) built its fixtures by PutObjectPart-ing plaintext bodies under encrypted-object metadata with per-part sizes 5245473 and 1. Since #119, PutObjectPart always derives an encrypted part's plaintext length from the bytes written and rejects a part that cannot be a valid sio stream — so those fixtures can no longer be created through a normal write, and both variants failed at write time (errObjectTampered).

That on-disk shape now only exists as pre-#119 data or from an old peer — exactly the state the GetObjectAttributes per-part tamper check (#128) is defense-in-depth for. This injects that ObjectInfo directly through a stub object layer (the setObjectLayer pattern already used by the #110 tamper test) and exercises the handler, which is what the test pins.

Unchanged: the handler path, the crafted part sizes, and both assertions

  • separately-encrypted-parts → ErrObjectTampered
  • legacy-single-stream → stored fragment sizes returned

How to test

GOWORK=off go test -tags kqueue,dev ./cmd -count=1 -run 'TestAPIGetObjectAttributesEncryptedPartLengths|TestAPIGetObjectAttributesMultipartLogicalPartSize'

Locally green on both FS and Erasure instance types; go vet, go build ./..., and the TestObjectTampered*/TestPartNumberToRangeSpec*/TestAPISSEC*/TestReplica* regressions pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue) — test-only

Checklist

  • All commits signed off (git commit -s) per the DCO
  • gofmt/go vet clean, package tests pass
  • No product/API change

🤖 Generated with Claude Code

https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe

…ation

TestAPIGetObjectAttributesEncryptedPartLengths (from #128) built its
fixtures by PutObjectPart-ing plaintext bodies under encrypted-object
metadata with per-part sizes 5245473 and 1. Since #119, PutObjectPart
always derives an encrypted part's plaintext length from the bytes
written and rejects a part that cannot be a valid sio stream, so those
fixtures can no longer be created through a normal write and both
variants failed at write time.

Such an on-disk shape now only exists as pre-#119 data or from an old
peer, which is exactly the state the GetObjectAttributes per-part
tamper check (#128) defends. Inject that ObjectInfo directly through a
stub object layer (the setObjectLayer pattern used by the #110 tamper
test) and exercise the handler, which is what this test pins. The
handler path, the crafted part sizes, and both assertions
(separately-encrypted-parts -> ErrObjectTampered; legacy-single-stream
-> stored fragment sizes) are unchanged. Test-only; reconciles two
already-merged correct changes (#119 and #128).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe
Signed-off-by: Feng Ruohang <[email protected]>
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