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.
This commit is contained in:
parent
9d6daaed8c
commit
79cfbbfc8a
|
|
@ -43,6 +43,7 @@ class Sec(DictyDataclassMixin):
|
||||||
certFile: str = ""
|
certFile: str = ""
|
||||||
keyFile: str = ""
|
keyFile: str = ""
|
||||||
bearerAuth: str = ""
|
bearerAuth: str = ""
|
||||||
|
bAuthAlways: bool = True
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,10 @@ class ProxyHandler(http.server.BaseHTTPRequestHandler):
|
||||||
"""
|
"""
|
||||||
print(f"DBUG:PH:Post:{self.address_string()}:{self.path}")
|
print(f"DBUG:PH:Post:{self.address_string()}:{self.path}")
|
||||||
print(f"DBUG:PH:Post:Headers:{self.headers}")
|
print(f"DBUG:PH:Post:Headers:{self.headers}")
|
||||||
acGot = self.auth_check()
|
if gMe.op.sslContext or gMe.sec.bAuthAlways:
|
||||||
if not acGot.callOk:
|
acGot = self.auth_check()
|
||||||
self.send_error(acGot.statusCode, acGot.statusMsg)
|
if not acGot.callOk:
|
||||||
|
self.send_error(acGot.statusCode, acGot.statusMsg)
|
||||||
pr = urllib.parse.urlparse(self.path)
|
pr = urllib.parse.urlparse(self.path)
|
||||||
print(f"DBUG:PH:Post:{pr}")
|
print(f"DBUG:PH:Post:{pr}")
|
||||||
if pr.path != '/mcp':
|
if pr.path != '/mcp':
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue