| { |
| "$schema": "http://json-schema.org/draft-04/schema#", |
| "title": "Security fresh schema", |
| "type": "object", |
| "properties": { |
| "last-reviewed": { |
| "type": "string", |
| "format": "date-time" |
| }, |
| "exempt": { |
| "type": "string", |
| "enum": ["true", "false", "default"] |
| }, |
| "owners": { |
| "type": "array", |
| "items": { |
| "type": "string" |
| } |
| }, |
| "review-frequency": { |
| "anyOf": [ |
| { |
| "type": "string", |
| "enum": ["indefinite"] |
| }, |
| { |
| "type": "integer", |
| "minimum": 1 |
| } |
| ] |
| } |
| }, |
| "required": [ |
| "last-reviewed" |
| ], |
| "additionalProperties": false, |
| "tests":[ |
| { |
| "id": "VALID_1", |
| "description": "List of strings", |
| "data": { |
| "last-reviewed": "2019-11-13T20:20:39+00:00", |
| "exempt": "true", |
| "owners": ["customemail@customdomain.com"], |
| "review-frequency": 60 |
| }, |
| "valid": true |
| }, |
| { |
| "id": "VALID_2", |
| "description": "only last-reviewed", |
| "data": { |
| "last-reviewed": "2019-11-13T20:20:39+00:00" |
| }, |
| "valid": true |
| }, |
| { |
| "id": "VALID_3", |
| "description": "indefinite review frequency", |
| "data": { |
| "last-reviewed": "2019-11-13T20:20:39+00:00", |
| "exempt": "true", |
| "owners": ["customemail@customdomain.com"], |
| "review-frequency": "indefinite" |
| }, |
| "valid": true |
| }, |
| { |
| "id": "INVALID_1", |
| "description": "without last-review field", |
| "data": {}, |
| "valid": false |
| }, |
| { |
| "id": "INVALID_2", |
| "description": "last-reviewed in non-ISO8601 time format", |
| "data": { |
| "last-reviewed": "11-13-2019T20:20:39+00:00", |
| "exempt": "true", |
| "owners": ["customemail@customdomain.com"], |
| "review-frequency": "indefinite" |
| }, |
| "valid": false |
| }, |
| { |
| "id": "INVALID_3", |
| "description": "zero review frequency", |
| "data": { |
| "last-reviewed": "2019-11-13T20:20:39+00:00", |
| "exempt": "true", |
| "owners": ["customemail@customdomain.com"], |
| "review-frequency": 0 |
| }, |
| "valid": false |
| } |
| ] |
| } |