diff options
| author | chrislu <chris.lu@gmail.com> | 2025-12-09 00:20:36 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-12-09 00:20:36 -0800 |
| commit | b198a0e8d1b874cb5ead7a7b6ef1af3c304341b6 (patch) | |
| tree | 68f82ef7933e3664b7a6f75e242baa2eef421fb2 /weed/s3api/s3api_bucket_policy_engine.go | |
| parent | 4e6e7b6ac5eaf340a8755882c147fb2d7fac2714 (diff) | |
| download | seaweedfs-b198a0e8d1b874cb5ead7a7b6ef1af3c304341b6.tar.xz seaweedfs-b198a0e8d1b874cb5ead7a7b6ef1af3c304341b6.zip | |
Add integration tests for s3:ExistingObjectTag conditions
- Add TestCheckPolicyWithEntry: tests checkPolicyWithEntry helper with various
tag scenarios (matching tags, non-matching tags, empty entry, nil entry)
- Add TestCheckPolicyWithEntryNoPolicyForBucket: tests early return when no policy
- Add TestCheckPolicyWithEntryNilPolicyEngine: tests nil engine handling
- Add TestCheckPolicyWithEntryDenyPolicy: tests deny policies with tag conditions
- Add TestHasPolicyForBucket: tests HasPolicyForBucket method
These tests cover the Phase 2 policy evaluation with object entry metadata,
ensuring tag-based conditions are properly evaluated.
Diffstat (limited to 'weed/s3api/s3api_bucket_policy_engine.go')
| -rw-r--r-- | weed/s3api/s3api_bucket_policy_engine.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/s3api/s3api_bucket_policy_engine.go b/weed/s3api/s3api_bucket_policy_engine.go index 422cf7d26..c8cd05344 100644 --- a/weed/s3api/s3api_bucket_policy_engine.go +++ b/weed/s3api/s3api_bucket_policy_engine.go @@ -129,8 +129,8 @@ func (bpe *BucketPolicyEngine) EvaluatePolicy(bucket, object, action, principal // Evaluate using the policy engine args := &policy_engine.PolicyEvaluationArgs{ Action: s3Action, - Resource: resource, - Principal: principal, + Resource: resource, + Principal: principal, ObjectEntry: objectEntry, } |
