-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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: allow credentials object #2153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, new user code can pass a CredentialLoader.
What happens if you use the new user code with an old client library? My guess is the user will get a confusing, non actionable message (I may be wrong).
Unfortunately, you're correct... a user would get an error like "Cannot use object Google\Auth\Credentials\ServiceAccountCredentials as array". I don't see this as a blocker for two reasons: 1. we have the options documented for what's accepted, and 2) in the user guide where we're using this feature (configuring Self-Signed JWTs), we explicitly state that they will need to upgrade to |
@bshaffer I was wondering if there's a better way for handling this change, but... maybe the benefit outweighs the negatives. |
@tmatsuo we could certainly use a different option... something like |
what is the last version without this issue? |
Allows for a
Google\Auth\CredentialsLoader
instance to be passed into the constructor ofGoogle\Client
using thecredentials
option, which currently exists but only supports an array or string.This also solves #2142, which provides a way to enable self-signed JWT, but in a more general (and useful) way.