-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional checks on structured properties to not leak the additi…
…onal properties to handlers during validation (#642)
- Loading branch information
1 parent
04ead46
commit 6e9fd5c
Showing
7 changed files
with
189 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
...data/schema/invalid/invalid_nested_property_object_additionalProperties_true_warning.json
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,22 @@ | ||
{ | ||
"typeName": "AWS::Valid::TypeName", | ||
"description": "a test schema", | ||
"properties": { | ||
"property1": { | ||
"type": "object", | ||
"properties": { | ||
"property1": { | ||
"type": "integer" | ||
} | ||
}, | ||
"additionalProperties": true | ||
} | ||
}, | ||
"primaryIdentifier": [ | ||
"/properties/property1" | ||
], | ||
"readOnlyProperties": [ | ||
"/properties/property1" | ||
], | ||
"additionalProperties": false | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/data/schema/invalid/invalid_pattern_properties_additionalProperties_true_warning.json
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,29 @@ | ||
{ | ||
"typeName": "AWS::Valid::TypeName", | ||
"description": "a test schema", | ||
"definitions": { | ||
"obj2def": { | ||
"type": "object", | ||
"patternProperties": { | ||
".*": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": true | ||
} | ||
}, | ||
"properties": { | ||
"obj2": { | ||
"type": "object", | ||
"description": "", | ||
"$ref": "#/definitions/obj2def" | ||
}, | ||
"enum1": { | ||
"type": "string" | ||
} | ||
}, | ||
"primaryIdentifier": [ | ||
"/properties/enum1" | ||
], | ||
"additionalProperties": false | ||
} |
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 |
---|---|---|
|
@@ -8,7 +8,8 @@ | |
"property1": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"primaryIdentifier": [ | ||
|
21 changes: 21 additions & 0 deletions
21
tests/data/schema/valid/valid_nested_property_object_no_additionalProperties_warning.json
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,21 @@ | ||
{ | ||
"typeName": "AWS::Valid::TypeName", | ||
"description": "a test schema", | ||
"properties": { | ||
"property1": { | ||
"type": "object", | ||
"properties": { | ||
"property1": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
}, | ||
"primaryIdentifier": [ | ||
"/properties/property1" | ||
], | ||
"readOnlyProperties": [ | ||
"/properties/property1" | ||
], | ||
"additionalProperties": false | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/data/schema/valid/valid_pattern_properties_no_additionalProperties_warning.json
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,28 @@ | ||
{ | ||
"typeName": "AWS::Valid::TypeName", | ||
"description": "a test schema", | ||
"definitions": { | ||
"obj2def": { | ||
"type": "object", | ||
"patternProperties": { | ||
".*": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"properties": { | ||
"obj2": { | ||
"type": "object", | ||
"description": "", | ||
"$ref": "#/definitions/obj2def" | ||
}, | ||
"enum1": { | ||
"type": "string" | ||
} | ||
}, | ||
"primaryIdentifier": [ | ||
"/properties/enum1" | ||
], | ||
"additionalProperties": false | ||
} |
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