-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
S3Control api in moto #4707
Comments
Hi @SimonToftegaard, good catch! Ideally everything related to s3control would be separated out, but that would be a breaking change at this point. |
My plan was to initially implement: url_bases = [ url_paths = { Could I just put something similar into the urls py of s3? The main problem for me right now it seems like the current implementation only works for the builtin accountid and I need to setup additional configuration for the account for my test, including an organization structure and that does not seem possible with the builtin one. Another solution would just to implement the new s3control and leave the old implementation in s3. That way anyone could use the old implementation with mock_s3 and the new implementation could be used with mock_s3control. |
The The fact that we only support the builtin accountid is definitely an issue, but that's Moto-wide - every service is single-account/single-user based. I don't see an easy way of implementing support for this, without losing the current functionality (accepting one account, rejecting unknown accounts). The builtin accountid is centralized though - can you mock it during the test?
|
Could you give a more specific example of how to override the existing builtin accountId? |
The simplest example:
Note the change to |
Tried that exact same thing first, but for some weird reason it failed. Tried again now and it works great. Thank you for the help. Anyway to update the implementation coverage documentation, so the next person looking for this can see that some of the s3control api is implemented? |
All good - glad to hear it works!
Yeah, it could be useful as a basis for the refactor. If you could push the changes to a branch, that would be great.
The coverage documentation is completely automated, so there's no clean way of doing that, unfortunately.. |
ok, I will finish up the code I already have and make a pull request. |
Moto 3.0.0 (just released) now has these features under the new I'll close this, but please let us know if you're running into any other issues! |
I needed to use the s3control api in moto and according to https://github.com/spulec/moto/blob/master/IMPLEMENTATION_COVERAGE.md it was not yet implemented.
So I started working on the implementation, but then I noticed that part of the s3control api was actually already implemented under the s3 api in moto.
So before continuing the work I would really like to be sure what is the right way to continue?
Do a full separate implementation under s3control or something else?
Also the current implementation only seem to work with the builtin account:
from moto.s3.models import ACCOUNT_ID
The text was updated successfully, but these errors were encountered: