-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdk): permissions errors are not caught in simulator (#6153)
Reintroduce #6079 after it was reverted by #6125 in an attempt to fix #6135. Fixes #6002 ## 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) - [ ] 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
84 changed files
with
4,336 additions
and
306 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
bring cloud; | ||
|
||
let buckets = [ | ||
new cloud.Bucket() as "b1", | ||
new cloud.Bucket() as "b2" | ||
]; | ||
|
||
test "incorrect resource permission" { | ||
// This test fails because permission is granted to b2, not b1 | ||
lift(buckets.at(1), ["put"]); | ||
let var i = 10; | ||
while i > 0 { | ||
i -= 1; | ||
} | ||
buckets.at(i).put("key", "value"); | ||
} | ||
|
||
test "incorrect permission operation" { | ||
// This test fails because permission is granted for "list", not "put" | ||
lift(buckets.at(0), ["list"]); | ||
let var i = 10; | ||
while i > 0 { | ||
i -= 1; | ||
} | ||
buckets.at(i).put("key", "value"); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,4 +50,4 @@ if util.env("WING_TARGET") == "sim" { | |
assert(startCounter.peek() == 0); | ||
assert(b.get(status) == stopped); | ||
} | ||
} | ||
} |
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
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.