fix(Config Schema): validate resourcePolicy is array#8051
Merged
medikoo merged 1 commit intoAug 17, 2020
Merged
Conversation
Contributor
Author
|
I don't love that the test takes so long to run but I don't know a faster way to do it; based on tests in #7335. If there is a better way to test this I'd be happy to make the change. |
Codecov Report
@@ Coverage Diff @@
## master #8051 +/- ##
==========================================
+ Coverage 88.36% 88.37% +0.01%
==========================================
Files 248 248
Lines 9446 9446
==========================================
+ Hits 8347 8348 +1
+ Misses 1099 1098 -1
Continue to review full report at Codecov.
|
medikoo
suggested changes
Aug 6, 2020
glb
force-pushed
the
7795-check-apigateway-resource-policy-structure
branch
from
August 11, 2020 19:36
e63a48c to
954a060
Compare
In the AWS provider, the `resourcePolicy` must be an array. If you paste a resource policy from the console, your stack will fail to create.
glb
force-pushed
the
7795-check-apigateway-resource-policy-structure
branch
from
August 11, 2020 19:45
954a060 to
f8c1f28
Compare
Contributor
Author
|
Thanks @medikoo ! I have updated, rebased, and done manual testing with invalid and valid values for serverless.ymlservice: test
provider:
name: aws
resourcePolicy:
- testOutput: Serverless: Configuration error at 'provider.resourcePolicy[0]': should be objectserverless.ymlservice: test
provider:
name: aws
resourcePolicy: {}Output: Serverless: Configuration error at 'provider.resourcePolicy': should be arrayserverless.ymlservice: test
provider:
name: aws
resourcePolicy:
- Effect: Allow
Principal: "*"
Action: "*"
Resource: "*"Output: no error (though arguably that's a terrible resource policy. 😆 ) |
medikoo
approved these changes
Aug 17, 2020
8 tasks
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.
In the AWS provider, the
resourcePolicymust be an array. If you paste a resource policy from the console, your stack will fail to create.Closes: #7795
Addresses: #8018