{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://procurauth.github.io/procurauth/schemas/grants-file.schema.json",
  "title": "File of grants",
  "description": "The input of the option --grants of the tool access-lint. It holds the grants of one subject, as a list. Each grant has the shape of a grant in fake-pdp-data. The schema is closed. A schema cannot check a grant against the action document, but access-lint does.",
  "type": "object",
  "additionalProperties": false,
  "required": ["grants"],
  "properties": {
    "grants": {
      "description": "The grants of one subject. A grant gives an action on a node, with limit values (protocol 3.5, 6.1). The grant of the action access on the service gives the budgets (protocol 8.3).",
      "type": "array",
      "items": { "$ref": "https://procurauth.github.io/procurauth/schemas/fake-pdp-data.schema.json#/$defs/grant" }
    }
  },
  "examples": [
    {
      "grants": [
        {
          "action": "access",
          "resource": "service:datastore",
          "limits": { "requests": [ { "amount": 10, "window": "second" }, { "amount": 300, "window": "minute" } ] }
        },
        { "action": "data.read", "resource": "service:datastore/host:prod/database:test1", "limits": { "max_rows": 1000 } }
      ]
    },
    {
      "grants": [
        { "action": "data.write", "resource": "service:datastore/host:prod/database:analytics", "confirm": true }
      ]
    },
    { "grants": [] }
  ]
}
