googleapis / googleapis/google-cloud-node

Support `AuthClient` for `auth`

Open
#7,770 1 comment 0 reactions 1 assignee Claimed by @sofisl View on GitHub
library: google-cloud-node-core priority: p3 type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

Currently the standard `auth` parameter uses an explicit list of clients that extend [`AuthClient`](https://github.com/googleapis/google-auth-library-nodejs/blob/db27f1bc31efaa9df28da2e0a1229ee3ebea0751/src/auth/authclient.ts):

```
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
```

Src: https://github.com/googleapis/google-api-nodejs-client/blob/main/src/apis/abusiveexperiencereport/v1.ts#L48-L55

In order to support new clients, such as [`DownscopedClient`](https://github.com/googleapis/google-auth-library-nodejs/blob/db27f1bc31efaa9df28da2e0a1229ee3ebea0751/src/auth/downscopedclient.ts#L107), `auth` can be simplified to:
```ts
auth?: string | AuthClient | GoogleAuth;
```

Related:
- https://github.com/googleapis/google-cloud-node-core/issues/779
- https://github.com/googleapis/google-api-nodejs-client/pull/2210

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.