Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ ENV PDP_HORIZON_HOST=0.0.0.0
ENV PDP_HORIZON_PORT=7001
ENV PDP_PORT=7000
ENV PDP_PYTHON_PATH=python3
ENV NO_PROXY=localhost,127.0.0.1,::1

# 7000 pdp port
# 7001 horizon port
Expand Down
2 changes: 1 addition & 1 deletion horizon/enforcer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ async def post_to_opa(request: Request, path: str, data: dict | None):
_set_use_debugger(data)
try:
logger.debug(f"calling OPA at '{url}' with input: {data}")
async with aiohttp.ClientSession() as session: # noqa: SIM117
async with aiohttp.ClientSession(trust_env=True) as session: # noqa: SIM117
async with session.post(
url,
data=json.dumps(data) if data is not None else None,
Expand Down
1 change: 1 addition & 0 deletions horizon/facts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def client(self) -> AsyncClient:
self._client = AsyncClient(
base_url=sidecar_config.CONTROL_PLANE,
headers={"Authorization": f"Bearer {env_api_key}"},
trust_env=True,
)
return self._client

Expand Down
4 changes: 3 additions & 1 deletion horizon/proxy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ async def proxy_request_to_cloud_service(

logger.info(f"Proxying request: {request.method} {path}")

async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(
trust_env=True,
) as session:
if request.method == HTTP_GET:
async with session.get(path, headers=headers, params=params) as backend_response:
return await proxy_response(backend_response)
Expand Down
4 changes: 3 additions & 1 deletion horizon/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ async def _report(self, state: PersistentState | None = None):
if state is not None:
self._state = state.copy()
config_url = f"{sidecar_config.CONTROL_PLANE}{sidecar_config.REMOTE_STATE_ENDPOINT}"
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(
trust_env=True,
) as session:
logger.info("Reporting status update to server...")
response = await session.post(
url=config_url,
Expand Down
Loading