From 79cfbbfc8ae7413d1d1c1f5e5f3fddc7258b4471 Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Sun, 7 Dec 2025 02:34:05 +0530 Subject: [PATCH] SimpleSallap:SimpleMCP:Allow auth check to be bypassed, if needed By default bearer based auth check is done always whether in https or http mode. However by updating the sec.bAuthAlways config entry to false, the bearer auth check will be carried out only in https mode. --- tools/server/public_simplechat/local.tools/config.py | 1 + tools/server/public_simplechat/local.tools/simplemcp.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/server/public_simplechat/local.tools/config.py b/tools/server/public_simplechat/local.tools/config.py index 1979db015a..74fcb2c9ef 100644 --- a/tools/server/public_simplechat/local.tools/config.py +++ b/tools/server/public_simplechat/local.tools/config.py @@ -43,6 +43,7 @@ class Sec(DictyDataclassMixin): certFile: str = "" keyFile: str = "" bearerAuth: str = "" + bAuthAlways: bool = True @dataclass diff --git a/tools/server/public_simplechat/local.tools/simplemcp.py b/tools/server/public_simplechat/local.tools/simplemcp.py index c2c167dba0..6375a96a9d 100644 --- a/tools/server/public_simplechat/local.tools/simplemcp.py +++ b/tools/server/public_simplechat/local.tools/simplemcp.py @@ -137,9 +137,10 @@ class ProxyHandler(http.server.BaseHTTPRequestHandler): """ print(f"DBUG:PH:Post:{self.address_string()}:{self.path}") print(f"DBUG:PH:Post:Headers:{self.headers}") - acGot = self.auth_check() - if not acGot.callOk: - self.send_error(acGot.statusCode, acGot.statusMsg) + if gMe.op.sslContext or gMe.sec.bAuthAlways: + acGot = self.auth_check() + if not acGot.callOk: + self.send_error(acGot.statusCode, acGot.statusMsg) pr = urllib.parse.urlparse(self.path) print(f"DBUG:PH:Post:{pr}") if pr.path != '/mcp':