Skip to content

Commit 94f0abd

Browse files
author
Iván Ramos Muñoz
authored
Merge pull request #21 from ElevenPaths/task/i122703-add_sendToAVDate
(resolves #122703) update Tacyt python sdk and test to include new fi…
2 parents 0c3b69d + 9c86e70 commit 94f0abd

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

tacyt/TacytApp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ def get_RSS_info(self, filter_id):
120120
"""
121121
return super(TacytApp, self).get_rss_info(filter_id=filter_id)
122122

123-
def upload_app(self, apk_file, tagName=None):
123+
def upload_app(self, apk_file, tagName=None, send_to_av_date=None):
124124
"""Upload an app file to Tacyt
125125
:param apk_file: path to file apk
126126
:param tagName: an optional tag to labeled the uploaded app.
127+
:param send_to_av_date: an optional date to delay sending apps to third party antivirus like Opswat.
127128
:return: Response object.
128129
"""
129130
return super(TacytApp, self).upload_app(app_path=apk_file,
130-
tag_name=tagName)
131+
tag_name=tagName,
132+
send_to_av_date=send_to_av_date)
131133

132134
def getEngineVersion(self, date=None, engineId=None, lang=None):
133135
"""Search an engine and its associated vulnerabilities.

tacyt_sdk/authorization/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def http_get(self, url, headers=None):
157157
response = Response(json_string=res.content)
158158
res.raise_for_status()
159159
except requests.HTTPError as e:
160-
logger.error(e.message, exc_info=True)
160+
logger.error(str(e), exc_info=True)
161161
if not response.error:
162162
response.error = Error({"code": res.status_code,
163163
"message": res.content})
@@ -185,7 +185,7 @@ def http_post(self, url, headers=None, body=None):
185185
response = Response(json_string=res.content)
186186
res.raise_for_status()
187187
except requests.HTTPError as e:
188-
logger.error(e.message, exc_info=True)
188+
logger.error(str(e), exc_info=True)
189189
if not response.error:
190190
response.error = Error({"code": res.status_code,
191191
"message": res.content})
@@ -239,5 +239,5 @@ def http_post_file(self, url, headers, file_stream, file_name, data=None):
239239
response = Response(json_string=res.content)
240240
res.raise_for_status()
241241
except requests.HTTPError as e:
242-
logger.error(e.message, exc_info=True)
242+
logger.error(str(e), exc_info=True)
243243
return response

tacyt_sdk/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ def compare_apps(self, apps, include_details):
266266
result = CompareRequest(apps, include_details)
267267
return self.http_post(self.API_COMPARER_URL, body=result.as_dict())
268268

269-
def upload_app(self, app_path, tag_name=None):
269+
def upload_app(self, app_path, tag_name=None, send_to_av_date=None):
270270
"""Upload an app file to Tacyt
271271
:param app_path: path to file apk
272272
:param tag_name: an optional tag to labeled the uploaded app.
273+
:param send_to_av_date: an optional date to delay sending apps to third party antivirus like Opswat.
273274
:return: Response object.
274275
"""
275276
try:
@@ -284,9 +285,10 @@ def upload_app(self, app_path, tag_name=None):
284285
headers,
285286
file_stream,
286287
file_name,
287-
data={"tagName": tag_name})
288+
data={"tagName": tag_name,
289+
"sendToAVDate": send_to_av_date})
288290
except IOError as e:
289-
logger.error(e.message, exc_info=True)
291+
logger.error(str(e), exc_info=True)
290292
response = None
291293
return response
292294

0 commit comments

Comments
 (0)