Skip to content

feat: Provide Mechanism to Change AuthClient Scopes Uniformly #1681

Open
@danielbankhead

Description

@danielbankhead

Today, we don't have a clean way to change AuthClient scopes uniformly between instances, and different AuthClients offer varying functionality like this:

/**
* Creates a copy of the credential with the specified scopes.
* @param scopes List of requested scopes or a single scope.
* @return The cloned instance.
*/
createScoped(scopes?: string | string[]) {
return new JWT({
email: this.email,
keyFile: this.keyFile,
key: this.key,
keyId: this.keyId,
scopes,
subject: this.subject,
additionalClaims: this.additionalClaims,
});
}

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions