mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-19 13:03:44 +00:00
Event based webhooks (#296)
This commit is contained in:
16
src/api-service/__app__/queue_webhooks/__init__.py
Normal file
16
src/api-service/__app__/queue_webhooks/__init__.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
import json
|
||||
|
||||
import azure.functions as func
|
||||
|
||||
from ..onefuzzlib.webhooks import WebhookMessageLog, WebhookMessageQueueObj
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
obj = WebhookMessageQueueObj.parse_obj(json.loads(body))
|
||||
WebhookMessageLog.process_from_queue(obj)
|
12
src/api-service/__app__/queue_webhooks/function.json
Normal file
12
src/api-service/__app__/queue_webhooks/function.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"scriptFile": "__init__.py",
|
||||
"bindings": [
|
||||
{
|
||||
"name": "msg",
|
||||
"type": "queueTrigger",
|
||||
"direction": "in",
|
||||
"queueName": "webhooks",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user