-
Notifications
You must be signed in to change notification settings - Fork 2
feat(proxy): add ProxySettings model and Requests-compatible proxies mapping #103
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
Conversation
…mapping
- Introduces typed ProxySettings with fields: address, port (optional), username (optional), password (optional)
- Adds to_proxies() that returns {"http": "...", "https": "..."} usable by requests
- Ensures clean output when port is omitted (no trailing colon)
- Adds parameterized pytest coverage for typical usage
- Updates docs (Proxy configuration) and changelog
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.
Pull Request Overview
This PR introduces a new ProxySettings model to support HTTP proxy configuration in the HTTP client. The implementation provides a typed data model with fields for address, port, username, and password, along with a method to generate Requests-compatible proxy dictionaries.
- Adds
ProxySettingsclass with typed fields and URL encoding support - Integrates proxy settings into
HttpClientConfiguration - Provides comprehensive test coverage for various proxy configuration scenarios
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
apimatic_core/http/configurations/proxy_settings.py |
New ProxySettings model with address sanitization and Requests-compatible output |
apimatic_core/http/configurations/http_client_configuration.py |
Integration of proxy_settings parameter and property |
tests/apimatic_core/configuration/test_proxy_settings.py |
Comprehensive test suite covering URL formatting, encoding, and edge cases |
apimatic_core/http/configurations/__init__.py |
Export of new proxy_settings module |
README.md |
Documentation updates for HTTP configurations section |
setup.py |
Version bump to 0.2.22 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
asadali214
left a comment
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.
LGTM



What
This PR
Why
To support the data model for proxy settings to be shared via http client configuration
Closes #102
Type of change
Select multiple if applicable.
Dependency Change
If a new dependency is being added, please ensure that it adheres to the following guideline https://github.com/apimatic/apimatic-codegen/wiki/Policy-of-adding-new-dependencies-in-the-core-libraries
Breaking change
If the PR is introducing a breaking change, please ensure that it adheres to the following guideline https://github.com/apimatic/apimatic-codegen/wiki/Guidelines-for-maintaining-core-libraries
Testing
List the steps that were taken to test the changes
Checklist