diff options
| author | chrislu <chris.lu@gmail.com> | 2025-12-09 00:24:54 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-12-09 00:24:54 -0800 |
| commit | d93c90fdb3d6123ad9398bb595fb4bf16d5918a7 (patch) | |
| tree | 03b9f1946a1ed9236607863bf0be6494fbf364e1 /weed/s3api/policy_engine/engine.go | |
| parent | b198a0e8d1b874cb5ead7a7b6ef1af3c304341b6 (diff) | |
| download | seaweedfs-d93c90fdb3d6123ad9398bb595fb4bf16d5918a7.tar.xz seaweedfs-d93c90fdb3d6123ad9398bb595fb4bf16d5918a7.zip | |
Address code review nitpicks
- Remove unused extractObjectTags placeholder function (engine.go)
- Add clarifying comment about s3:ExistingObjectTag/<key> evaluation
- Consolidate duplicate tag-based examples in README
- Factor out tagsToEntry helper to package level in tests
Diffstat (limited to 'weed/s3api/policy_engine/engine.go')
| -rw-r--r-- | weed/s3api/policy_engine/engine.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/weed/s3api/policy_engine/engine.go b/weed/s3api/policy_engine/engine.go index db4317b62..62e375eff 100644 --- a/weed/s3api/policy_engine/engine.go +++ b/weed/s3api/policy_engine/engine.go @@ -209,10 +209,8 @@ func ExtractConditionValuesFromRequest(r *http.Request) map[string][]string { values["aws:Referer"] = []string{referer} } - // S3 object-level conditions - if r.Method == "GET" || r.Method == "HEAD" { - values["s3:ExistingObjectTag"] = extractObjectTags(r) - } + // Note: s3:ExistingObjectTag/<key> conditions are evaluated using objectEntry + // passed to EvaluatePolicy, not extracted from the request. // S3 bucket-level conditions if delimiter := r.URL.Query().Get("delimiter"); delimiter != "" { @@ -251,13 +249,6 @@ func ExtractConditionValuesFromRequest(r *http.Request) map[string][]string { return values } -// extractObjectTags extracts object tags from request (placeholder implementation) -func extractObjectTags(r *http.Request) []string { - // This would need to be implemented based on how object tags are stored - // For now, return empty slice - return []string{} -} - // BuildResourceArn builds an ARN for the given bucket and object func BuildResourceArn(bucketName, objectName string) string { if objectName == "" { |
