Summary
LibsRegLibraryProvider hardcodes TrustEnv = True when creating the aiohttp.ClientSession for periodic library pulls. This value should be configurable via the [general] config section.
Problem
In asab/library/providers/libsreg.py, the HTTP client used to download library archives always trusts environment variables for proxy/SSL settings:
# TODO: Read this for `[general]` config
self.TrustEnv = True
Used later as:
async with aiohttp.ClientSession(connector=connector, trust_env=self.TrustEnv) as session:
async with session.get(url, headers=headers) as response:
...
When trust_env=True, aiohttp reads proxy settings from environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY, etc.). This is useful in corporate/restricted networks, but it cannot be disabled or overridden without code changes.
Expected behavior
TrustEnv should be read from configuration, following the same pattern as other global settings in [general] (e.g. tick_period, pidfile).
Suggested config:
- Default: true (preserve current behavior)
- When false: aiohttp ignores proxy-related environment variables
Proposed implementation
-
Add trust_env to [general] defaults in asab/config.py (default: true)
-
Read the value in LibsRegLibraryProvider.init():
self.TrustEnv = asab.Config.getboolean("general", "trust_env", fallback=True)
-
Document the option in docs/reference/services/library.md (libsreg section)
-
Add to etc/sample.conf (optional, commented)
Summary
LibsRegLibraryProviderhardcodesTrustEnv = Truewhen creating theaiohttp.ClientSessionfor periodic library pulls. This value should be configurable via the[general]config section.Problem
In
asab/library/providers/libsreg.py, the HTTP client used to download library archives always trusts environment variables for proxy/SSL settings:Used later as:
When
trust_env=True, aiohttp reads proxy settings from environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY, etc.). This is useful in corporate/restricted networks, but it cannot be disabled or overridden without code changes.Expected behavior
TrustEnvshould be read from configuration, following the same pattern as other global settings in[general](e.g. tick_period, pidfile).Suggested config:
Proposed implementation
Add trust_env to [general] defaults in asab/config.py (default: true)
Read the value in LibsRegLibraryProvider.init():
Document the option in docs/reference/services/library.md (libsreg section)
Add to etc/sample.conf (optional, commented)