-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk)!:
cloud.Bucket
supports CORS by default (#7104)
Closes #7058 Closes #7048 Currently, signed URLs created with `cloud.Bucket` can't be used by web applications in Wing since CORS options aren't configurable. CORS (Cross-Origin Resource Sharing) affects how the browser can access other domains. To solve this, we add two new fields, `cors` and `corsOptions` to the props of `cloud.Bucket`. We've configured `cors: true` as the default so that these kinds of use cases for using signed URLs will work out of the box. If the bucket is private, CORS settings still apply, but they only come into effect when the bucket's objects are accessed through a signed URL or by authenticated users. BREAKING CHANGE: `cloud.Bucket` now is synthesized with CORS configuration by default (currently only supported on AWS). If your bucket is public or you are using signed URLs extensively, you may want to consider configuring the `corsOptions` on the bucket or disabling CORS based on your application's needs. ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [x] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
Showing
100 changed files
with
4,967 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.