mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 11:58:09 +00:00
Remove signalr from endpoints (#1102)
This is a follow-on PR from #1100
This commit is contained in:
@ -10,7 +10,6 @@ from onefuzztypes.requests import CanScheduleRequest
|
||||
from onefuzztypes.responses import CanSchedule
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_agent
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.tasks.main import Task
|
||||
from ..onefuzzlib.workers.nodes import Node
|
||||
@ -43,13 +42,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(CanSchedule(allowed=allowed, work_stopped=work_stopped))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_agent(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ from onefuzztypes.requests import NodeCommandDelete, NodeCommandGet
|
||||
from onefuzztypes.responses import BoolResult, PendingNodeCommand
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_agent
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.workers.nodes import NodeMessage
|
||||
|
||||
@ -43,13 +42,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"DELETE": delete, "GET": get}
|
||||
method = methods[req.method]
|
||||
result = call_if_agent(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.agent_events import on_state_update, on_worker_event
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_agent
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
|
||||
|
||||
@ -72,13 +71,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_agent(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ from ..onefuzzlib.azure.creds import get_instance_url
|
||||
from ..onefuzzlib.azure.queue import get_queue_sas
|
||||
from ..onefuzzlib.azure.storage import StorageType
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_agent
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_uri
|
||||
from ..onefuzzlib.workers.nodes import Node
|
||||
from ..onefuzzlib.workers.pools import Pool
|
||||
@ -112,13 +111,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return create_registration_response(node.machine_id, pool)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post, "GET": get}
|
||||
method = methods[req.method]
|
||||
result = call_if_agent(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ from ..onefuzzlib.azure.containers import (
|
||||
)
|
||||
from ..onefuzzlib.azure.storage import StorageType
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
|
||||
|
||||
@ -89,13 +88,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=delete_container(request.name, StorageType.corpus)))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -16,12 +16,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ from ..onefuzzlib.azure.containers import (
|
||||
)
|
||||
from ..onefuzzlib.azure.storage import StorageType
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, parse_uri, redirect
|
||||
|
||||
|
||||
@ -47,13 +46,9 @@ def get(req: func.HttpRequest) -> func.HttpResponse:
|
||||
)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -14,12 +14,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -14,12 +14,11 @@ from ..onefuzzlib.azure.creds import (
|
||||
get_instance_id,
|
||||
get_subscription,
|
||||
)
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import ok
|
||||
from ..onefuzzlib.versions import versions
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
response = ok(
|
||||
Info(
|
||||
resource_group=get_base_resource_group(),
|
||||
@ -32,8 +31,4 @@ def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
)
|
||||
)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return response
|
||||
|
@ -14,12 +14,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.requests import InstanceConfigUpdate
|
||||
|
||||
from ..onefuzzlib.config import InstanceConfig
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user, can_modify_config
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
|
||||
|
||||
@ -36,13 +35,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(config)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ from onefuzztypes.job_templates import JobTemplateRequest
|
||||
from onefuzztypes.models import Error
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.job_templates.templates import JobTemplateIndex
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.user_credentials import parse_jwt_token
|
||||
@ -35,13 +34,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(job)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ from onefuzztypes.models import Error
|
||||
from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.job_templates.templates import JobTemplateIndex
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
|
||||
@ -62,13 +61,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=entry is not None))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ from onefuzztypes.models import Error, JobConfig, JobTaskInfo
|
||||
from onefuzztypes.requests import JobGet, JobSearch
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.jobs import Job
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.tasks.main import Task
|
||||
@ -75,13 +74,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(job)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -16,12 +16,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.requests import NodeGet, NodeSearch, NodeUpdate
|
||||
from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.workers.nodes import Node, NodeMessage, NodeTasks
|
||||
|
||||
@ -104,13 +103,9 @@ def patch(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "PATCH": patch, "DELETE": delete, "POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.requests import NodeAddSshKey
|
||||
from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.workers.nodes import Node
|
||||
|
||||
@ -33,13 +32,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ from onefuzztypes.requests import (
|
||||
)
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.notifications.main import Notification
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request, parse_uri
|
||||
|
||||
@ -63,13 +62,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(entry)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -16,12 +16,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Licensed under the MIT License.
|
||||
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
from typing import List
|
||||
|
||||
from onefuzztypes.events import Event, EventMessage, EventType, get_event_type
|
||||
from onefuzztypes.models import UserInfo
|
||||
@ -26,10 +26,6 @@ def queue_signalr_event(event_message: EventMessage) -> None:
|
||||
send_message("signalr-events", message, StorageType.config)
|
||||
|
||||
|
||||
def get_events() -> Optional[str]:
|
||||
return None
|
||||
|
||||
|
||||
def log_event(event: Event, event_type: EventType) -> None:
|
||||
scrubbed_event = filter_event(event)
|
||||
logging.info(
|
||||
|
@ -22,7 +22,6 @@ from ..onefuzzlib.azure.queue import get_queue_sas
|
||||
from ..onefuzzlib.azure.storage import StorageType
|
||||
from ..onefuzzlib.azure.vmss import list_available_skus
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user, check_can_manage_pools
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.workers.pools import Pool
|
||||
|
||||
@ -145,13 +144,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ from onefuzztypes.requests import ProxyCreate, ProxyDelete, ProxyGet, ProxyReset
|
||||
from onefuzztypes.responses import BoolResult, ProxyGetResult, ProxyInfo, ProxyList
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.proxy import Proxy
|
||||
from ..onefuzzlib.proxy_forward import ProxyForward
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
@ -128,13 +127,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete, "PATCH": patch}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from typing import Dict
|
||||
import azure.functions as func
|
||||
|
||||
from ..onefuzzlib.azure.storage import corpus_accounts
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.notifications.main import new_files
|
||||
|
||||
# The number of time the function will be retried if an error occurs
|
||||
@ -26,7 +25,7 @@ def file_added(event: Dict, fail_task_on_transient_error: bool) -> None:
|
||||
new_files(container, path, fail_task_on_transient_error)
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
event = json.loads(msg.get_body())
|
||||
last_try = msg.dequeue_count == MAX_DEQUEUE_COUNT
|
||||
# check type first before calling Azure APIs
|
||||
@ -37,7 +36,3 @@ def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
return
|
||||
|
||||
file_added(event, last_try)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "file-changes",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ from onefuzztypes.events import EventNodeHeartbeat
|
||||
from onefuzztypes.models import NodeHeartbeatEntry
|
||||
from pydantic import ValidationError
|
||||
|
||||
from ..onefuzzlib.events import get_events, send_event
|
||||
from ..onefuzzlib.events import send_event
|
||||
from ..onefuzzlib.workers.nodes import Node
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
logging.info("heartbeat: %s", body)
|
||||
raw = json.loads(body)
|
||||
@ -37,7 +37,3 @@ def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
)
|
||||
except ValidationError:
|
||||
logging.error("invalid node heartbeat: %s", raw)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "node-heartbeat",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,11 +9,10 @@ import logging
|
||||
import azure.functions as func
|
||||
from onefuzztypes.models import ProxyHeartbeat
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.proxy import PROXY_LOG_PREFIX, Proxy
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
logging.info(PROXY_LOG_PREFIX + "heartbeat: %s", body)
|
||||
raw = json.loads(body)
|
||||
@ -26,7 +25,3 @@ def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
return
|
||||
proxy.heartbeat = heartbeat
|
||||
proxy.save()
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "proxy",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ from onefuzztypes.events import EventTaskHeartbeat
|
||||
from onefuzztypes.models import Error, TaskHeartbeatEntry
|
||||
from pydantic import ValidationError
|
||||
|
||||
from ..onefuzzlib.events import get_events, send_event
|
||||
from ..onefuzzlib.events import send_event
|
||||
from ..onefuzzlib.tasks.main import Task
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
logging.info("heartbeat: %s", body)
|
||||
|
||||
@ -37,7 +37,3 @@ def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
)
|
||||
except ValidationError:
|
||||
logging.error("invalid task heartbeat: %s", raw)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "task-heartbeat",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,15 +7,10 @@ import json
|
||||
|
||||
import azure.functions as func
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.updates import Update, execute_update
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
update = Update.parse_obj(json.loads(body))
|
||||
execute_update(update)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "update-queue",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,15 +7,10 @@ import json
|
||||
|
||||
import azure.functions as func
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.webhooks import WebhookMessageLog, WebhookMessageQueueObj
|
||||
|
||||
|
||||
def main(msg: func.QueueMessage, dashboard: func.Out[str]) -> None:
|
||||
def main(msg: func.QueueMessage) -> None:
|
||||
body = msg.get_body()
|
||||
obj = WebhookMessageQueueObj.parse_obj(json.loads(body))
|
||||
WebhookMessageLog.process_from_queue(obj)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -7,12 +7,6 @@
|
||||
"direction": "in",
|
||||
"queueName": "webhooks",
|
||||
"connection": "AzureWebJobsStorage"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ from onefuzztypes.models import Error, ReproConfig
|
||||
from onefuzztypes.requests import ReproGet
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.repro import Repro
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.user_credentials import parse_jwt_token
|
||||
@ -74,13 +73,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(vm)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -16,12 +16,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ from onefuzztypes.responses import BoolResult
|
||||
from ..onefuzzlib.azure.creds import get_base_region, get_regions
|
||||
from ..onefuzzlib.azure.vmss import list_available_skus
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user, check_can_manage_pools
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.workers.pools import Pool
|
||||
from ..onefuzzlib.workers.scalesets import Scaleset
|
||||
@ -153,13 +152,9 @@ def patch(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(scaleset)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete, "PATCH": patch}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.requests import TaskGet, TaskSearch
|
||||
from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.jobs import Job
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.task_event import TaskEvent
|
||||
@ -99,13 +98,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(task)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -7,12 +7,11 @@ import logging
|
||||
|
||||
import azure.functions as func
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.webhooks import WebhookMessageLog
|
||||
from ..onefuzzlib.workers.scalesets import Scaleset
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
scalesets = Scaleset.search()
|
||||
for scaleset in scalesets:
|
||||
logging.info("updating scaleset configs: %s", scaleset.scaleset_id)
|
||||
@ -27,7 +26,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
log_entry.event_id,
|
||||
)
|
||||
log_entry.delete()
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "1.00:00:00",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -8,13 +8,12 @@ import logging
|
||||
import azure.functions as func
|
||||
from onefuzztypes.enums import VmState
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.orm import process_state_updates
|
||||
from ..onefuzzlib.proxy import PROXY_LOG_PREFIX, Proxy
|
||||
from ..onefuzzlib.workers.scalesets import Scaleset
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
proxies = Proxy.search()
|
||||
for proxy in proxies:
|
||||
if proxy.state in VmState.available():
|
||||
@ -51,7 +50,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
for region in regions:
|
||||
if all(x.outdated for x in proxies if x.region == region):
|
||||
Proxy.get_or_create(region)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "00:00:30",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -8,12 +8,11 @@ import logging
|
||||
import azure.functions as func
|
||||
from onefuzztypes.enums import VmState
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.orm import process_state_updates
|
||||
from ..onefuzzlib.repro import Repro
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
expired = Repro.search_expired()
|
||||
for repro in expired:
|
||||
logging.info("stopping repro: %s", repro.vm_id)
|
||||
@ -27,7 +26,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
continue
|
||||
logging.info("update repro: %s", repro.vm_id)
|
||||
process_state_updates(repro)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "00:00:30",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -9,7 +9,6 @@ import logging
|
||||
import azure.functions as func
|
||||
from onefuzztypes.enums import JobState, TaskState
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.jobs import Job
|
||||
from ..onefuzzlib.notifications.main import Notification
|
||||
from ..onefuzzlib.repro import Repro
|
||||
@ -19,7 +18,7 @@ RETENTION_POLICY = datetime.timedelta(days=(18 * 30))
|
||||
SEARCH_EXTENT = datetime.timedelta(days=(20 * 30))
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
|
||||
now = datetime.datetime.now(tz=datetime.timezone.utc)
|
||||
|
||||
@ -73,7 +72,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
logging.info("removing PII from repro: %s", repro.vm_id)
|
||||
repro.user_info.upn = None
|
||||
repro.save()
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "20:00:00",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -8,14 +8,13 @@ import logging
|
||||
import azure.functions as func
|
||||
from onefuzztypes.enums import JobState, TaskState
|
||||
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.jobs import Job
|
||||
from ..onefuzzlib.orm import process_state_updates
|
||||
from ..onefuzzlib.tasks.main import Task
|
||||
from ..onefuzzlib.tasks.scheduler import schedule_tasks
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
expired_tasks = Task.search_expired()
|
||||
for task in expired_tasks:
|
||||
logging.info(
|
||||
@ -41,7 +40,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
schedule_tasks()
|
||||
|
||||
Job.stop_never_started_jobs()
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "00:00:15",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -9,7 +9,6 @@ import azure.functions as func
|
||||
from onefuzztypes.enums import NodeState, PoolState
|
||||
|
||||
from ..onefuzzlib.autoscale import autoscale_pool
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.orm import process_state_updates
|
||||
from ..onefuzzlib.workers.nodes import Node
|
||||
from ..onefuzzlib.workers.pools import Pool
|
||||
@ -31,7 +30,7 @@ def process_scaleset(scaleset: Scaleset) -> None:
|
||||
process_state_updates(scaleset)
|
||||
|
||||
|
||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||
def main(mytimer: func.TimerRequest) -> None: # noqa: F841
|
||||
# NOTE: Update pools first, such that scalesets impacted by pool updates
|
||||
# (such as shutdown or resize) happen during this iteration `timer_worker`
|
||||
# rather than the following iteration.
|
||||
@ -61,7 +60,3 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
|
||||
scalesets = Scaleset.search()
|
||||
for scaleset in sorted(scalesets, key=lambda x: x.scaleset_id):
|
||||
process_scaleset(scaleset)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
@ -5,12 +5,6 @@
|
||||
"name": "mytimer",
|
||||
"schedule": "00:01:30",
|
||||
"type": "timerTrigger"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
],
|
||||
"scriptFile": "__init__.py"
|
||||
|
@ -16,7 +16,6 @@ from onefuzztypes.requests import (
|
||||
from onefuzztypes.responses import BoolResult
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.webhooks import Webhook
|
||||
|
||||
@ -106,13 +105,9 @@ def delete(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(BoolResult(result=True))
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"GET": get, "POST": post, "DELETE": delete, "PATCH": patch}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -17,12 +17,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.models import Error
|
||||
from onefuzztypes.requests import WebhookGet
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.webhooks import Webhook, WebhookMessageLog
|
||||
|
||||
@ -29,13 +28,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(logs)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ from onefuzztypes.models import Error
|
||||
from onefuzztypes.requests import WebhookGet
|
||||
|
||||
from ..onefuzzlib.endpoint_authorization import call_if_user
|
||||
from ..onefuzzlib.events import get_events
|
||||
from ..onefuzzlib.request import not_ok, ok, parse_request
|
||||
from ..onefuzzlib.webhooks import Webhook
|
||||
|
||||
@ -30,13 +29,9 @@ def post(req: func.HttpRequest) -> func.HttpResponse:
|
||||
return ok(ping)
|
||||
|
||||
|
||||
def main(req: func.HttpRequest, dashboard: func.Out[str]) -> func.HttpResponse:
|
||||
def main(req: func.HttpRequest) -> func.HttpResponse:
|
||||
methods = {"POST": post}
|
||||
method = methods[req.method]
|
||||
result = call_if_user(req, method)
|
||||
|
||||
events = get_events()
|
||||
if events:
|
||||
dashboard.set(events)
|
||||
|
||||
return result
|
||||
|
@ -15,12 +15,6 @@
|
||||
"type": "http",
|
||||
"direction": "out",
|
||||
"name": "$return"
|
||||
},
|
||||
{
|
||||
"type": "signalR",
|
||||
"direction": "out",
|
||||
"name": "dashboard",
|
||||
"hubName": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user