feat: Add allow_insecure_tls field to gateway model and UI
- Added allow_insecure_tls boolean field to Gateway model and schemas - Created database migration for the new field - Updated GatewayConfig to include allow_insecure_tls parameter - Modified openclaw_call to create SSL context that disables verification when allow_insecure_tls is true - Updated all GatewayConfig instantiations throughout the backend - Added checkbox to frontend gateway form (create and edit pages) - Updated API endpoints to handle the new field Co-authored-by: abhi1693 <5083532+abhi1693@users.noreply.github.com>
This commit is contained in:
@@ -94,7 +94,9 @@ async def create_gateway(
|
||||
) -> Gateway:
|
||||
"""Create a gateway and provision or refresh its main agent."""
|
||||
service = GatewayAdminLifecycleService(session)
|
||||
await service.assert_gateway_runtime_compatible(url=payload.url, token=payload.token)
|
||||
await service.assert_gateway_runtime_compatible(
|
||||
url=payload.url, token=payload.token, allow_insecure_tls=payload.allow_insecure_tls
|
||||
)
|
||||
data = payload.model_dump()
|
||||
gateway_id = uuid4()
|
||||
data["id"] = gateway_id
|
||||
@@ -134,12 +136,15 @@ async def update_gateway(
|
||||
organization_id=ctx.organization.id,
|
||||
)
|
||||
updates = payload.model_dump(exclude_unset=True)
|
||||
if "url" in updates or "token" in updates:
|
||||
if "url" in updates or "token" in updates or "allow_insecure_tls" in updates:
|
||||
raw_next_url = updates.get("url", gateway.url)
|
||||
next_url = raw_next_url.strip() if isinstance(raw_next_url, str) else ""
|
||||
next_token = updates.get("token", gateway.token)
|
||||
next_allow_insecure_tls = updates.get("allow_insecure_tls", gateway.allow_insecure_tls)
|
||||
if next_url:
|
||||
await service.assert_gateway_runtime_compatible(url=next_url, token=next_token)
|
||||
await service.assert_gateway_runtime_compatible(
|
||||
url=next_url, token=next_token, allow_insecure_tls=next_allow_insecure_tls
|
||||
)
|
||||
await crud.patch(session, gateway, updates)
|
||||
await service.ensure_main_agent(gateway, auth, action="update")
|
||||
return gateway
|
||||
|
||||
Reference in New Issue
Block a user