{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.endpoint-plugin-submission.schema.json",
  "title": "LocalEndpoint Endpoint Plugin Submission Packet",
  "description": "Describes a public-safe endpoint plugin review packet. It carries evidence for review and does not submit secrets or grant runtime authority.",
  "type": "object",
  "required": [
    "schema",
    "pluginId",
    "displayName",
    "domain",
    "developerName",
    "developerContact",
    "requestedInstallState",
    "requestedCapabilities",
    "manifestUrl",
    "privacyStatementUrl",
    "threatModelSummary",
    "runtimeAuthorityRequested",
    "requiresSeparateInstall",
    "localApprovalRequired",
    "testEvidence",
    "submissionNotes"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "const": "localendpoint.endpoint-plugin-submission.v1"
    },
    "pluginId": {
      "type": "string",
      "minLength": 3,
      "maxLength": 120,
      "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$"
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "domain": {
      "type": "string",
      "minLength": 3,
      "maxLength": 120,
      "pattern": "^[a-z0-9][a-z0-9.-]*[a-z0-9]$"
    },
    "developerName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "developerContact": {
      "type": "string",
      "minLength": 3,
      "maxLength": 240
    },
    "requestedInstallState": {
      "type": "string",
      "enum": [
        "available",
        "planned",
        "blocked",
        "proposed"
      ]
    },
    "requestedCapabilities": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
      }
    },
    "manifestUrl": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "repositoryUrl": {
      "type": "string",
      "maxLength": 500
    },
    "privacyStatementUrl": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "threatModelSummary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "runtimeAuthorityRequested": {
      "type": "boolean",
      "const": false
    },
    "requiresSeparateInstall": {
      "type": "boolean",
      "const": true
    },
    "localApprovalRequired": {
      "type": "boolean",
      "const": true
    },
    "testEvidence": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "name",
          "url",
          "sha256"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "url": {
            "type": "string",
            "maxLength": 500
          },
          "sha256": {
            "type": "string",
            "maxLength": 64
          }
        },
        "additionalProperties": false
      }
    },
    "submissionNotes": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    }
  },
  "additionalProperties": false
}
