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.Bucket can't be used for cross-account buckets #1063

Closed
kmosher opened this issue Apr 15, 2017 · 2 comments
Closed

s3.Bucket can't be used for cross-account buckets #1063

kmosher opened this issue Apr 15, 2017 · 2 comments
Labels
feature-request This issue requests a feature.

Comments

@kmosher
Copy link
Contributor

kmosher commented Apr 15, 2017

The S3 API is weird in that you can't directly interrogate a bucket's creation date. The only place it appears is in ListBuckets output. So in #128 a custom loader was added for Bucket that reads through ListBuckets to grab this info.

The problem is, ListBuckets only contains buckets owned by your current account. If you try to instantiate a Bucket with the name of bucket from a second account, the loader will 404, even if you've been granted cross-account permissions on that bucket.

I'd suggest that load() should opportunistically set the creation_date as is done now, but not fail if it can't be set. Then update the docs to not it will sometimes be None in cases where the bucket is owned by another account (or you lack ListBucket perms).

kmosher added a commit to kmosher/boto3 that referenced this issue Apr 15, 2017
This will cause it to no longer fail if creation_date
can't be found via ListBuckets (boto#1063)
@jamesls
Copy link
Member

jamesls commented Apr 17, 2017

I think that plan sounds reasonable. Thanks for the pull request.

@jamesls jamesls added the feature-request This issue requests a feature. label Apr 17, 2017
dstufft pushed a commit that referenced this issue Apr 28, 2017
* Make s3.Bucket.load() more accepting of failure

This will cause it to no longer fail if creation_date
can't be found via ListBuckets (#1063)

* Only swallow ListBuckets AccessDenied errors
kmosher added a commit to kmosher/botocore that referenced this issue May 3, 2017
@swetashre
Copy link
Contributor

The PR has been merged. So closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature.
Projects
None yet
Development

No branches or pull requests

3 participants