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!: Normalize #scopes args and properties to string[] #1676

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

feat!: Normalize #scopes args and properties to string[] #1676

danielbankhead opened this issue Oct 12, 2023 · 0 comments
Labels
Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@danielbankhead
Copy link
Contributor

danielbankhead commented Oct 12, 2023

Today, some AuthClients have a scopes property with of string | string[]:

/**
* OAuth scopes for the GCP access token to use. When not provided,
* the default https://www.googleapis.com/auth/cloud-platform is
* used.
*/
public scopes?: string | string[];

And we have to normalize in other places like this with code like this:

this.scopes = Array.isArray(options.scopes)
? options.scopes
: options.scopes
? [options.scopes]
: [];

This is pretty inconsistency throughout the library. Additionally, this change will clarify to customers that may be confused as to if a string-typed scopes property will be parsed into multiple scopes are not.

Implementation Notes:

  • Ensure samples are providing the recommended string[] as parameters
@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. semver: major Hint for users that this is an API breaking change. Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version labels Oct 12, 2023
@danielbankhead danielbankhead changed the title feat! feat!: Normalize #scopes args and properties to string[] Oct 12, 2023
@danielbankhead danielbankhead removed their assignment Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. semver: major Hint for users that this is an API breaking change. 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