{
  "protocol": "login",
  "imports": [
    {
      "path": "common.avdl",
      "type": "idl"
    }
  ],
  "types": [
    {
      "type": "record",
      "name": "ConfiguredAccount",
      "fields": [
        {
          "type": "string",
          "name": "username"
        },
        {
          "type": "boolean",
          "name": "hasStoredSecret"
        }
      ]
    }
  ],
  "messages": {
    "getConfiguredAccounts": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": {
        "type": "array",
        "items": "ConfiguredAccount"
      },
      "doc": "Returns an array of information about accounts configured on the local\n    machine. Currently configured accounts are defined as those that have stored\n    secrets, but this definition may be expanded in the future."
    },
    "login": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "deviceType",
          "type": "string"
        },
        {
          "name": "usernameOrEmail",
          "type": "string"
        },
        {
          "name": "clientType",
          "type": "ClientType"
        }
      ],
      "response": null,
      "doc": "Performs login.  deviceType should be libkb.DeviceTypeDesktop\n    or libkb.DeviceTypeMobile.  usernameOrEmail is optional.\n    If the current device isn't provisioned, this function will\n    provision it.\n\n    Note that if usernameOrEmail is an email address, only provisioning\n    will be attempted.  If the device is already provisioned, login\n    via email address does not work."
    },
    "loginProvisionedDevice": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "username",
          "type": "string"
        },
        {
          "name": "noPassphrasePrompt",
          "type": "boolean"
        }
      ],
      "response": null,
      "doc": "Login a user only if the user is on a provisioned device.  Username is optional.\n    If noPassphrasePrompt is set, then only a stored secret will be used to unlock\n    the device keys."
    },
    "loginWithPaperKey": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "Login and unlock by\n  - trying unlocked device keys if available\n  - prompting for a paper key and using that"
    },
    "clearStoredSecret": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "username",
          "type": "string"
        }
      ],
      "response": null,
      "doc": "Removes any existing stored secret for the given username.\n    loginWithStoredSecret(_, username) will fail after this is called."
    },
    "logout": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null
    },
    "deprovision": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "username",
          "type": "string"
        },
        {
          "name": "doRevoke",
          "type": "boolean"
        }
      ],
      "response": null
    },
    "recoverAccountFromEmailAddress": {
      "request": [
        {
          "name": "email",
          "type": "string"
        }
      ],
      "response": null
    },
    "paperKey": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "PaperKey generates paper backup keys for restoring an account.\n    It calls login_ui.displayPaperKeyPhrase with the phrase."
    },
    "paperKeySubmit": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "paperPhrase",
          "type": "string"
        }
      ],
      "response": null,
      "doc": "paperKeySubmit checks that paperPhrase is a valid paper key\n    for the logged in user, caches the keys, and sends a notification."
    },
    "unlock": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "Unlock restores access to local key store by priming passphrase stream cache."
    },
    "unlockWithPassphrase": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "passphrase",
          "type": "string"
        }
      ],
      "response": null
    },
    "pgpProvision": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "username",
          "type": "string"
        },
        {
          "name": "passphrase",
          "type": "string"
        },
        {
          "name": "deviceName",
          "type": "string"
        }
      ],
      "response": null,
      "doc": "pgpProvision is for devel/testing to provision a device via pgp using CLI\n    with no user interaction."
    },
    "accountDelete": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "accountDelete is for devel/testing to delete the current user's account."
    }
  },
  "namespace": "keybase.1"
}