lablink_client_service.http_utils¶
lablink_client_service.http_utils
¶
Shared HTTP utilities for LabLink client services.
Functions:¶
get_auth_headers(token)
¶
get_client_env(cfg)
¶
Read common client environment variables with config fallback.
Returns:
| Type | Description |
|---|---|
tuple
|
(base_url, client_secret, vm_name) tuple. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If CLIENT_SECRET is not set. |
Source code in packages/client/src/lablink_client_service/http_utils.py
sanitize_url(url)
¶
Sanitize a URL by removing trailing slashes and stray dots.
Handles cases like
- http://.lablink.sleap.ai -> http://lablink.sleap.ai
- https://.lablink.sleap.ai -> https://lablink.sleap.ai
- .lablink.sleap.ai -> lablink.sleap.ai
- http://example.com/ -> http://example.com