aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/auth_credentials.go
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-07-28 00:50:50 +0800
committerGitHub <noreply@github.com>2020-07-28 00:50:50 +0800
commitf9ba5cd9860dfda244bf2a734d690b64966e8210 (patch)
tree3cab28e6fb5134050963fcf33167e701b76a6f26 /weed/s3api/auth_credentials.go
parent437d18705dea48d78c066d526c14c8abcdb1405f (diff)
parent37e964d4bd60a9dd792a9cc24f05eaa05d3766f2 (diff)
downloadseaweedfs-f9ba5cd9860dfda244bf2a734d690b64966e8210.tar.xz
seaweedfs-f9ba5cd9860dfda244bf2a734d690b64966e8210.zip
Merge pull request #5 from chrislusf/master
sync
Diffstat (limited to 'weed/s3api/auth_credentials.go')
-rw-r--r--weed/s3api/auth_credentials.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go
index 30052878b..db5f4c8a3 100644
--- a/weed/s3api/auth_credentials.go
+++ b/weed/s3api/auth_credentials.go
@@ -7,7 +7,6 @@ import (
"net/http"
"github.com/golang/protobuf/jsonpb"
- "github.com/gorilla/mux"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/iam_pb"
@@ -110,7 +109,7 @@ func (iam *IdentityAccessManagement) lookupByAccessKey(accessKey string) (identi
func (iam *IdentityAccessManagement) Auth(f http.HandlerFunc, action Action) http.HandlerFunc {
- if iam.isEnabled() {
+ if !iam.isEnabled() {
return f
}
@@ -159,8 +158,7 @@ func (iam *IdentityAccessManagement) authRequest(r *http.Request, action Action)
glog.V(3).Infof("user name: %v actions: %v", identity.Name, identity.Actions)
- vars := mux.Vars(r)
- bucket := vars["bucket"]
+ bucket, _ := getBucketAndObject(r)
if !identity.canDo(action, bucket) {
return ErrAccessDenied