Fix cloud formation S3 CorsConfig#7866
Merged
pinzon merged 7 commits intolocalstack:masterfrom Mar 27, 2023
Merged
Conversation
1 task
pinzon
requested changes
Mar 14, 2023
Member
pinzon
left a comment
There was a problem hiding this comment.
Pretty awesome, just need some small changes.
pinzon
reviewed
Mar 24, 2023
| "AllowedHeaders": rule.get("AllowedHeaders"), | ||
| "AllowedMethods": rule.get("AllowedMethods"), | ||
| "AllowedOrigins": rule.get("AllowedOrigins"), | ||
| "ExposeHeaders": rule["ExposedHeaders"] if rule.get("ExposedHeaders") else None, |
Member
There was a problem hiding this comment.
dictionary.get("key") will return None if the there's no value
Suggested change
| "ExposeHeaders": rule["ExposedHeaders"] if rule.get("ExposedHeaders") else None, | |
| "ExposeHeaders": rule.get("ExposedHeaders"), |
pinzon
reviewed
Mar 24, 2023
| transformed_cors = cors_config.copy() | ||
| transformed_cors["CORSRules"] = [ | ||
| { | ||
| "ID": rule["Id"] if rule["Id"] is not None else None, |
Member
There was a problem hiding this comment.
same here
Suggested change
| "ID": rule["Id"] if rule["Id"] is not None else None, | |
| "ID": rule.get("Id"), |
pinzon
reviewed
Mar 24, 2023
| "AllowedMethods": rule.get("AllowedMethods"), | ||
| "AllowedOrigins": rule.get("AllowedOrigins"), | ||
| "ExposeHeaders": rule["ExposedHeaders"] if rule.get("ExposedHeaders") else None, | ||
| "MaxAgeSeconds": rule["MaxAge"] if rule.get("MaxAge") else None, |
Member
There was a problem hiding this comment.
Suggested change
| "MaxAgeSeconds": rule["MaxAge"] if rule.get("MaxAge") else None, | |
| "MaxAgeSeconds": rule.get("MaxAge"), |
Contributor
Author
There was a problem hiding this comment.
Just some small nitpicks.
I have made all the requested changes.
Member
|
Congrats @deepak2431 !! 🎉 |
This was referenced Apr 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is for issue #7836
No CORS configuration was implemented for S3 models if passed through the template. I have implemented the code to consider the CORSConfiguration, too while creating the bucket.
@pinzon You can review it!