Client
Enhanced client library with connection pooling, retry logic, and circuit breaker
- class auth.client.RetryableHTTPAdapter(retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504), **kwargs)[source]
Bases:
HTTPAdapterHTTP adapter with retry logic
- init_poolmanager(*args, **kwargs)[source]
Initializes a urllib3 PoolManager.
This method should not be called from user code, and is only exposed for use when subclassing the
HTTPAdapter.- Parameters:
connections – The number of urllib3 connection pools to cache.
maxsize – The maximum number of connections to save in the pool.
block – Block when no free connections are available.
pool_kwargs – Extra keyword arguments used to initialize the Pool Manager.
- class auth.client.EnhancedAuthClient(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Bases:
objectEnhanced client with connection pooling, retry logic, and circuit breaker
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled
- __init__(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled
- get_users_for_workflow(workflow_name: str) Dict[str, Any][source]
Get all users who can run a specific workflow
- class auth.client.Client(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Bases:
EnhancedAuthClientLegacy client class for backward compatibility
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled
EnhancedAuthClient
- class auth.client.EnhancedAuthClient(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Bases:
objectEnhanced client with connection pooling, retry logic, and circuit breaker
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled
- __init__(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled
- get_users_for_workflow(workflow_name: str) Dict[str, Any][source]
Get all users who can run a specific workflow
Client (Legacy)
- class auth.client.Client(api_key: str, service_url: str, max_retries: int = 3, pool_connections: int = 10, pool_maxsize: int = 20, timeout: int = 30, circuit_breaker_enabled: bool = True)[source]
Bases:
EnhancedAuthClientLegacy client class for backward compatibility
Initialize the enhanced client
- Parameters:
api_key – The API key for authentication
service_url – The base URL for the auth service
max_retries – Number of times to retry failed requests
pool_connections – Number of connection pools
pool_maxsize – Max connections per pool
timeout – Request timeout in seconds
circuit_breaker_enabled – Whether circuit breaker is enabled