diff options
| author | LHHDZ <changlin.shi@ly.com> | 2022-10-10 21:44:29 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-10 06:44:29 -0700 |
| commit | 3550692afc3cad1166522c2eada46efd3b3a617d (patch) | |
| tree | efaf3604efab5aa6dc72a31c95829de0badc5bae /weed/s3api/auth_credentials.go | |
| parent | 0711870f43e6c5eadd3df70f22478e6e9998e5a2 (diff) | |
| download | seaweedfs-3550692afc3cad1166522c2eada46efd3b3a617d.tar.xz seaweedfs-3550692afc3cad1166522c2eada46efd3b3a617d.zip | |
change s3_account.go package to avoid cycle dependency (#3813)
Diffstat (limited to 'weed/s3api/auth_credentials.go')
| -rw-r--r-- | weed/s3api/auth_credentials.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go index 46a66a427..82ac3688c 100644 --- a/weed/s3api/auth_credentials.go +++ b/weed/s3api/auth_credentials.go @@ -2,6 +2,7 @@ package s3api import ( "fmt" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3account" "net/http" "os" "strings" @@ -40,7 +41,7 @@ type Identity struct { } func (i *Identity) isAnonymous() bool { - return i.Name == AccountAnonymous.Name + return i.Name == s3account.AccountAnonymous.Name } type Credential struct { @@ -132,16 +133,16 @@ func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3Api for _, ident := range config.Identities { t := &Identity{ Name: ident.Name, - AccountId: AccountAdmin.Id, + AccountId: s3account.AccountAdmin.Id, Credentials: nil, Actions: nil, } - if ident.Name == AccountAnonymous.Name { - if ident.AccountId != "" && ident.AccountId != AccountAnonymous.Id { + if ident.Name == s3account.AccountAnonymous.Name { + if ident.AccountId != "" && ident.AccountId != s3account.AccountAnonymous.Id { glog.Warningf("anonymous identity is associated with a non-anonymous account ID, the association is invalid") } - t.AccountId = AccountAnonymous.Id + t.AccountId = s3account.AccountAnonymous.Id IdentityAnonymous = t } else { if len(ident.AccountId) > 0 { @@ -163,8 +164,8 @@ func (iam *IdentityAccessManagement) loadS3ApiConfiguration(config *iam_pb.S3Api if IdentityAnonymous == nil { IdentityAnonymous = &Identity{ - Name: AccountAnonymous.Name, - AccountId: AccountAnonymous.Id, + Name: s3account.AccountAnonymous.Name, + AccountId: s3account.AccountAnonymous.Id, } } iam.m.Lock() |
