async createApiKey(request) {
    const expiresIn = request.input.args.expiresIn || -1;
    const refresh = request.getRefresh("wait_for");
    const userId = request.getString("userId");
    const apiKeyId = request.getId({ ifMissing: "generate" });
    const description = request.getBodyString("description");

    const user = await this.ask("core:security:user:get", userId);
    const creatorId = request.getKuid();

    const apiKey = await ApiKey.create(user, expiresIn, description, {
      apiKeyId,
      bypassMaxTTL: true,
      creatorId,
      refresh,
    });

    global.kuzzle.log.info(
      `[SECURITY] ${SecurityController.userOrSdk(creatorId)} applied action "${
        request.input.action
      }" on user "${userId}."`,
    );
    return apiKey.serialize({ includeToken: true });
  }
Creates a new API key for a user