Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[s3] ListMyBuckets #1837

Closed
kmlebedev opened this issue Feb 25, 2021 · 3 comments
Closed

[s3] ListMyBuckets #1837

kmlebedev opened this issue Feb 25, 2021 · 3 comments

Comments

@kmlebedev
Copy link
Contributor

kmlebedev commented Feb 25, 2021

show your buckets to non admins

s3_1       | I0226 11:14:09     1 auth_credentials.go:219] v4 auth type
s3_1       | I0226 11:14:09     1 auth_credentials.go:236] auth error: 0
s3_1       | I0226 11:14:09     1 filer_client.go:113] read directory: directory:"/buckets"  limit:2147483647
filer_1    | I0226 11:14:09     1 filer_grpc_server.go:49] ListEntries directory:"/buckets"  limit:2147483647
filer_1    | I0226 11:14:09     1 filerstore_wrapper.go:220] ListDirectoryPrefixedEntries /buckets from  prefix  limit 1024
filer_1    | I0226 11:14:09     1 filerstore_wrapper.go:220] ListDirectoryPrefixedEntries /buckets from test_5 prefix  limit 1024
s3_1       | I0226 11:14:09     1 s3api_handlers.go:89] status 200 application/xml: <?xml version="1.0" encoding="UTF-8"?>
s3_1       | <ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><DisplayName></DisplayName><ID></ID></Owner><Buckets></Buckets></ListAllMyBucketsResult>

@chrislusf
Copy link
Collaborator

chrislusf commented Feb 25, 2021

@chrislusf
Copy link
Collaborator

Current ListBuckets implementation is already filtering out non-accessible buckets for normal users.

https://github.com/chrislusf/seaweedfs/blob/master/weed/s3api/s3api_bucket_handlers.go#L54

@kmlebedev
Copy link
Contributor Author

kmlebedev commented Feb 26, 2021

make dev_registry
2.

docker exec -it seaweedfs_master_1 weed shell -filer=filer:8888 -master=master:9333
> s3.bucket.create -name test_1
create bucket under /buckets
created bucket test_1
> s3.bucket.create -name test_2
create bucket under /buckets
created bucket test_2
> s3.bucket.create -name test_3
create bucket under /buckets
created bucket test_3
> s3.bucket.create -name test_4
create bucket under /buckets
created bucket test_4
> s3.bucket.create -name test_5
create bucket under /buckets
created bucket test_5

s3.configure -access_key some_access_key1 -secret_key some_secret_key1 -actions Read,Write,List,Tagging -user test -buckets test_1,test_2,test_3,test_4,test_5 -apply
{
  "identities": [
    {
      "name": "test",
      "credentials": [
        {
          "accessKey": "some_access_key1",
          "secretKey": "some_secret_key1"
        }
      ],
      "actions": [
        "Read:test_1",
        "Read:test_2",
        "Read:test_3",
        "Read:test_4",
        "Read:test_5",
        "Write:test_1",
        "Write:test_2",
        "Write:test_3",
        "Write:test_4",
        "Write:test_5",
        "List:test_1",
        "List:test_2",
        "List:test_3",
        "List:test_4",
        "List:test_5",
        "Tagging:test_1",
        "Tagging:test_2",
        "Tagging:test_3",
        "Tagging:test_4",
        "Tagging:test_5"
      ]
    }
  ]
}
aws --profile local --endpoint http://127.0.0.1:8333/ s3api list-buckets
{
    "Buckets": [],
    "Owner": {
        "DisplayName": "",
        "ID": ""
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants