Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
a0fb309
Added autogenerated async client
IgorChvyrov-sm Aug 5, 2025
f53be3f
Added base model adapters
IgorChvyrov-sm Aug 5, 2025
6f77bbb
Updated ruff rules to ignore autogenerated code
IgorChvyrov-sm Aug 5, 2025
81e9fa3
Added base api client adapters
IgorChvyrov-sm Aug 5, 2025
9d6c8a9
Fix imports
IgorChvyrov-sm Aug 5, 2025
883829d
Regenerated api clients to remove /api/
IgorChvyrov-sm Aug 5, 2025
b1a5ef3
Refactor imports
IgorChvyrov-sm Aug 5, 2025
491199b
Implemented Orkes clients
IgorChvyrov-sm Aug 6, 2025
48edf01
Refactoring: run ruff linter
IgorChvyrov-sm Aug 6, 2025
fb2ac48
Added Configuration adapter
IgorChvyrov-sm Aug 6, 2025
6bbe71f
Refactoring: replaced generated Config with adapter
IgorChvyrov-sm Aug 6, 2025
eaaafbe
Refactoring: code cleanup
IgorChvyrov-sm Aug 6, 2025
bf62283
Revert accidental changes in sync client
IgorChvyrov-sm Aug 6, 2025
13bf3f8
Refactoring: replaced API with APIAdapters in OrkesBaseClient
IgorChvyrov-sm Aug 7, 2025
bfd410a
Added async scheduler, schema, secret, task and workflow clients tests
IgorChvyrov-sm Aug 7, 2025
15a3a24
Added async authorization, integration, metadata, prompt clients test…
IgorChvyrov-sm Aug 7, 2025
4c57b88
Models refactoring pt.1
IgorChvyrov-sm Aug 8, 2025
a4f3124
Models refactoring pt.2
IgorChvyrov-sm Aug 8, 2025
eb7c58c
Models refactoring pt.3
IgorChvyrov-sm Aug 9, 2025
17a5520
Models refactoring pt.4
IgorChvyrov-sm Aug 10, 2025
7ff26b3
Models refactoring pt.5
IgorChvyrov-sm Aug 10, 2025
4d5ee40
Make pydatic test package blank
IgorChvyrov-sm Aug 10, 2025
07e0a81
Implementing test suite for Pydantic model adapters pt.1
IgorChvyrov-sm Aug 10, 2025
cd1a8c7
Models tests
IgorChvyrov-sm Aug 10, 2025
cb9fc88
Config refactoring
IgorChvyrov-sm Aug 11, 2025
29e63e3
Revert "Config refactoring"
IgorChvyrov-sm Aug 11, 2025
dfaa8fc
Refactor: move AuthenticationSettings MetricsSettings to shared
IgorChvyrov-sm Aug 11, 2025
ddeb1b6
Added telemetry client
IgorChvyrov-sm Aug 12, 2025
25cd24c
Added event client
IgorChvyrov-sm Aug 12, 2025
4d4fdd3
Added worflow client
IgorChvyrov-sm Aug 12, 2025
ccef7b0
Added ai automator worker clients
IgorChvyrov-sm Aug 12, 2025
07b19d0
Refactor: imports
IgorChvyrov-sm Aug 12, 2025
df95dd9
Refactor: ruff fixes
IgorChvyrov-sm Aug 12, 2025
5edc05c
Refactor: linting and formatting
IgorChvyrov-sm Aug 12, 2025
8411762
Refactor: imports
IgorChvyrov-sm Aug 12, 2025
fd825b4
Merge branch 'feature_async_client' into feature_async_client_pt2
IgorChvyrov-sm Aug 12, 2025
2e346e1
Tests: automator, kafka_publish input
IgorChvyrov-sm Aug 12, 2025
b280138
Test: add event client test
IgorChvyrov-sm Aug 12, 2025
8751122
Test: add ai orchestrator test
IgorChvyrov-sm Aug 12, 2025
7d13871
Test: add workflow tests
IgorChvyrov-sm Aug 12, 2025
91b8a10
Test: metrics collector test
IgorChvyrov-sm Aug 12, 2025
46e2153
Test: event and worker tests
IgorChvyrov-sm Aug 12, 2025
a6775bb
Fix imports
IgorChvyrov-sm Aug 13, 2025
ebde4df
Fix tests
IgorChvyrov-sm Aug 13, 2025
81abca1
Fixed dynamic workflow example (resource api manual change)
IgorChvyrov-sm Aug 14, 2025
bdc65fb
Fixing circular imports pt.1
IgorChvyrov-sm Aug 14, 2025
81ac744
Fixing circular imports pt.2
IgorChvyrov-sm Aug 14, 2025
6d1d34e
Fixing circular imports pt.3
IgorChvyrov-sm Aug 14, 2025
e1e8c5d
Refactor: Update Orkes clients to take api_client as argument
IgorChvyrov-sm Aug 14, 2025
a943651
Refactor: resolving annotations
IgorChvyrov-sm Aug 15, 2025
bf63b20
Refactor: orkes clients
IgorChvyrov-sm Aug 15, 2025
18d7d96
Async helloworld example
IgorChvyrov-sm Aug 17, 2025
c8090a7
Async workflow examples
IgorChvyrov-sm Aug 18, 2025
40c306e
Added orkes examples
IgorChvyrov-sm Aug 18, 2025
3e9be6a
Added fixes and missed orkes examples
IgorChvyrov-sm Aug 18, 2025
8be7a34
Added missed from prev commit
IgorChvyrov-sm Aug 18, 2025
a210d3b
Introduced ApiClientAdapter
IgorChvyrov-sm Aug 19, 2025
f58956a
Revert manual api client changes and moved it to adapter
IgorChvyrov-sm Aug 19, 2025
d62e8c6
Added JWT obtaining logic
IgorChvyrov-sm Aug 19, 2025
b975f6c
Fixed tests and ruff linter errors
IgorChvyrov-sm Aug 19, 2025
4673c34
Added adapters/ package to client/
IgorChvyrov-sm Aug 21, 2025
d0ea461
Added missing endpoints
IgorChvyrov-sm Aug 22, 2025
1648c81
Added api client adapters
IgorChvyrov-sm Aug 22, 2025
4960884
Api clients refactoring
IgorChvyrov-sm Aug 22, 2025
5441875
Added missing tags api
IgorChvyrov-sm Aug 22, 2025
430b70f
Updating swagger-codegen models pt.1
IgorChvyrov-sm Aug 25, 2025
680ba4f
Merge remote-tracking branch 'origin/refactoring_separate_generated_c…
IgorChvyrov-sm Aug 25, 2025
440def9
Updating swagger-codegen models pt.2
IgorChvyrov-sm Aug 25, 2025
208a82d
Serdeser tests refactoring
IgorChvyrov-sm Aug 25, 2025
924aafe
bacward compatibility and unit tests
IgorChvyrov-sm Aug 25, 2025
7537545
Fixed imports
IgorChvyrov-sm Aug 26, 2025
ea91692
Added integrations tests
IgorChvyrov-sm Aug 27, 2025
2efd703
Updated workflow integration test to make long running workflow
IgorChvyrov-sm Aug 27, 2025
11e7fb9
Added pytest markers for orkes
IgorChvyrov-sm Aug 27, 2025
0f0c658
Added conductor oss marker
IgorChvyrov-sm Aug 27, 2025
6f00cef
Test fixes
IgorChvyrov-sm Aug 28, 2025
caad2d5
Merge branch 'main' into refactoring_separate_generated_code
IgorChvyrov-sm Aug 28, 2025
e55f62d
Added integration tests as a CI step
IgorChvyrov-sm Aug 28, 2025
e3939dd
Fix coverage ignore
IgorChvyrov-sm Aug 28, 2025
d5d8ded
Update READMEs
IgorChvyrov-sm Aug 28, 2025
b36e33b
Refactor ci
IgorChvyrov-sm Aug 28, 2025
c58737a
Added proxy package to achive backward comaptibility
IgorChvyrov-sm Aug 29, 2025
494ca43
Fix imports in backward compatibility tests
IgorChvyrov-sm Sep 1, 2025
e140b8c
Code refactoring
IgorChvyrov-sm Sep 1, 2025
8155c90
Schedule model refactoring
IgorChvyrov-sm Sep 1, 2025
c8512f1
Ruff linter fixes
IgorChvyrov-sm Sep 1, 2025
28c8422
Refactored existing logging
IgorChvyrov-sm Sep 3, 2025
a78ffbf
HTTP layer debug logging
IgorChvyrov-sm Sep 4, 2025
28ab0bb
Removed MetricsProvider pid in log statement
IgorChvyrov-sm Sep 4, 2025
0e0ff91
Prevent extra loggger config call
IgorChvyrov-sm Sep 4, 2025
3112dbb
Updated sync examples with logging and added logger config definition…
IgorChvyrov-sm Sep 4, 2025
2ff6139
Added logger to sync ApiClient
IgorChvyrov-sm Sep 4, 2025
1ce1beb
Remove traceback from log message task_runner and worker
IgorChvyrov-sm Sep 4, 2025
978fc02
Standardize log statements in sdk codebase
IgorChvyrov-sm Sep 4, 2025
578b33b
Removed todo
IgorChvyrov-sm Sep 5, 2025
bdf546f
Formatting
IgorChvyrov-sm Sep 5, 2025
679b6f9
Added tests grouping
IgorChvyrov-sm Sep 5, 2025
cbc28f7
Fix task polling and test sleep mock
IgorChvyrov-sm Sep 6, 2025
fc946ab
Added httpx dependency
IgorChvyrov-sm Sep 8, 2025
99626eb
Added rest and api_client adapter with httpx implementation
IgorChvyrov-sm Sep 8, 2025
a148edd
Added proxy configuration
IgorChvyrov-sm Sep 10, 2025
4c3f329
Updated config to take proxy configuration from env vars
IgorChvyrov-sm Sep 10, 2025
fbe45a0
Updated README.md to include proxy information
IgorChvyrov-sm Sep 10, 2025
e1e198d
Added mds with client regeneration guide
IgorChvyrov-sm Sep 11, 2025
00c275e
Added examples with proxy configuration
IgorChvyrov-sm Sep 12, 2025
840743f
Linting
IgorChvyrov-sm Sep 12, 2025
00f2b33
Added rest adapter tests
IgorChvyrov-sm Sep 16, 2025
7ec312a
Added rest adapter and configuration tests
IgorChvyrov-sm Sep 16, 2025
11be9bd
Merge branch 'feature_enable_http2' into feature_proxy_configuration
IgorChvyrov-sm Sep 16, 2025
b05e395
Refactoring improve sdk logging (#328)
IgorChvyrov-sm Sep 17, 2025
2e75bcc
Merge branch 'refactoring_separate_generated_code' into feature_proxy…
IgorChvyrov-sm Sep 17, 2025
0385694
Fix unit tests
IgorChvyrov-sm Sep 17, 2025
ce93a72
Merge branch 'main' into feature_proxy_configuration
IgorChvyrov-sm Oct 3, 2025
85ae98c
Poetry fix
IgorChvyrov-sm Oct 3, 2025
9f5def8
Fixed merge issues
IgorChvyrov-sm Oct 3, 2025
b6010a6
Added missing dependencies to pyproject toml
IgorChvyrov-sm Oct 3, 2025
39eb0a0
Added missing httpx import
IgorChvyrov-sm Oct 3, 2025
f0352f9
Added configuration tests
IgorChvyrov-sm Oct 3, 2025
d2572dc
Added testcov for CONDUCTOR_PROXY configuration env var
IgorChvyrov-sm Oct 7, 2025
98a39d9
Add ssl options to sync configuration and client (#333)
IgorChvyrov-sm Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
977 changes: 101 additions & 876 deletions README.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions docs/configuration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Configuration

This section covers various configuration options for the Conductor Python SDK.

## Table of Contents

- [Basic Configuration](../../README.md#configuration) - Basic configuration setup
- [SSL/TLS Configuration](ssl-tls.md) - Secure connections and certificates
- [Proxy Configuration](proxy.md) - Network proxy setup

## Overview

The Conductor Python SDK provides flexible configuration options to work with different environments and security requirements. Configuration can be done through:

1. **Code Configuration** - Direct configuration in your application code
2. **Environment Variables** - Configuration through environment variables
3. **Configuration Files** - External configuration files (future enhancement)

## Quick Start

```python
from conductor.client.configuration.configuration import Configuration

# Basic configuration
config = Configuration()

# Custom server URL
config = Configuration(server_api_url="https://your-server.com/api")

# With authentication
from conductor.shared.configuration.settings.authentication_settings import AuthenticationSettings
config = Configuration(
server_api_url="https://your-server.com/api",
authentication_settings=AuthenticationSettings(
key_id="your_key",
key_secret="your_secret"
)
)
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `CONDUCTOR_SERVER_URL` | Conductor server API URL | `http://localhost:8080/api` |
| `CONDUCTOR_AUTH_KEY` | Authentication key | None |
| `CONDUCTOR_AUTH_SECRET` | Authentication secret | None |
| `CONDUCTOR_PROXY` | Proxy URL | None |
| `CONDUCTOR_PROXY_HEADERS` | Proxy headers (JSON) | None |
| `CONDUCTOR_SSL_CA_CERT` | CA certificate path | None |
| `CONDUCTOR_CERT_FILE` | Client certificate path | None |
| `CONDUCTOR_KEY_FILE` | Client private key path | None |

## Configuration Examples

### Local Development

```python
config = Configuration() # Uses http://localhost:8080/api
```

### Production with Authentication

```python
config = Configuration(
server_api_url="https://your-cluster.orkesconductor.io/api",
authentication_settings=AuthenticationSettings(
key_id="your_key",
key_secret="your_secret"
)
)
```

### With Proxy

```python
config = Configuration(
server_api_url="https://your-server.com/api",
proxy="http://proxy.company.com:8080"
)
```

### With SSL/TLS

```python
config = Configuration(
server_api_url="https://your-server.com/api",
ssl_ca_cert="/path/to/ca-cert.pem",
cert_file="/path/to/client-cert.pem",
key_file="/path/to/client-key.pem"
)
```

## Advanced Configuration

For more detailed configuration options, see:

- [SSL/TLS Configuration](ssl-tls.md) - Complete SSL/TLS setup guide
- [Proxy Configuration](proxy.md) - Network proxy configuration guide
288 changes: 288 additions & 0 deletions docs/configuration/proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
# Proxy Configuration

The Conductor Python SDK supports proxy configuration for both synchronous and asynchronous clients. This is useful when your application needs to route traffic through corporate firewalls, load balancers, or other network intermediaries.

## Table of Contents

- [Supported Proxy Types](#supported-proxy-types)
- [Client Proxy Configuration](#client-proxy-configuration)
- [Environment Variable Configuration](#environment-variable-configuration)
- [Advanced Proxy Configuration](#advanced-proxy-configuration)
- [Troubleshooting](#troubleshooting)

## Supported Proxy Types

- **HTTP Proxy**: `http://proxy.example.com:8080`
- **HTTPS Proxy**: `https://proxy.example.com:8443`
- **SOCKS4 Proxy**: `socks4://proxy.example.com:1080`
- **SOCKS5 Proxy**: `socks5://proxy.example.com:1080`
- **Proxy with Authentication**: `http://username:password@proxy.example.com:8080`

> [!NOTE]
> For SOCKS proxy support, install the additional dependency: `pip install httpx[socks]`

## Client Proxy Configuration

### Basic HTTP Proxy Configuration

```python
from conductor.client.configuration.configuration import Configuration
from conductor.shared.configuration.settings.authentication_settings import AuthenticationSettings

# Basic HTTP proxy configuration
config = Configuration(
server_api_url="https://api.orkes.io/api",
authentication_settings=AuthenticationSettings(
key_id="your_key_id",
key_secret="your_key_secret"
),
proxy="http://proxy.company.com:8080"
)
```

### HTTPS Proxy with Authentication Headers

```python
# HTTPS proxy with authentication headers
config = Configuration(
server_api_url="https://api.orkes.io/api",
authentication_settings=AuthenticationSettings(
key_id="your_key_id",
key_secret="your_key_secret"
),
proxy="https://secure-proxy.company.com:8443",
proxy_headers={
"Proxy-Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
"X-Proxy-Client": "conductor-python-sdk"
}
)
```

### SOCKS Proxy Configuration

```python
# SOCKS5 proxy configuration
config = Configuration(
server_api_url="https://api.orkes.io/api",
proxy="socks5://proxy.company.com:1080"
)

# SOCKS5 proxy with authentication
config = Configuration(
server_api_url="https://api.orkes.io/api",
proxy="socks5://username:password@proxy.company.com:1080"
)
```

## Environment Variable Configuration

You can configure proxy settings using Conductor-specific environment variables:

```shell
# Basic proxy configuration
export CONDUCTOR_PROXY=http://proxy.company.com:8080

# Proxy with authentication headers (JSON format)
export CONDUCTOR_PROXY_HEADERS='{"Proxy-Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", "X-Proxy-Client": "conductor-python-sdk"}'

# Or single header value
export CONDUCTOR_PROXY_HEADERS="Basic dXNlcm5hbWU6cGFzc3dvcmQ="
```

**Priority Order:**
1. Explicit proxy parameters in Configuration constructor
2. `CONDUCTOR_PROXY` and `CONDUCTOR_PROXY_HEADERS` environment variables

### Example Usage with Environment Variables

```python
# Set environment variables
import os
os.environ['CONDUCTOR_PROXY'] = 'http://proxy.company.com:8080'
os.environ['CONDUCTOR_PROXY_HEADERS'] = '{"Proxy-Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ="}'

# Configuration will automatically use proxy from environment
from conductor.client.configuration.configuration import Configuration
config = Configuration(server_api_url="https://api.orkes.io/api")
# Proxy is automatically configured from CONDUCTOR_PROXY environment variable
```

## Advanced Proxy Configuration

### Custom HTTP Client with Proxy

```python
import httpx
from conductor.client.configuration.configuration import Configuration

# Create custom HTTP client with proxy
custom_client = httpx.Client(
proxies={
"http://": "http://proxy.company.com:8080",
"https://": "http://proxy.company.com:8080"
},
timeout=httpx.Timeout(120.0),
follow_redirects=True,
limits=httpx.Limits(max_keepalive_connections=20, max_connections=100),
)

config = Configuration(
server_api_url="https://api.orkes.io/api",
http_connection=custom_client
)
```

### Proxy with Custom Headers

```python
import httpx
from conductor.client.configuration.configuration import Configuration

# Create custom HTTP client with proxy and headers
custom_client = httpx.Client(
proxies={
"http://": "http://proxy.company.com:8080",
"https://": "http://proxy.company.com:8080"
},
headers={
"Proxy-Authorization": "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
"X-Proxy-Client": "conductor-python-sdk",
"User-Agent": "Conductor-Python-SDK/1.0"
}
)

config = Configuration(
server_api_url="https://api.orkes.io/api",
http_connection=custom_client
)
```

### SOCKS Proxy with Authentication

```python
import httpx
from conductor.client.configuration.configuration import Configuration

# SOCKS5 proxy with authentication
custom_client = httpx.Client(
proxies={
"http://": "socks5://username:password@proxy.company.com:1080",
"https://": "socks5://username:password@proxy.company.com:1080"
}
)

config = Configuration(
server_api_url="https://api.orkes.io/api",
http_connection=custom_client
)
```

### Async Client Proxy Configuration

```python
import asyncio
import httpx
from conductor.asyncio_client.configuration import Configuration
from conductor.asyncio_client.adapters import ApiClient

async def main():
# Create async HTTP client with proxy
async_client = httpx.AsyncClient(
proxies={
"http://": "http://proxy.company.com:8080",
"https://": "http://proxy.company.com:8080"
}
)

config = Configuration(
server_url="https://api.orkes.io/api",
http_connection=async_client
)

async with ApiClient(config) as api_client:
# Use the client with proxy configuration
pass

asyncio.run(main())
```

## Troubleshooting

### Common Proxy Issues

1. **Connection refused**
- Check if the proxy server is running
- Verify the proxy URL and port
- Check firewall settings

2. **Authentication failed**
- Verify username and password
- Check if the proxy requires specific authentication method
- Ensure credentials are properly encoded

3. **SOCKS proxy not working**
- Install httpx with SOCKS support: `pip install httpx[socks]`
- Check if the SOCKS proxy server is accessible
- Verify SOCKS version (4 or 5)

4. **SSL/TLS issues through proxy**
- Some proxies don't support HTTPS properly
- Try using HTTP proxy for HTTPS traffic
- Check proxy server SSL configuration

### Debug Proxy Configuration

```python
import httpx
import logging

# Enable debug logging
logging.basicConfig(level=logging.DEBUG)

# Test proxy connection
def test_proxy_connection(proxy_url):
try:
with httpx.Client(proxies={"http://": proxy_url, "https://": proxy_url}) as client:
response = client.get("http://httpbin.org/ip")
print(f"Proxy test successful: {response.json()}")
except Exception as e:
print(f"Proxy test failed: {e}")

# Test your proxy
test_proxy_connection("http://proxy.company.com:8080")
```

### Proxy Environment Variables

```bash
# Set proxy environment variables for testing
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080
export NO_PROXY=localhost,127.0.0.1

# Test with curl
curl -I https://api.orkes.io/api
```

### Proxy Authentication

```python
import base64
from urllib.parse import quote

# Create proxy authentication header
username = "your_username"
password = "your_password"
credentials = f"{username}:{password}"
encoded_credentials = base64.b64encode(credentials.encode()).decode()

proxy_headers = {
"Proxy-Authorization": f"Basic {encoded_credentials}"
}

config = Configuration(
server_api_url="https://api.orkes.io/api",
proxy="http://proxy.company.com:8080",
proxy_headers=proxy_headers
)
```
Loading