Secrets & Global Site Configuration
This commit is contained in:
@@ -5,6 +5,10 @@ import requests
|
||||
from urllib3.exceptions import InsecureRequestWarning
|
||||
import jq
|
||||
import json
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# Function to authenticate and get token
|
||||
def authenticate(device_ip, payload):
|
||||
@@ -106,10 +110,13 @@ def get_API_1(device_ip, token):
|
||||
|
||||
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
|
||||
|
||||
default_user = str(os.getenv("DEFAULT_MOXA_USER"))
|
||||
default_password = str(os.getenv("DEFAULT_MOXA_PASSWORD"))
|
||||
|
||||
payload_auth = {
|
||||
"acceptEULA": True,
|
||||
"name": "",
|
||||
"password": ""
|
||||
"name": default_user,
|
||||
"password": default_password
|
||||
}
|
||||
if payload_auth["name"] == "" or payload_auth["password"] == "":
|
||||
print("Provide the credentials before running the script!")
|
||||
|
||||
Reference in New Issue
Block a user