GoogleAuth
type should be generic GoogleAuth<T extends AuthClient>
#3357
Labels
api: sqladmin
Issues related to the Cloud SQL Admin API API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I am trying to instantiate a
Sqladmin
class by passing a customGoogleAuth
object, which was in turn instantiated by passing a customAuthClient
object.However, I get a TypeScript error shown below, which is due to the fact that
Sqladmin
class expectsauth: GoogleAuth
, which is defaulted toGoogleAuth<JSONClient>
, whereJSONClient = JWT | UserRefreshClient | BaseExternalAccountClient | ExternalAccountAuthorizedUserClient | Impersonated;
I believe that
Sqladmin
class should be parameterized withT extends AuthClient
, and then it should acceptGoogleAuth<T>
in theauth
property.Code
TypeScript Error
Type Definitions
Sqladmin:
google-api-nodejs-client/src/apis/sqladmin/v1beta4.ts
Line 54 in 2611705
GoogleAuth:
https://github.com/googleapis/google-auth-library-nodejs/blob/7030314c55c369acbda1873f649579b395ad07c8/src/auth/googleauth.ts#L85
The text was updated successfully, but these errors were encountered: