Skip to content

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

@danielbankhead

Description

@danielbankhead

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

https://github.com/googleapis/google-auth-library-nodejs/blob/4f94ffe474ee41b560813b81e8d621be848d38d0/src/auth/baseexternalclient.ts#L140-L145

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

https://github.com/googleapis/google-auth-library-nodejs/blob/4f94ffe474ee41b560813b81e8d621be848d38d0/src/auth/computeclient.ts#L51-L55

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
  • It might be worth looking into storing internally as a Set

Metadata

Metadata

Assignees

No one assigned

    Labels

    next major: breaking changethis is a change that we should wait to bundle into the next major versionpriority: p3Desirable enhancement or fix. May not be included in next release.semver: majorHint for users that this is an API breaking change.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