Feat: Added APIBaseURL Auth Parameter #345
Conversation
Signed-off-by: Joshua Nathaniel Haupt <[email protected]>
Summary of ChangesHello @HauptJ, 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 client's ability to connect to Bitbucket instances by allowing users to specify a custom API Base URL directly during client initialization. This change is crucial for supporting specialized Bitbucket deployments, such as Isolated Cloud, which may use unique hostnames. The modifications involve adding new client constructors, updating the internal authentication structure to store the custom URL, and refactoring the HTTP client setup for better isolation and security. The comprehensive test suite has also been refactored to align with these new capabilities and improve overall test reliability. 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
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
|
Signed-off-by: Joshua Nathaniel Haupt <[email protected]>
28204ec to
533f6ca
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to specify a custom API Base URL for the Bitbucket client, crucial for environments like Bitbucket Isolated Cloud, and refines the handling of CA certificates. However, a security issue was identified in how the HTTP transport is configured when custom CA certificates are used, which could lead to proxy bypass and denial-of-service vulnerabilities. The implementation also includes new client constructor functions and a significantly refactored and expanded test suite.
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to specify a custom API Base URL for the Bitbucket client, which is crucial for environments like Bitbucket Isolated Cloud. New client builder functions have been added to support this, along with corresponding updates to the auth struct and injectClient logic. The test suite has been refactored to use new setup functions and environment variables for better consistency and error handling. Overall, the changes enhance the flexibility and robustness of the client. There are a few minor improvements suggested for error messages and test setup logic to prevent potential issues and improve clarity.
Resolves: The http.Transport created here lacks important default settings such as timeouts (DialContext, TLSHandshakeTimeout), idle connection limits, and most importantly, ProxyFromEnvironment. This can lead to the client bypassing system-configured proxies and being vulnerable to denial-of-service attacks if the server is slow or malicious. It is recommended to clone http.DefaultTransport and modify its TLSClientConfig instead of creating a new one from scratch. Signed-off-by: Joshua Nathaniel Haupt <[email protected]>
- Added t.Fatal for critical client build constructor failures in test_setup.go - Cleaned up error messages Signed-off-by: Joshua Nathaniel Haupt <[email protected]>
aadb021 to
61e7162
Compare
Signed-off-by: Joshua Nathaniel Haupt <[email protected]>
|
@ktrysmt this is ready for your review. |
This is to support custom API Base URL hostnames being passed in, as Bitbucket Isolated Cloud will have unique API hostnames.
Adds the following Client builder functions that take in the API Base URL as a string variable.
Resolves:
#346