{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://grip.foxora.dev/schema/1.0-draft.2/grant.schema.json",
  "title": "GRIP Grant",
  "description": "Attenuated authority conveyed from a Mandate, or from a delegable Grant, to an actor. §4.3.2.",
  "allOf": [{ "$ref": "common.schema.json#/$defs/envelope" }],
  "type": "object",
  "required": ["grip", "type", "id", "parents", "iss", "actor", "allow", "iat", "exp", "sig"],
  "properties": {
    "type": { "const": "grant" },
    "parents": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/digest" }, "minItems": 1, "maxItems": 1 },
    "actor": { "$ref": "common.schema.json#/$defs/keyref" },
    "allow": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "common.schema.json#/$defs/allowEntry" },
      "description": "Every entry MUST carry a class; there is no default. §4.3.2."
    },
    "budget": { "$ref": "common.schema.json#/$defs/budget" },
    "delegable": { "type": "boolean", "default": false, "description": "Law 4: delegation is off by default." },
    "delegation_issuers": {
      "type": "array",
      "items": { "$ref": "common.schema.json#/$defs/keyref" },
      "uniqueItems": true,
      "description": "Keys other than the actor permitted to issue children of this Grant. §4.3.2 law 4."
    },
    "actor_sig": { "$ref": "common.schema.json#/$defs/sig", "description": "Actor's detached signature over the child Grant's canonical form, when a runtime issues on the actor's behalf. §4.3.2 law 4." }
  }
}
