Adding the posibility to proxy the google route requests#130
Adding the posibility to proxy the google route requests#130TheSayvior wants to merge 3 commits into
Conversation
…-key directly in the code potencially exposing it.
Summary of ChangesHello @TheSayvior, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the PolylinePoints library by integrating proxy support for Google Maps API requests, offering a robust solution for API key security. Additionally, it refines the internal class structure by renaming 'Route' to 'PolylineRoute', thereby preventing common naming collisions in Flutter projects and improving overall API design. These changes provide developers with greater flexibility and security when working with Google Maps routing functionalities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces two valuable changes: the ability to proxy Google route requests to protect API keys, and the renaming of the Route class to PolylineRoute to prevent naming conflicts. The implementation is well-executed and consistent across the library and example app. I've found one issue in an assertion which I've commented on. Once that's addressed, this PR will be a great addition.
| (request.proxy == null && | ||
| googleApiKey != null && | ||
| googleApiKey.isNotEmpty) || | ||
| (request.proxy != null && googleApiKey == null), |
There was a problem hiding this comment.
The assertion here incorrectly uses request.proxy to check for the presence of a proxy. However, the proxy URI is passed as the proxy parameter to this function. This assertion should use the proxy parameter to be consistent with the logic in getRouteBetweenCoordinatesV2 and the PolylinePoints constructor.
| (request.proxy == null && | |
| googleApiKey != null && | |
| googleApiKey.isNotEmpty) || | |
| (request.proxy != null && googleApiKey == null), | |
| (proxy == null && | |
| googleApiKey != null && | |
| googleApiKey.isNotEmpty) || | |
| (proxy != null && googleApiKey == null), |
Hello, we few changes, if you want them.
Added proxy option as in earlier version, since I have to proxy the request to conceal the API key from anyone getting access to the app source code.
Changed the "Route" class to "PolylineRoute" to avoid import errors with other packages or flutter itself since Route is a commonly used class name
Great package, thanks for the work you do on this.