{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://trustgraduation.org/extensions/a2a/action-authorization/v1/approval-grant.schema.json",
  "title": "Trust Graduation A2A Single-Use Approval Grant",
  "description": "Revocable, expiring authorization for the exact action identified by actionHash.",
  "type": "object",
  "required": [
    "protocol",
    "version",
    "state",
    "grantId",
    "issuer",
    "principal",
    "requestedBy",
    "workspace",
    "tenant",
    "actionClass",
    "target",
    "inputHash",
    "actionHash",
    "nonce",
    "scope",
    "maxExecutions",
    "executionCount",
    "issuedAt",
    "expiresAt",
    "revocable"
  ],
  "properties": {
    "protocol": { "const": "trust-graduation-authorization" },
    "version": { "const": "1.0" },
    "state": { "const": "approved" },
    "grantId": { "type": "string", "pattern": "\\S" },
    "issuer": { "type": "string", "pattern": "\\S" },
    "principal": { "type": "string", "minLength": 1 },
    "requestedBy": { "type": "string", "minLength": 1 },
    "workspace": { "type": "string" },
    "tenant": { "type": "string" },
    "actionClass": { "type": "string", "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$" },
    "target": { "type": "string" },
    "inputHash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
    "actionHash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
    "nonce": { "type": "string", "pattern": "\\S" },
    "scope": { "const": "once" },
    "maxExecutions": { "const": 1 },
    "executionCount": { "type": "integer", "minimum": 0, "maximum": 1 },
    "issuedAt": { "type": "string", "format": "date-time" },
    "expiresAt": { "type": "string", "format": "date-time" },
    "revocable": { "const": true },
    "revocationHandle": { "type": "string" },
    "revokedAt": { "type": "string", "format": "date-time" },
    "signature": { "type": "object" }
  },
  "additionalProperties": false
}
