def subscribe(hub, callback_url, topic_url, lease_seconds, secret,
              endpoint_hook_data):
    """5.2 Subscription Validation"""

    for validate in hub.validators:
        error = validate(callback_url, topic_url, lease_seconds, secret,
                         endpoint_hook_data)
        if error:
            send_denied(hub, callback_url, topic_url, error)
            return

    if intent_verified(hub, callback_url, 'subscribe', topic_url,
                       lease_seconds):
        hub.storage[topic_url, callback_url] = {
            'lease_seconds': lease_seconds,
            'secret': secret,
        }
def subscribe ( hub , callback_url , topic_url , lease_seconds , secret , endpoint_hook_data ) : for validate in hub . validators : error = validate ( callback_url , topic_url , lease_seconds , secret , endpoint_hook_data ) if error : send_denied ( hub , callback_url , topic_url , error ) return if intent_verified ( hub , callback_url , 'subscribe' , topic_url , lease_seconds ) : hub . storage [ topic_url , callback_url ] = { 'lease_seconds' : lease_seconds , 'secret' : secret , }
5.2 Subscription Validation