Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Provide Mechanism to Change AuthClient Scopes Uniformly #1681

Open
danielbankhead opened this issue Oct 23, 2023 · 0 comments
Open

feat: Provide Mechanism to Change AuthClient Scopes Uniformly #1681

danielbankhead opened this issue Oct 23, 2023 · 0 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@danielbankhead
Copy link
Contributor

danielbankhead commented Oct 23, 2023

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:

@danielbankhead danielbankhead added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant