Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, opts):
super(CustomThreatService, self).__init__(**_make_args(opts))
# Configurable options
self.options = opts.get(CONFIG_SECTION, {})
# Do we support "file-content" artifacts? Default is no.
# TODO add implementation support to parse the file content
self.support_upload_file = bool(self.options.get(CONFIG_UPLOAD_FILE.key, CONFIG_UPLOAD_FILE.default))
# Default time that this service will tell Resilient to retry
self.first_retry_secs = int(self.options.get(CONFIG_FIRST_RETRY_SECS.key, CONFIG_FIRST_RETRY_SECS.default)) or 5
self.later_retry_secs = int(self.options.get(CONFIG_LATER_RETRY_SECS.key, CONFIG_LATER_RETRY_SECS.default)) or 60
# Size of the request cache
self.cache_size = int(self.options.get(CONFIG_CACHE_SIZE.key, CONFIG_CACHE_SIZE.default))
# TTL of the request cache (millis before we give up on a request lookup)
self.cache_ttl = int(self.options.get(CONFIG_CACHE_TTL.key, CONFIG_CACHE_TTL.default))