Skip to content

Conversation

@sufyankhanrao
Copy link
Collaborator

What

This PR

  • 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)

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

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

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

…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
@sufyankhanrao sufyankhanrao self-assigned this Aug 19, 2025
@sufyankhanrao sufyankhanrao added the enhancement New feature or request label Aug 19, 2025
Copy link

Copilot AI left a 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 ProxySettings class 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.

@sonarqubecloud
Copy link

Copy link
Contributor

@asadali214 asadali214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sufyankhanrao sufyankhanrao merged commit 9b4407e into main Sep 1, 2025
10 checks passed
@sufyankhanrao sufyankhanrao deleted the 102-add-proxy-configuration branch September 1, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add proxy support via a typed ProxySettings data model

3 participants