Skip to content

Commit

Permalink
Merge pull request #18 from Contrast-Security-OSS/INT-1048-fix-filter…
Browse files Browse the repository at this point in the history
…-app-session-metadata

Int 1048 fix filter app session metadata
  • Loading branch information
Bryan Lee Ateo-an authored Feb 3, 2022
2 parents cf88018 + 18f8fc5 commit 421fe37
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions contrast_security/user_api/application_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def filter_applications(self, org_uuid, application_filter=None):
if application_filter is None:
application_filter = ApplicationFilter()
path = '{org_uuid}/applications/filter'.format(org_uuid=org_uuid)
return self._post(path, params=application_filter.get_params_as_json())
return self._get(path, params=application_filter.get_params_as_json())

def get_application_filters(self, org_uuid):
path = '{org_uuid}/applications/filters/listing'.format(org_uuid=org_uuid)
return self._post(path)
return self._get(path)

def get_application(self, org_uuid, app_id, expand=None, include_merged=True):
path = '{org_uuid}/applications/{app_id}'.format(org_uuid=org_uuid, app_id=app_id)
Expand All @@ -151,7 +151,7 @@ def filter_application_traces(self, org_uuid, app_id, application_trace_filter=N
if application_trace_filter is None:
application_trace_filter = ApplicationTraceFilter()
path = '{org_uuid}/traces/{app_id}/filter'.format(org_uuid=org_uuid, app_id=app_id)
return self._post(path, params=application_trace_filter.get_params_as_json())
return self._get(path, params=application_trace_filter.get_params_as_json())

def get_application_vuln_details(self, org_uuid, app_id, trace_uuid, expand=None):
path = '{org_uuid}/traces/{app_id}/filter/{trace_uuid}'.format(org_uuid=org_uuid, app_id=app_id, trace_uuid=trace_uuid)
Expand Down
4 changes: 2 additions & 2 deletions contrast_security/user_api/library_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def get_library_stats(self, org_uuid):

def get_library_filter_subfilters(self, org_uuid,filter_type):
path = '{org_uuid}/libraries/filters/{filter_type}/listing'.format(org_uuid=org_uuid, filter_type=filter_type)
return self._post(path)
return self._get(path)

def filter_libraries(self, org_uuid, library_filter=None):
if library_filter is None:
library_filter = LibraryFilter()
path = '{org_uuid}/libraries/filter'.format(org_uuid=org_uuid)
return self._post(path, params=library_filter.get_params_as_json())
return self._get(path, params=library_filter.get_params_as_json())

def get_all_library_filters(self, filter_type):
return self._get('libraries/filters/listing', params={'filterType': filter_type})
Expand Down
4 changes: 2 additions & 2 deletions contrast_security/user_api/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ def filter_servers(self, org_uuid, server_filter=None):
if server_filter is None:
server_filter = ServerFilter()
path = '{org_uuid}/servers/filter'.format(org_uuid=org_uuid)
return self._post(path, params=server_filter.get_params_as_json())
return self._get(path, params=server_filter.get_params_as_json())

def get_server_filters(self, org_uuid):
path = '{org_uuid}/servers/filters/listing'.format(org_uuid=org_uuid)
return self._get(path)

def get_server_filter_subfilters(self, org_uuid, filter_type):
path = '{org_uuid}/servers/filters/{filter_type}/listing'.format(org_uuid=org_uuid, filter_type=filter_type)
return self._post(path)
return self._get(path)

def get_server_modes(self, org_uuid):
path = '{org_uuid}/servers/modes'.format(org_uuid=org_uuid)
Expand Down
3 changes: 2 additions & 1 deletion contrast_security/user_api/session_metadata_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ def __init__(self):

def filter_app_session_metadata(self, org_uuid, app_id):
path = '{org_uuid}/metadata/session/{app_id}/filters'.format(org_uuid=org_uuid, app_id=app_id)
return self._post(path)
no_filter = {}
return self._post(path,data=no_filter)

0 comments on commit 421fe37

Please sign in to comment.