How to use the google-auth-library.DefaultTransporter function in google-auth-library

To help you get started, we’ve selected a few google-auth-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / google-api-nodejs-client / src / shared / src / apirequest.ts View on Github external
// Combine the AxiosRequestConfig options passed with this specific
  // API call witht the global options configured at the API Context
  // level, or at the global level.
  const mergedOptions = Object.assign(
      {}, (parameters.context.google ? parameters.context.google._options : {}),
      parameters.context._options, options);
  delete mergedOptions.auth;  // is overridden by our auth code

  // Perform the HTTP request.  NOTE: this function used to return a
  // mikeal/request object. Since the transition to Axios, the method is
  // now void.  This may be a source of confusion for users upgrading from
  // version 24.0 -> 25.0 or up.
  if (authClient && typeof authClient === 'object') {
    return (authClient as OAuth2Client).request(mergedOptions);
  } else {
    return (new DefaultTransporter()).request(mergedOptions);
  }
}
github googleapis / nodejs-googleapis-common / src / apirequest.ts View on Github external
true,
    {},
    parameters.context.google ? parameters.context.google._options : {},
    parameters.context._options,
    options
  );
  delete mergedOptions.auth; // is overridden by our auth code

  // Perform the HTTP request.  NOTE: this function used to return a
  // mikeal/request object. Since the transition to Axios, the method is
  // now void.  This may be a source of confusion for users upgrading from
  // version 24.0 -> 25.0 or up.
  if (authClient && typeof authClient === 'object') {
    return (authClient as OAuth2Client).request(mergedOptions);
  } else {
    return new DefaultTransporter().request(mergedOptions);
  }
}