{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "sources"],
  "properties": {
    "schemaVersion": { "const": 1 },
    "sources": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["repository", "commit", "version", "license", "licensePath", "licenseDigest", "reviewedAt", "risk", "permissions", "contentDigests", "sets"],
        "properties": {
          "repository": { "type": "string", "pattern": "^https://" },
          "commit": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
          "version": { "type": "string", "minLength": 1 },
          "license": { "type": "string", "minLength": 1 },
          "licensePath": { "type": "string", "minLength": 1 },
          "licenseDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
          "reviewedAt": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
          "risk": { "enum": ["low", "medium", "high"] },
          "permissions": {
            "type": "object",
            "additionalProperties": false,
            "required": ["network", "hooks", "writesOutsideProject"],
            "properties": {
              "network": { "type": "boolean" },
              "hooks": { "type": "boolean" },
              "writesOutsideProject": { "type": "boolean" }
            }
          },
          "contentDigests": { "type": "object", "additionalProperties": { "type": "string", "pattern": "^[a-f0-9]{64}$" } },
          "sets": { "type": "object", "additionalProperties": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } } }
        }
      }
    }
  }
}
