google-auth-library-nodejs icon indicating copy to clipboard operation
google-auth-library-nodejs copied to clipboard

feat: Provide Mechanism to Change AuthClient Scopes Uniformly

Open danielbankhead opened this issue 1 year ago • 0 comments

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

danielbankhead avatar Oct 23 '23 20:10 danielbankhead