fix: allow calls with channels along with api key authentication #527
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to suggest a fix associated with channels usage in API calls.
Since client id and client secret authentication has become legacy, channels are now not unique to the calls made with this method of authentication. The usage of channels without client id is even mentioned in the following lines of code that are part of the current library version:
google-maps-services-python/googlemaps/client.py
Lines 146 to 151 in 645e07d
However, in the method _generate_auth_url the channel parameter is added to the authentication URL only if client id and secret were provided. Thus it is currently impossible to apply channels to calls authenticated with just API key using this library, they are simply not part of the final authentication URL as long as client id and secret weren't provided:
google-maps-services-python/googlemaps/client.py
Lines 393 to 396 in 645e07d