Browse Source

break import cycle

pull/1658/head
Chris Lu 4 years ago
parent
commit
fce8803087
  1. 14
      weed/filer/s3iam_conf_test.go
  2. 8
      weed/s3api/auth_credentials.go
  3. 1
      weed/s3api/auth_credentials_test.go
  4. 10
      weed/s3api/s3_constants/s3_actions.go
  5. 1
      weed/s3api/s3api_server.go

14
weed/filer/s3iam_conf_test.go

@ -2,7 +2,7 @@ package filer
import (
"bytes"
"github.com/chrislusf/seaweedfs/weed/s3api"
. "github.com/chrislusf/seaweedfs/weed/s3api/s3_constants"
"testing"
"github.com/chrislusf/seaweedfs/weed/pb/iam_pb"
@ -22,9 +22,9 @@ func TestS3Conf(t *testing.T) {
},
},
Actions: []string{
s3api.ACTION_ADMIN,
s3api.ACTION_READ,
s3api.ACTION_WRITE,
ACTION_ADMIN,
ACTION_READ,
ACTION_WRITE,
},
},
{
@ -36,9 +36,9 @@ func TestS3Conf(t *testing.T) {
},
},
Actions: []string{
s3api.ACTION_READ,
s3api.ACTION_TAGGING,
s3api.ACTION_LIST,
ACTION_READ,
ACTION_TAGGING,
ACTION_LIST,
},
},
},

8
weed/s3api/auth_credentials.go

@ -14,14 +14,6 @@ import (
type Action string
const (
ACTION_READ = "Read"
ACTION_WRITE = "Write"
ACTION_ADMIN = "Admin"
ACTION_TAGGING = "Tagging"
ACTION_LIST = "List"
)
type Iam interface {
Check(f http.HandlerFunc, actions ...Action) http.HandlerFunc
}

1
weed/s3api/auth_credentials_test.go

@ -1,6 +1,7 @@
package s3api
import (
. "github.com/chrislusf/seaweedfs/weed/s3api/s3_constants"
"testing"
"github.com/golang/protobuf/jsonpb"

10
weed/s3api/s3_constants/s3_actions.go

@ -0,0 +1,10 @@
package s3_constants
const (
ACTION_READ = "Read"
ACTION_WRITE = "Write"
ACTION_ADMIN = "Admin"
ACTION_TAGGING = "Tagging"
ACTION_LIST = "List"
)

1
weed/s3api/s3api_server.go

@ -3,6 +3,7 @@ package s3api
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/filer"
. "github.com/chrislusf/seaweedfs/weed/s3api/s3_constants"
"net/http"
"strings"
"time"

Loading…
Cancel
Save