Description
Bug Description
I cannot read the contents of an object, even though I have the s3:GetObject
, as well as the s3:ListBucket
permission for it. Additionally the s3:ListAllMyBuckets
permission is needed, otherwise the access is forbidden.
Expected Behavior
A user who is allowed to access an object should be able to access it without additional permissions. In our scenario it is not feasible to give the
ListAllMyBuckets
permission.
Environment
s3fs-nio
version: 2.0.0- OS: Windows 10
- JDK: 8
Additional context
This behavior is caused in S3SeekableByteChannel:85 when calling getBucket
. This method tries to get all buckets and then filter for the one needed, thus needing the s3:ListAllMyBuckets
permission.
Proposed Solution
Remove the call of getBucket
and instead retrieve the name of the bucket directly from the path object by calling getBucketName
on it.
Also, I want to open a pull request with the proposed solution shortly.