|
|
@ -163,49 +163,54 @@ def InitFastAPI():
|
|
|
|
lL = __Orchestrator__.OrchestratorLoggerGet()
|
|
|
|
lL = __Orchestrator__.OrchestratorLoggerGet()
|
|
|
|
__Orchestrator__.GSettingsGet()["ServerDict"]["ServerThread"] = app
|
|
|
|
__Orchestrator__.GSettingsGet()["ServerDict"]["ServerThread"] = app
|
|
|
|
ServerSettings.SettingsUpdate()
|
|
|
|
ServerSettings.SettingsUpdate()
|
|
|
|
|
|
|
|
BCURLUpdate()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def BCURLUpdate():
|
|
|
|
for lConnectItemDict in __Orchestrator__.GSettingsGet()["ServerDict"]["URLList"]:
|
|
|
|
for lConnectItemDict in __Orchestrator__.GSettingsGet()["ServerDict"]["URLList"]:
|
|
|
|
if "ResponseFolderPath" in lConnectItemDict:
|
|
|
|
if "BCBool" not in lConnectItemDict:
|
|
|
|
app.mount(lConnectItemDict["URL"],
|
|
|
|
if "ResponseFolderPath" in lConnectItemDict:
|
|
|
|
StaticFiles(directory=CrossOS.PathStr(lConnectItemDict["ResponseFolderPath"])),
|
|
|
|
app.mount(lConnectItemDict["URL"],
|
|
|
|
name=lConnectItemDict["URL"].replace('/',"_"))
|
|
|
|
StaticFiles(directory=CrossOS.PathStr(lConnectItemDict["ResponseFolderPath"])),
|
|
|
|
else:
|
|
|
|
name=lConnectItemDict["URL"].replace('/',"_"))
|
|
|
|
if lConnectItemDict.get("MatchType") in ["EqualCase", "Equal","EqualNoParam"]:
|
|
|
|
else:
|
|
|
|
if lConnectItemDict.get("UACBool",True):
|
|
|
|
if lConnectItemDict.get("MatchType") in ["EqualCase", "Equal","EqualNoParam"]:
|
|
|
|
app.add_api_route(
|
|
|
|
if lConnectItemDict.get("UACBool",True):
|
|
|
|
path=lConnectItemDict["URL"],
|
|
|
|
app.add_api_route(
|
|
|
|
endpoint=BackwardCompatibityWrapperAuth,
|
|
|
|
path=lConnectItemDict["URL"],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
endpoint=BackwardCompatibityWrapperAuth,
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
)
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
else:
|
|
|
|
)
|
|
|
|
app.add_api_route(
|
|
|
|
else:
|
|
|
|
path=lConnectItemDict["URL"],
|
|
|
|
app.add_api_route(
|
|
|
|
endpoint=BackwardCompatibityWrapperNoAuth,
|
|
|
|
path=lConnectItemDict["URL"],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
endpoint=BackwardCompatibityWrapperNoAuth,
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
)
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
elif lConnectItemDict.get("MatchType") in ["BeginWith", "Contains"]:
|
|
|
|
)
|
|
|
|
lURLStr = lConnectItemDict["URL"]
|
|
|
|
elif lConnectItemDict.get("MatchType") in ["BeginWith", "Contains"]:
|
|
|
|
if lURLStr[-1]!="/": lURLStr+="/"
|
|
|
|
lURLStr = lConnectItemDict["URL"]
|
|
|
|
lURLStr+="{inBeginTokenStr}"
|
|
|
|
if lURLStr[-1]!="/": lURLStr+="/"
|
|
|
|
if lConnectItemDict.get("UACBool",True):
|
|
|
|
lURLStr+="{inBeginTokenStr}"
|
|
|
|
app.add_api_route(
|
|
|
|
if lConnectItemDict.get("UACBool",True):
|
|
|
|
path=lURLStr,
|
|
|
|
app.add_api_route(
|
|
|
|
endpoint=BackwardCompatibityBeginWrapperAuth,
|
|
|
|
path=lURLStr,
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
endpoint=BackwardCompatibityBeginWrapperAuth,
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
)
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
else:
|
|
|
|
)
|
|
|
|
app.add_api_route(
|
|
|
|
else:
|
|
|
|
path=lURLStr,
|
|
|
|
app.add_api_route(
|
|
|
|
endpoint=BackwardCompatibityBeginWrapperNoAuth,
|
|
|
|
path=lURLStr,
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
endpoint=BackwardCompatibityBeginWrapperNoAuth,
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
response_class=PlainTextResponse,
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
methods=[lConnectItemDict["Method"]],
|
|
|
|
)
|
|
|
|
tags=["BackwardCompatibility"]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
lConnectItemDict["BCBool"]=True
|
|
|
|
|
|
|
|
|
|
|
|
def InitUvicorn(inHostStr=None, inPortInt=None, inSSLCertPathStr=None, inSSLKeyPathStr=None, inSSLPasswordStr=None):
|
|
|
|
def InitUvicorn(inHostStr=None, inPortInt=None, inSSLCertPathStr=None, inSSLKeyPathStr=None, inSSLPasswordStr=None):
|
|
|
|
if inHostStr is None: inHostStr="0.0.0.0"
|
|
|
|
if inHostStr is None: inHostStr="0.0.0.0"
|
|
|
|