Implement Bucket ACL support

This commit is contained in:
Harshavardhana
2015-10-16 19:09:35 -07:00
parent 8fb45e92f9
commit 0eb7f078f9
10 changed files with 236 additions and 63 deletions
+10 -2
View File
@@ -21,9 +21,9 @@ import (
"net/http"
"strings"
"github.com/minio/minio/pkg/fs"
"github.com/minio/minio-xl/pkg/crypto/sha256"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio/pkg/fs"
)
type signatureHandler struct {
@@ -58,6 +58,13 @@ func isRequestPostPolicySignatureV4(req *http.Request) bool {
return false
}
func isRequestRequiresACLCheck(req *http.Request) bool {
if isRequestSignatureV4(req) || isRequestPresignedSignatureV4(req) || isRequestPostPolicySignatureV4(req) {
return false
}
return true
}
func (s signatureHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if isRequestPostPolicySignatureV4(r) && r.Method == "POST" {
s.handler.ServeHTTP(w, r)
@@ -129,5 +136,6 @@ func (s signatureHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
s.handler.ServeHTTP(w, r)
return
}
writeErrorResponse(w, r, AccessDenied, r.URL.Path)
// call goes up from here, let ACL's verify the validity of the request
s.handler.ServeHTTP(w, r)
}