aa5587c93c
Fixes #1301 - Ensures that the worker uses pagination properly - Ensures that the worker handles failure as expected - Moves marking the notification as read to after the worker processes it - Increases the number of layers requested to 100
23 lines
702 B
Python
23 lines
702 B
Python
import logging
|
|
import json
|
|
|
|
import features
|
|
|
|
from app import secscan_notification_queue, secscan_api
|
|
from flask import request, make_response, Blueprint, abort
|
|
from endpoints.common import route_show_if
|
|
|
|
logger = logging.getLogger(__name__)
|
|
secscan = Blueprint('secscan', __name__)
|
|
|
|
@route_show_if(features.SECURITY_SCANNER)
|
|
@secscan.route('/notify', methods=['POST'])
|
|
def secscan_notification():
|
|
data = request.get_json()
|
|
logger.debug('Got notification from Security Scanner: %s', data)
|
|
if 'Notification' not in data:
|
|
abort(400)
|
|
|
|
notification = data['Notification']
|
|
secscan_notification_queue.put(['named', notification['Name']], json.dumps(notification))
|
|
return make_response('Okay')
|