Skip to content

Commit e3d7216

Browse files
committed
add API for outbound to update_service_config.py
1 parent 3162f63 commit e3d7216

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

aikido_zen/background_process/cloud_connection_manager/update_service_config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ def update_service_config(connection_manager, res):
2222
bypassed_ips=res.get("allowedIPAddresses", []),
2323
received_any_stats=res.get("receivedAnyStats", True),
2424
)
25+
26+
# Handle outbound request blocking configuration
27+
if "blockNewOutgoingRequests" in res:
28+
connection_manager.conf.set_block_new_outgoing_requests(
29+
res["blockNewOutgoingRequests"]
30+
)
31+
32+
if "domains" in res:
33+
connection_manager.conf.update_domains(res["domains"])

aikido_zen/background_process/service_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def is_bypassed_ip(self, ip):
8080
def update_domains(self, domains):
8181
self.domains = {domain["hostname"]: domain["mode"] for domain in domains}
8282

83+
def set_block_new_outgoing_requests(self, value: bool):
84+
"""Set whether to block new outgoing requests"""
85+
self.block_new_outgoing_requests = bool(value)
86+
8387
def should_block_outgoing_request(self, hostname: str) -> bool:
8488
mode = self.domains.get(hostname)
8589

0 commit comments

Comments
 (0)