Skip to content

refactor: support multiple API URLs per provider to allow flexible proxy routing and configuration#337

Merged
manojbajaj95 merged 3 commits into
mainfrom
feature/api-url-list-support
May 27, 2026
Merged

refactor: support multiple API URLs per provider to allow flexible proxy routing and configuration#337
manojbajaj95 merged 3 commits into
mainfrom
feature/api-url-list-support

Conversation

@ankitranjan7
Copy link
Copy Markdown
Collaborator

Description

Allow provider api_url to be configured as either a single string or a list of strings, and update proxy routing plus adjacent provider-handling code to support multiple host matches per provider.

Motivation and Context

Some providers are authenticated across more than one host, but authsome currently models api_url as a single value. That makes proxy host matching too narrow for providers like GitHub.

This change lets a provider declare multiple API hosts without forcing everything into one regex or one overly broad match.

How Has This Been Tested?

Tested with:

  • uv run ruff check src/ tests/
  • uv run ty check src/
  • uv run pytest

Types of changes

  • 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 existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@ankitranjan7 ankitranjan7 changed the title Feature/api url list support refactor: support multiple API URLs per provider to allow flexible proxy routing and configuration May 26, 2026
@ankitranjan7 ankitranjan7 requested review from beubax and manojbajaj95 and removed request for manojbajaj95 May 26, 2026 09:01
return (self.api_url,)
return tuple(url for url in self.api_url if isinstance(url, str) and url.strip())

def primary_api_url(self) -> str | None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is prmary for?

manojbajaj95
manojbajaj95 previously approved these changes May 27, 2026
@ankitranjan7 ankitranjan7 dismissed manojbajaj95’s stale review May 27, 2026 07:14

The merge-base changed after approval.

@manojbajaj95 manojbajaj95 merged commit 394c7a8 into main May 27, 2026
4 checks passed
@manojbajaj95 manojbajaj95 deleted the feature/api-url-list-support branch May 27, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants