Created
May 17, 2020 10:16
-
-
Save philsturgeon/8c1aab93e211fdbebaaface5d6bc5d0f to your computer and use it in GitHub Desktop.
cache control rule
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
rules: | |
cache-control-undocumented: | |
description: |- | |
Cache usage MUST be extensively detailed in the `description` property | |
to avoid data leaks or the usage of stale data. | |
This rule should ensure in some way that the api provider | |
documented extensively the cache usage to avoid data leaks | |
or usage of stale data. | |
For now this just tests the presence of `max-age` but that's | |
only a placeholder. Hints welcome. | |
message: >- | |
Cache usage MUST be documented: {{error}} | |
formats: | |
- oas3 | |
severity: error | |
given: >- | |
$..[parameters].[?(@.name=="cache-control" || @.name=="Cache-Control")] | |
then: | |
- field: description | |
function: pattern | |
functionOptions: | |
match: >- | |
max-age.* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment