{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phala/json-schema/phala-kms-inspect-response-schema.json",
  "title": "KmsInspectResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phala-kms-api-openapi.yml#/components/schemas/KmsInspectResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "slug": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Slug"
    },
    "endpoint": {
      "type": "string",
      "title": "Endpoint"
    },
    "kms_type": {
      "type": "string",
      "title": "Kms Type"
    },
    "db_version": {
      "type": "string",
      "title": "Db Version"
    },
    "rpc": {
      "anyOf": [
        {
          "$ref": "#/$defs/KmsRpcInfo"
        },
        {
          "type": "null"
        }
      ]
    },
    "rpc_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rpc Error"
    },
    "guest_agent": {
      "anyOf": [
        {
          "$ref": "#/$defs/GuestAgentInfo"
        },
        {
          "type": "null"
        }
      ]
    },
    "guest_agent_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Guest Agent Error"
    },
    "teepods": {
      "items": {
        "$ref": "#/$defs/TeepodInfo"
      },
      "type": "array",
      "title": "Teepods"
    },
    "on_chain": {
      "anyOf": [
        {
          "$ref": "#/$defs/OnChainInfo"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "id",
    "slug",
    "endpoint",
    "kms_type",
    "db_version"
  ],
  "$defs": {
    "BootstrapInfoOut": {
      "properties": {
        "k256_pubkey": {
          "type": "string",
          "title": "K256 Pubkey",
          "description": "K256 public key hex"
        },
        "ca_pubkey": {
          "type": "string",
          "title": "Ca Pubkey",
          "description": "CA public key hex"
        },
        "quote_length": {
          "type": "integer",
          "title": "Quote Length",
          "description": "Quote byte length"
        },
        "eventlog_length": {
          "type": "integer",
          "title": "Eventlog Length",
          "description": "Eventlog byte length"
        }
      },
      "type": "object",
      "required": [
        "k256_pubkey",
        "ca_pubkey",
        "quote_length",
        "eventlog_length"
      ],
      "title": "BootstrapInfoOut"
    },
    "GuestAgentInfo": {
      "properties": {
        "device_id": {
          "type": "string",
          "title": "Device Id"
        },
        "mr_aggregated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mr Aggregated"
        },
        "os_image_hash": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Os Image Hash"
        },
        "instance_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Instance Id"
        },
        "app_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "App Id"
        },
        "mr_key_provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mr Key Provider"
        },
        "compose_hash": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Compose Hash"
        }
      },
      "type": "object",
      "required": [
        "device_id"
      ],
      "title": "GuestAgentInfo"
    },
    "KmsRpcInfo": {
      "properties": {
        "version": {
          "type": "string",
          "title": "Version",
          "description": "Real-time version from x-app-version header"
        },
        "is_dev": {
          "type": "boolean",
          "title": "Is Dev"
        },
        "chain_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Chain Id"
        },
        "kms_contract_address": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Kms Contract Address"
        },
        "gateway_app_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gateway App Id"
        },
        "bootstrap_info": {
          "$ref": "#/$defs/BootstrapInfoOut"
        },
        "version_synced": {
          "type": "boolean",
          "title": "Version Synced",
          "description": "Whether DB version matches real version"
        }
      },
      "type": "object",
      "required": [
        "version",
        "is_dev",
        "bootstrap_info",
        "version_synced"
      ],
      "title": "KmsRpcInfo"
    },
    "OnChainInfo": {
      "properties": {
        "kms_info": {
          "anyOf": [
            {
              "$ref": "#/$defs/OnChainKmsInfo"
            },
            {
              "type": "null"
            }
          ]
        },
        "gateway_app_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gateway App Id"
        },
        "owner": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Owner"
        },
        "verification": {
          "$ref": "#/$defs/OnChainVerification"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        }
      },
      "type": "object",
      "title": "OnChainInfo"
    },
    "OnChainKmsInfo": {
      "properties": {
        "k256_pubkey": {
          "type": "string",
          "title": "K256 Pubkey"
        },
        "ca_pubkey": {
          "type": "string",
          "title": "Ca Pubkey"
        },
        "quote_length": {
          "type": "integer",
          "title": "Quote Length"
        },
        "eventlog_length": {
          "type": "integer",
          "title": "Eventlog Length"
        }
      },
      "type": "object",
      "required": [
        "k256_pubkey",
        "ca_pubkey",
        "quote_length",
        "eventlog_length"
      ],
      "title": "OnChainKmsInfo"
    },
    "OnChainVerification": {
      "properties": {
        "k256_pubkey_match": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "K256 Pubkey Match",
          "description": "RPC vs chain k256_pubkey"
        },
        "ca_pubkey_match": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ca Pubkey Match",
          "description": "RPC vs chain ca_pubkey"
        },
        "gateway_app_id_match": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gateway App Id Match",
          "description": "RPC vs chain gateway_app_id"
        },
        "device_id_allowed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Device Id Allowed",
          "description": "Guest agent device_id in whitelist"
        },
        "os_image_allowed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Os Image Allowed",
          "description": "Guest agent os_image_hash in whitelist"
        },
        "mr_aggregated_allowed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mr Aggregated Allowed",
          "description": "Guest agent mr_aggregated in whitelist"
        }
      },
      "type": "object",
      "title": "OnChainVerification"
    },
    "TeepodImageInfo": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "is_dev": {
          "type": "boolean",
          "title": "Is Dev"
        }
      },
      "type": "object",
      "required": [
        "name",
        "version",
        "is_dev"
      ],
      "title": "TeepodImageInfo"
    },
    "TeepodInfo": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "teepod_version_db": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Teepod Version Db"
        },
        "teepod_version_real": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Teepod Version Real"
        },
        "kms_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Kms Url",
          "description": "KMS URL configured in VMM"
        },
        "kms_urls": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Kms Urls"
        },
        "available_os_images": {
          "items": {
            "$ref": "#/$defs/TeepodImageInfo"
          },
          "type": "array",
          "title": "Available Os Images"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "TeepodInfo"
    }
  }
}