Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed multiple issues #630

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tenable/io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def upload(self, fobj: BinaryIO, encrypted: bool = False):
# We will attempt to discover the name of the file stored within the
# file object. If none exists however, we will generate a random
# uuid string to use instead.
kw = dict()
params = dict()
if encrypted:
kw['data'] = {'no_enc': int(encrypted)}
kw['files'] = {'Filedata': fobj}
params['no_enc'] = int(encrypted)
kw = {'files': {'Filedata': fobj}}

return self._api.post('file/upload', **kw).json()['fileuploaded']
return self._api.post('file/upload', **kw, params=params).json()['fileuploaded']
2 changes: 1 addition & 1 deletion tenable/io/scans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def import_scan(self, fobj, folder_id=None, password=None, aggregate=None):

# Upload the file to the Tenable Vulnerability Management and store the resulting filename in
# the payload.
payload['file'] = self._api.files.upload(fobj)
payload['file'] = self._api.files.upload(fobj, encrypted=bool(password))

# make the call to Tenable Vulnerability Management to import and then return the result to
# the caller.
Expand Down
3 changes: 3 additions & 0 deletions tenable/io/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class TagsAPI(TIOEndpoint):
'category_name': {
'operators': ['eq', 'match'], 'pattern': None, 'choices': None
},
'category_uuid': {
'operators': ['eq'], 'pattern': r'^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12,32}$', 'choices': None
},
'description': {
'operators': ['eq', 'match'], 'pattern': None, 'choices': None
},
Expand Down
Loading