v1.0.19: make env vars should always overrides api keys stored in the streamlit mount in skyvern image (#4824)
This commit is contained in:
@@ -33,12 +33,24 @@ class DiagnosticsResult(NamedTuple):
|
||||
def _is_local_request(request: Request) -> bool:
|
||||
host = request.client.host if request.client else None
|
||||
if not host:
|
||||
LOG.warning("No client host found in request", client=request.client)
|
||||
return False
|
||||
try:
|
||||
addr = ipaddress.ip_address(host)
|
||||
except ValueError:
|
||||
LOG.warning("Invalid IP address in request", host=host)
|
||||
return False
|
||||
return addr.is_loopback or addr.is_private
|
||||
# Check if request is from Docker host (gateway IP)
|
||||
# Docker typically uses 172.x.x.x or 192.168.x.x for bridge networks
|
||||
is_local = addr.is_loopback or addr.is_private
|
||||
LOG.info(
|
||||
"Checking if request is local",
|
||||
host=host,
|
||||
is_loopback=addr.is_loopback,
|
||||
is_private=addr.is_private,
|
||||
is_local=is_local,
|
||||
)
|
||||
return is_local
|
||||
|
||||
|
||||
def _require_local_access(request: Request) -> None:
|
||||
|
||||
Reference in New Issue
Block a user