google-auth-library-nodejs
google-auth-library-nodejs copied to clipboard
feat: Provide Mechanism to Change AuthClient Scopes Uniformly
Today, we don't have a clean way to change AuthClient scopes uniformly between instances, and different AuthClients offer varying functionality like this:
https://github.com/googleapis/google-auth-library-nodejs/blob/6c0a6bdc156c1098b09e85e82cabadaa73e7367f/src/auth/jwtclient.ts#L100-L115
We should offer a uniform API for changing scopes for all AuthClients. Additionally, once this is implemented GoogleAuth#scopes
should update its cachedCredentials
's scopes (perhaps via a simple getter/setter hook on GoogleAuth
itself).
Dependencies:
- https://github.com/googleapis/google-auth-library-nodejs/pull/1663
- https://github.com/googleapis/google-auth-library-nodejs/issues/1676