googleapis / googleapis/google-cloud-node
Support `AuthClient` for `auth`
- 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
Assessment
This issue has not been assessed yet.