{
  "protocol": "provisionUi",
  "imports": [
    {
      "path": "common.avdl",
      "type": "idl"
    },
    {
      "path": "gpg_common.avdl",
      "type": "idl"
    }
  ],
  "types": [
    {
      "type": "enum",
      "name": "ProvisionMethod",
      "symbols": [
        "DEVICE_0",
        "PAPER_KEY_1",
        "PASSPHRASE_2",
        "GPG_IMPORT_3",
        "GPG_SIGN_4"
      ]
    },
    {
      "type": "enum",
      "name": "GPGMethod",
      "symbols": [
        "GPG_NONE_0",
        "GPG_IMPORT_1",
        "GPG_SIGN_2"
      ]
    },
    {
      "type": "enum",
      "name": "ChooseType",
      "symbols": [
        "EXISTING_DEVICE_0",
        "NEW_DEVICE_1"
      ]
    },
    {
      "type": "record",
      "name": "SecretResponse",
      "fields": [
        {
          "type": "bytes",
          "name": "secret"
        },
        {
          "type": "string",
          "name": "phrase"
        }
      ],
      "doc": "SecretResponse should be returned by DisplayAndPromptSecret.  Use either secret or phrase."
    }
  ],
  "messages": {
    "chooseProvisioningMethod": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "gpgOption",
          "type": "boolean"
        }
      ],
      "response": "ProvisionMethod",
      "doc": "DEPRECATED:\n    Called during device provisioning for the user to select a\n    method for provisioning.  gpgOption will be true if GPG\n    should be offered as an option."
    },
    "chooseGPGMethod": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "keys",
          "type": {
            "type": "array",
            "items": "GPGKey"
          }
        }
      ],
      "response": "GPGMethod",
      "doc": "Called during device provisioning for the user to select a\n    GPG method, either import the key into keybase's local keyring\n    or use GPG to sign a provisioning statement.\n\n    The keys are provided for display purposes, so the UI can\n    do something like \"We found the following GPG keys on this\n    machine.  How would you like to use one of them to provision\n    this device?\"\n\n    After this, gpg_ui.selectKey will be called (if there are\n    multiple keys available)."
    },
    "switchToGPGSignOK": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "key",
          "type": "GPGKey"
        },
        {
          "name": "importError",
          "type": "string"
        }
      ],
      "response": "boolean",
      "doc": "If there was an error importing a gpg key into the local\n    keyring, tell the user and offer to switch to GPG signing\n    with this key.  Return true to switch to GPG signing,\n    false to abort provisioning."
    },
    "chooseDevice": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "devices",
          "type": {
            "type": "array",
            "items": "Device"
          }
        }
      ],
      "response": "DeviceID"
    },
    "chooseDeviceType": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "kind",
          "type": "ChooseType"
        }
      ],
      "response": "DeviceType",
      "doc": "If provisioning via device, this will be called so user can select the provisioner/provisionee device type: desktop or mobile.\n   If selecting the existing device type, set kind to EXISTING_DEVICE_0.\n   If selecting the new device type, set kind to NEW_DEVICE_1."
    },
    "DisplayAndPromptSecret": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "secret",
          "type": "bytes"
        },
        {
          "name": "phrase",
          "type": "string"
        },
        {
          "name": "otherDeviceType",
          "type": "DeviceType"
        }
      ],
      "response": "SecretResponse",
      "doc": "DisplayAndPromptSecret displays a secret that the user can enter into the other device.\n   It also can return a secret that the user enters into this device (from the other device).\n   If it does not return a secret, it will be canceled when this device receives the secret via kex2.",
      "lint": "ignore"
    },
    "DisplaySecretExchanged": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "DisplaySecretExchanged is called when the kex2 secret has successfully been exchanged by the two\n   devices.",
      "lint": "ignore"
    },
    "PromptNewDeviceName": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "existingDevices",
          "type": {
            "type": "array",
            "items": "string"
          }
        },
        {
          "name": "errorMessage",
          "type": "string"
        }
      ],
      "response": "string",
      "doc": "PromptNewDeviceName is called when the device provisioning process needs a name for the new device.\n   To help the clients not send a duplicate name, existingDevices is populated with the current device\n   names for the user.  If the device name returned to the service is invalid or already\n   taken, it will call this again with an error message in errorMessage.",
      "lint": "ignore"
    },
    "ProvisioneeSuccess": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "username",
          "type": "string"
        },
        {
          "name": "deviceName",
          "type": "string"
        }
      ],
      "response": null,
      "doc": "ProvisioneeSuccess is called on provisionee when it is successfully provisioned.",
      "lint": "ignore"
    },
    "ProvisionerSuccess": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "deviceName",
          "type": "string"
        },
        {
          "name": "deviceType",
          "type": "string"
        }
      ],
      "response": null,
      "doc": "ProvisionerSuccess is called on provisioner when it successfully provisions another device.",
      "lint": "ignore"
    }
  },
  "namespace": "keybase.1"
}