diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2023-09-21 20:19:11 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-21 08:19:11 -0700 |
| commit | d8b424d123300aad13b934b25f5670506396da7b (patch) | |
| tree | 5755d2945590b7577e859f86dc50a4896cbd8fec /weed/s3api/auth_credentials_test.go | |
| parent | 411bdda08dc4e902246ee387ae3abe71309e4586 (diff) | |
| download | seaweedfs-d8b424d123300aad13b934b25f5670506396da7b.tar.xz seaweedfs-d8b424d123300aad13b934b25f5670506396da7b.zip | |
[s3] optimization iam lookup for reducing algorithm complexity (#4857)
optimization iam lookup for reducing algorithm complexity
https://github.com/seaweedfs/seaweedfs/issues/4519
Co-authored-by: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.co>
Diffstat (limited to 'weed/s3api/auth_credentials_test.go')
| -rw-r--r-- | weed/s3api/auth_credentials_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/s3api/auth_credentials_test.go b/weed/s3api/auth_credentials_test.go index 1f0ffc1cc..645932aba 100644 --- a/weed/s3api/auth_credentials_test.go +++ b/weed/s3api/auth_credentials_test.go @@ -126,6 +126,15 @@ func TestCanDo(t *testing.T) { } assert.Equal(t, true, ident5.canDo(ACTION_READ, "special_bucket", "/a/b/c/d.txt")) assert.Equal(t, true, ident5.canDo(ACTION_WRITE, "special_bucket", "/a/b/c/d.txt")) + + // anonymous buckets + ident6 := &Identity{ + Name: "anonymous", + Actions: []Action{ + "Read", + }, + } + assert.Equal(t, true, ident6.canDo(ACTION_READ, "anything_bucket", "/a/b/c/d.txt")) } type LoadS3ApiConfigurationTestCase struct { |
