{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/secret-patterns.schema.json",
  "title": "Secret patterns",
  "description": "secret-patterns.json: the credential shapes every secret detector is generated from, and per shape one or more test samples built from a prefix, a fill character repeated len times and a suffix. A len of 0 with an empty fill is a fixed string.",
  "type": "object",
  "additionalProperties": false,
  "required": ["patterns", "providers"],
  "properties": {
    "$comment": { "type": "string" },
    "patterns": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "label", "kind", "ere"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "label": { "type": "string", "minLength": 1 },
          "kind": { "enum": ["token", "context"] },
          "ere": { "type": "string", "minLength": 1 },
          "left": { "type": "string", "minLength": 1 },
          "right": { "type": "string", "minLength": 1 },
          "ignoreCase": { "type": "boolean" },
          "lead": { "type": "string", "minLength": 1 },
          "blockEnd": { "type": "string", "minLength": 1 }
        }
      }
    },
    "providers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "rule", "prefix", "fill", "len", "suffix"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "rule": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "prefix": { "type": "string" },
          "fill": { "type": "string", "maxLength": 1 },
          "len": { "type": "integer", "minimum": 0 },
          "suffix": { "type": "string" }
        }
      }
    }
  }
}
