Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def valid_keen_key(keenio_read_key, node_id):
try:
ret = scoped_keys.decrypt(settings.KEEN['public']['master_key'], keenio_read_key)
return ret['filters'][0]['property_value'] == node_id
except Exception as error:
logger.exception('Error on {}:'.format(node_id))
# Returns True to bypass updating of the key -- failed nodes should be investigated separately
return True