[Fixes #13990] Basic auth is not fully propagated into the WMS Service#13991
[Fixes #13990] Basic auth is not fully propagated into the WMS Service#13991mattiagiupponi wants to merge 5 commits intomasterfrom
Conversation
Summary of ChangesHello @mattiagiupponi, 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 fixes an issue where basic authentication was not fully propagated into the WMS service. It replaces direct instantiation of Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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 aims to propagate basic authentication credentials for WMS services. While the changes correctly pass credentials in WmsServiceHandler and _get_service_handler, it introduces a potential Denial of Service (DoS) vulnerability. Unconditionally calling service.get_password() in two locations can lead to a 500 Internal Server Error for services without a configured password, as the underlying model method does not handle None values. Additionally, credentials are not passed in one area of the WMS harvester, which could affect protected services, and there's a minor opportunity to simplify some new cache-clearing logic.
| operations = {} | ||
| try: | ||
| _url, _parsed_service = WebMapService(url, version=version) | ||
| _parsed_service = get_service_handler(url, service_type="WMS") |
There was a problem hiding this comment.
The get_service_handler is called here without authentication credentials. The PR's goal is to propagate basic auth, but this seems to be a place where it's not fully propagated. If the WMS service at url requires basic authentication, this call will fail to retrieve the operations.
To address this, get_wms_operations should be updated to accept username and password and pass them to get_service_handler. This would also require updating the callers of get_wms_operations to provide these credentials if they are available.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
ref #13990
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.