SimpleChatTC:SimpleProxy:BearerInsecure a needed config
Add a config entry called bearer.insecure which will contain a token used for bearer auth of http requests Make bearer.insecure and allowed.domains as needed configs, and exit program if they arent got through cmdline or config file.
This commit is contained in:
parent
0caa2e8101
commit
3f1fd289eb
|
|
@ -12,5 +12,6 @@
|
|||
"^duckduckgo\\.com$",
|
||||
".*\\.google\\.com$",
|
||||
"^google\\.com$"
|
||||
]
|
||||
],
|
||||
"bearer.insecure": "NeverSecure"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,9 +36,12 @@ gConfigType = {
|
|||
'--port': 'int',
|
||||
'--config': 'str',
|
||||
'--debug': 'bool',
|
||||
'--allowed.domains': 'list'
|
||||
'--allowed.domains': 'list',
|
||||
'--bearer.insecure': 'str'
|
||||
}
|
||||
|
||||
gConfigNeeded = [ '--allowed.domains', '--bearer.insecure' ]
|
||||
|
||||
|
||||
class ProxyHandler(http.server.BaseHTTPRequestHandler):
|
||||
"""
|
||||
|
|
@ -377,6 +380,10 @@ def process_args(args: list[str]):
|
|||
print(f"ERRR:ProcessArgs:{iArg}:{cArg}:UnknownCommand")
|
||||
exit(103)
|
||||
print(gMe)
|
||||
for k in gConfigNeeded:
|
||||
if gMe.get(k) == None:
|
||||
print(f"ERRR:ProcessArgs:{k}:missing, did you forget to pass the config file...")
|
||||
exit(104)
|
||||
|
||||
|
||||
def run():
|
||||
|
|
|
|||
Loading…
Reference in New Issue