Undo API key add

This commit is contained in:
Kumi 2023-03-24 14:03:54 +00:00
parent 4a7fe5d224
commit c0ad53a916
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 10 additions and 23 deletions

View file

@ -117,21 +117,15 @@ def oidc_callback():
"HTTP_PRETTY_PRINT": "TRUE", # Hey, it's pretty! "HTTP_PRETTY_PRINT": "TRUE", # Hey, it's pretty!
} }
# Add the API key or username and password to the request headers # Add the username and password to the request headers
api_key = config["PLESK"].get( plesk_login = config["PLESK"].get(
"APIKey", fallback=os.environ.get("PLESK_API_KEY")) "Username", fallback=os.environ.get("PLESK_USERNAME"))
plesk_password = config["PLESK"].get(
if api_key: "Password", fallback=os.environ.get("PLESK_PASSWORD"))
headers["X-API-Key"] = api_key
else: headers["HTTP_AUTH_LOGIN"] = plesk_login
plesk_login = config["PLESK"].get( headers["HTTP_AUTH_PASSWD"] = plesk_password
"Username", fallback=os.environ.get("PLESK_USERNAME"))
plesk_password = config["PLESK"].get(
"Password", fallback=os.environ.get("PLESK_PASSWORD"))
headers["HTTP_AUTH_LOGIN"] = plesk_login
headers["HTTP_AUTH_PASSWD"] = plesk_password
# If "VerifySSL" is set to "False" in the configuration, disable SSL verification # If "VerifySSL" is set to "False" in the configuration, disable SSL verification

View file

@ -17,16 +17,9 @@
# Domain = plesk.local # Domain = plesk.local
# You need to use an API key to access the Plesk API # You need to use an admin account to access the Plesk API
# Check the Plesk documentation for how to create one
# https://docs.plesk.com/en-US/obsidian/api-rpc/about-rest-api.79359/#api-keys
# You can also leave this blank and set the environment variable PLESK_API_KEY instead
# APIKey = YourAPIKey
# Alternatively, you can use your Plesk admin account
# Is that a security risk? Yes. # Is that a security risk? Yes.
# You can leave these values blank and set the environment variables PLESK_DOMAIN, PLESK_USERNAME, PLESK_PASSWORD instead # You can leave these values blank and set the environment variables PLESK_USERNAME, PLESK_PASSWORD instead
# Username = your_admin_account # Username = your_admin_account
# Password = your_admin_password # Password = your_admin_password