Commit 5058726 1 parent 9b69a31 commit 5058726 Copy full SHA for 5058726
File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,26 @@ export abstract class AuthClient
207
207
this . forceRefreshOnFailure = opts . forceRefreshOnFailure ?? false ;
208
208
}
209
209
210
+ /**
211
+ * Return the {@link Gaxios `Gaxios`} instance from the {@link AuthClient.transporter}.
212
+ *
213
+ * @expiremental
214
+ */
215
+ get gaxios ( ) : Gaxios | null {
216
+ if ( this . transporter instanceof Gaxios ) {
217
+ return this . transporter ;
218
+ } else if ( this . transporter instanceof DefaultTransporter ) {
219
+ return this . transporter . instance ;
220
+ } else if (
221
+ 'instance' in this . transporter &&
222
+ this . transporter . instance instanceof Gaxios
223
+ ) {
224
+ return this . transporter . instance ;
225
+ }
226
+
227
+ return null ;
228
+ }
229
+
210
230
/**
211
231
* Provides an alternative Gaxios request implementation with auth credentials
212
232
*/
Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
import { GoogleAuth } from './auth/googleauth' ;
15
15
16
+ // Export common deps to ensure types/instances are the exact match. Useful
17
+ // for consistently configuring the library across versions.
16
18
export * as gcpMetadata from 'gcp-metadata' ;
19
+ export * as gaxios from 'gaxios' ;
17
20
18
21
export { AuthClient , DEFAULT_UNIVERSE } from './auth/authclient' ;
19
22
export { Compute , ComputeOptions } from './auth/computeclient' ;
You can’t perform that action at this time.
0 commit comments