Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def csv(self):
"""Output data as CSV.
:return: String of formatted data
"""
for result in self._results.get('results', []):
data = [result.get(detail, '') for detail in SSL_VALID_FIELDS]
return utilities.to_csv(SSL_VALID_FIELDS, [data])
def csv(self):
"""Output data as CSV.
:return: String of formatted data
"""
for result in self._results.get('results', []):
data = [result.get(detail, '') for detail in SSL_VALID_FIELDS]
return utilities.to_csv(SSL_VALID_FIELDS, [data])
def search_ssl_certificate_by_field(self, **kwargs):
"""Search SSL certificate details based on query value and field.
Reference: https://api.passivetotal.org/api/docs/#api-SSL_Certificates-GetSslCertificateSearchQueryField
:param str query: Query value to use when making the request for data
:param str compact_record: Return the record in a compact format
:param str field: Field to run the query against
:param str type: Type of search to conduct
:return: SSL certificates matching the query
"""
if 'field' not in kwargs:
raise MISSING_FIELD("Field value is required.")
if kwargs['field'] not in SSL_VALID_FIELDS:
raise INVALID_FIELD_TYPE("Field must be one of the following: %s"
% ', '.join(SSL_VALID_FIELDS))
return self._get('ssl-certificate', 'search', **kwargs)
def search_ssl_certificate_by_field(self, **kwargs):
"""Search SSL certificate details based on query value and field.
Reference: https://api.passivetotal.org/api/docs/#api-SSL_Certificates-GetSslCertificateSearchQueryField
:param str query: Query value to use when making the request for data
:param str compact_record: Return the record in a compact format
:param str field: Field to run the query against
:param str type: Type of search to conduct
:return: SSL certificates matching the query
"""
if 'field' not in kwargs:
raise MISSING_FIELD("Field value is required.")
if kwargs['field'] not in SSL_VALID_FIELDS:
raise INVALID_FIELD_TYPE("Field must be one of the following: %s"
% ', '.join(SSL_VALID_FIELDS))
return self._get('ssl-certificate', 'search', **kwargs)