mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-13 01:30:31 +08:00
added secret for http auth
This commit is contained in:
parent
0fd333d73b
commit
958c113c2f
@ -46,6 +46,7 @@ class Plugin(BaseAuthService):
|
|||||||
self,
|
self,
|
||||||
url: str,
|
url: str,
|
||||||
verify: bool,
|
verify: bool,
|
||||||
|
secret: str,
|
||||||
user: str,
|
user: str,
|
||||||
passwd: str,
|
passwd: str,
|
||||||
timeout: float,
|
timeout: float,
|
||||||
@ -53,6 +54,7 @@ class Plugin(BaseAuthService):
|
|||||||
|
|
||||||
self.__url = url
|
self.__url = url
|
||||||
self.__verify = verify
|
self.__verify = verify
|
||||||
|
self.__secret = secret
|
||||||
self.__user = user
|
self.__user = user
|
||||||
self.__passwd = passwd
|
self.__passwd = passwd
|
||||||
self.__timeout = timeout
|
self.__timeout = timeout
|
||||||
@ -64,6 +66,7 @@ class Plugin(BaseAuthService):
|
|||||||
return {
|
return {
|
||||||
"url": Option("http://localhost/auth"),
|
"url": Option("http://localhost/auth"),
|
||||||
"verify": Option(True, type=valid_bool),
|
"verify": Option(True, type=valid_bool),
|
||||||
|
"secret": Option(""),
|
||||||
"user": Option(""),
|
"user": Option(""),
|
||||||
"passwd": Option(""),
|
"passwd": Option(""),
|
||||||
"timeout": Option(5.0, type=valid_float_f01),
|
"timeout": Option(5.0, type=valid_float_f01),
|
||||||
@ -79,6 +82,7 @@ class Plugin(BaseAuthService):
|
|||||||
json={
|
json={
|
||||||
"user": user,
|
"user": user,
|
||||||
"passwd": passwd,
|
"passwd": passwd,
|
||||||
|
"secret": self.__secret,
|
||||||
},
|
},
|
||||||
headers={
|
headers={
|
||||||
"User-Agent": f"KVMD/{__version__}",
|
"User-Agent": f"KVMD/{__version__}",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user