'Create a \'cache_poisoning_server\' event for event-collector
poison_info: Details from the client about the poisoning event
request, context: Should be pylons.request & pylons.c respectively'

@squelch_exceptions
@sampled('events_collector_poison_sample_rate')
def cache_poisoning_event(self, poison_info, request=None, context=None):

    poisoner_name = poison_info.pop('poisoner_name')
    event = Event(topic='cache_poisoning_events', event_type='ss.cache_poisoning', request=request, context=context, data=poison_info, truncatable_field='resp_headers')
    event.add('poison_blame_guess', 'proxy')
    resp_headers = poison_info['resp_headers']
    if resp_headers:
        cache_policy = poison_info['cache_policy']
        headers_valid = cache_headers_valid(cache_policy, resp_headers)
        event.add('cache_headers_valid', headers_valid)
    if (poison_info['source'] == 'web'):
        valid_login_hook = hooks.get_hook('poisoning.guess_valid_login')
        if valid_login_hook.call_until_return(poisoner_name=poisoner_name):
            event.add('poison_blame_guess', 'local_proxy')
            event.add('poison_credentialed_guess', False)
        elif (context.user_is_loggedin and (context.user.name == poisoner_name)):
            event.add('poison_credentialed_guess', True)
        else:
            event.add('poison_credentialed_guess', False)
    elif (poison_info['source'] == 'mweb'):
        event.add('poison_credentialed_guess', True)
    else:
        raise Exception('Unsupported    source    in    cache_poisoning_event')
    if (resp_headers and ('cf-cache-status' in resp_headers)):
        event.add('poison_blame_guess', 'cdn')
    self.save_event(event)
