{
  "$id": "https://firefox-ci-tc.services.mozilla.com/schemas/auth/v1/github-repo-token-request.json#",
  "$schema": "https://firefox-ci-tc.services.mozilla.com/schemas/common/metaschema.json#",
  "additionalProperties": false,
  "description": "The list of permissions and repositories to scope a repository level github token to.\n",
  "properties": {
    "permissions": {
      "additionalProperties": false,
      "description": "Repository level github app permissions to request. Mapping a permission\nname to the desired level of access. Names and levels are a direct mapping\nfrom [github API permissions](https://docs.github.com/en/rest/apps/apps?apiVersion=2026-03-10#create-an-installation-access-token-for-an-app).\n",
      "minProperties": 1,
      "properties": {
        "actions": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "administration": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "artifact_metadata": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "attestations": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "checks": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "code_quality": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "codespaces": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "contents": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "dependabot_secrets": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "deployments": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "discussions": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "environments": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "issues": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "merge_queues": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "metadata": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "packages": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "pages": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "pull_requests": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "repository_custom_properties": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "repository_hooks": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "repository_projects": {
          "enum": [
            "read",
            "write",
            "admin"
          ],
          "type": "string"
        },
        "secret_scanning_alerts": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "secrets": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "security_events": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "single_file": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "statuses": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "vulnerability_alerts": {
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "workflows": {
          "enum": [
            "write"
          ],
          "type": "string"
        }
      },
      "title": "Repository permissions",
      "type": "object"
    },
    "repositories": {
      "description": "Names of the repositories (within `:owner`) the token gets access to.\n",
      "items": {
        "pattern": "^[A-Za-z0-9._-]+$",
        "type": "string"
      },
      "maxItems": 500,
      "minItems": 1,
      "title": "Repositories",
      "type": "array"
    }
  },
  "required": [
    "permissions",
    "repositories"
  ],
  "title": "Github repository token request",
  "type": "object"
}