Files
Hinotobi dd1d235450 fix: harden gateway slash command security (#127)
* fix: harden gateway slash command security

* fix: add secure remote admin opt-in for gateway commands
2026-04-13 16:24:20 +08:00

34 lines
967 B
Python

"""Gateway models for ohmo."""
from __future__ import annotations
from pydantic import BaseModel, Field
class GatewayConfig(BaseModel):
"""Persistent gateway configuration."""
provider_profile: str = "codex"
enabled_channels: list[str] = Field(default_factory=list)
session_routing: str = "chat-thread"
send_progress: bool = True
send_tool_hints: bool = True
permission_mode: str = "default"
sandbox_enabled: bool = False
allow_remote_admin_commands: bool = False
allowed_remote_admin_commands: list[str] = Field(default_factory=list)
log_level: str = "INFO"
channel_configs: dict[str, dict] = Field(default_factory=dict)
class GatewayState(BaseModel):
"""Runtime gateway status snapshot."""
running: bool = False
pid: int | None = None
active_sessions: int = 0
provider_profile: str = "codex"
enabled_channels: list[str] = Field(default_factory=list)
last_error: str | None = None