Skip to content

Commit

Permalink
Fixed verify=False by default for shuffle tools actions
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Jan 17, 2024
1 parent 376550d commit 37ac60d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def send_sms_shuffle(self, apikey, phone_numbers, body):

url = "https://shuffler.io/api/v1/functions/sendsms"
headers = {"Authorization": "Bearer %s" % apikey}
return requests.post(url, headers=headers, json=data).text
return requests.post(url, headers=headers, json=data, verify=False).text

# This is an email function of Shuffle
def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):
Expand Down Expand Up @@ -205,7 +205,7 @@ def send_email_shuffle(self, apikey, recipients, subject, body, attachments=""):

url = "https://shuffler.io/api/v1/functions/sendmail"
headers = {"Authorization": "Bearer %s" % apikey}
return requests.post(url, headers=headers, json=data).text
return requests.post(url, headers=headers, json=data, verify=False).text

def repeat_back_to_me(self, call):
return call
Expand Down Expand Up @@ -906,6 +906,7 @@ def get_file_meta(self, file_id):
"%s/api/v1/files/%s?execution_id=%s"
% (self.url, file_id, self.current_execution_id),
headers=headers,
verify=False,
)
self.logger.info(f"RET: {ret}")

Expand All @@ -922,6 +923,7 @@ def delete_file(self, file_id):
"%s/api/v1/files/%s?execution_id=%s"
% (self.url, file_id, self.current_execution_id),
headers=headers,
verify=False,
)
return ret.text

Expand Down Expand Up @@ -984,7 +986,7 @@ def get_file_value(self, filedata):
}

def download_remote_file(self, url, custom_filename=""):
ret = requests.get(url, verify=False) # nosec
ret = requests.get(url, verify=False, verify=False) # nosec
filename = url.split("/")[-1]
if "?" in filename:
filename = filename.split("?")[0]
Expand Down Expand Up @@ -1699,7 +1701,7 @@ def check_cache_contains(self, key, value, append):
else:
append = False

get_response = requests.post(url, json=data)
get_response = requests.post(url, json=data, verify=False)
try:
allvalues = get_response.json()
try:
Expand All @@ -1714,7 +1716,7 @@ def check_cache_contains(self, key, value, append):
data["value"] = json.dumps(new_value)

set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id)
set_response = requests.post(set_url, json=data)
set_response = requests.post(set_url, json=data, verify=False)
try:
allvalues = set_response.json()
#allvalues["key"] = key
Expand Down Expand Up @@ -1806,7 +1808,7 @@ def check_cache_contains(self, key, value, append):
#return allvalues

set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id)
response = requests.post(set_url, json=data)
response = requests.post(set_url, json=data, verify=False)
exception = ""
try:
allvalues = response.json()
Expand Down Expand Up @@ -1878,7 +1880,7 @@ def change_cache_subkey(self, key, subkey, value, overwrite):
"value": value,
}

response = requests.post(url, json=data)
response = requests.post(url, json=data, verify=False)
try:
allvalues = response.json()
allvalues["key"] = key
Expand Down Expand Up @@ -1912,7 +1914,7 @@ def get_cache_value(self, key):
"key": key,
}

value = requests.post(url, json=data)
value = requests.post(url, json=data, verify=False)
try:
allvalues = value.json()
self.logger.info("VAL1: ", allvalues)
Expand Down Expand Up @@ -1961,7 +1963,7 @@ def set_cache_value(self, key, value):
"value": value,
}

response = requests.post(url, json=data)
response = requests.post(url, json=data, verify=False)
try:
allvalues = response.json()
allvalues["key"] = key
Expand Down Expand Up @@ -2088,7 +2090,7 @@ def run_oauth_request(self, url, jwt):

data = "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=%s" % jwt

return requests.post(url, data=data, headers=headers).text
return requests.post(url, data=data, headers=headers, verify=False).text

# Based on https://google-auth.readthedocs.io/en/master/reference/google.auth.crypt.html
def get_jwt_from_file(self, file_id, jwt_audience, scopes, complete_request=True):
Expand Down

0 comments on commit 37ac60d

Please sign in to comment.