Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4338 +/- ##
==========================================
+ Coverage 33.28% 33.31% +0.02%
==========================================
Files 673 673
Lines 41888 41891 +3
==========================================
+ Hits 13943 13954 +11
+ Misses 27945 27937 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/hal please review |
There was a problem hiding this comment.
I found no correctness problems. The fix is the right one, and it is in the right place. Every eACL object-header path in pkg/services/object/acl/eacl/v2/headers.go (binary header, PUT init, GET/HEAD responses, local Head, the first-object lookup for a V2 split) goes through headersFromObject or headersFromBinaryObjectHeader. Both now skip $Object: attributes, and the parent recursion is covered in both. In the binary path, off still advances before the skip.
What I ran
go test ./pkg/services/object/acl/...: passes.- I restored
object.gofrom the base (a90d01f) and kept the new tests.TestSystemAttributeRulesthen fails in every forged, absent and unknown-property case, for both object and parent attributes.TestObjectHeaders/child/binaryfails too. So the tests catch the bug.
Findings
- Test gap (inline): the parent cases never take the V2-split PUT branch. The risk is low, because that branch calls the same fixed function.
- Nit,
CHANGELOG.md:13: the profile asks for the issue number (#4300), and the line ends with the PR number (#4338). The file is not consistent either: the lines for #4335 and #4302 cite PRs, the line for #4308 cites an issue. Change it only if you follow the issue-number rule.
Out of scope, filed separately
Metabase SEARCH indexing still writes $Object:payloadLength, $Object:objectType and similar user attributes under the system key. Only $Object:expirationTime is skipped (pkg/local_object_storage/metabase/metadata.go:134-157). That needs a different fix and probably a migration, so I filed it as #4339 instead of asking for it here.
Discarded reviewer leads
- Shared test helper with
TestExpirationTimeRule. The new test follows its neighbour, and this is a matter of taste. - Wording of the comment on
reservedAttributePrefix. - A claim that the parent fixture has a zero owner. It is wrong:
CopyToruns afterSetOwner. - Overlap with SDK
UserAttributes(). That uses a different prefix, so there is no duplication.
Generated by hal0x9000 for commit 7ce3613.
| {"put request", WithServiceRequest(&protoobject.PutRequest{ | ||
| Body: &protoobject.PutRequest_Body{ | ||
| ObjectPart: &protoobject.PutRequest_Body_Init_{ | ||
| Init: &protoobject.PutRequest_Body_Init{Header: hdr}, |
There was a problem hiding this comment.
Test gap: in the parent cases, this request has no Split.SplitId and no V2 split fields. It takes the "V1 split scheme or small object" branch in headers.go:149. The V2 branches are not exercised: splitHeader.GetParentHeader() (headers.go:169-182) and the first-object Head lookup (headers.go:186-203), which a real multi-part PUT of a split object goes through. Both call the fixed headersFromObject, so the risk is low. A case where the init header carries Split{ParentHeader: <parent with forged attr>} would cover the parent-header branch without a mock headerSource.
There was a problem hiding this comment.
The parent cases already exercise the V2 PUT branch: SetParent populates Split.ParentHeader while leaving SplitId nil.
Ignore user attributes with the reserved `$Object:` prefix in both eACL header builders, including parent headers. Closes #4300. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
7ce3613 to
43cdba3
Compare
Closes #4300.