Island: Remove disused LogBlackboxEndpoint
This commit is contained in:
parent
6ae7676322
commit
bbbb1ac773
|
@ -116,6 +116,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- "-t/--tunnel" from agent command line arguments. #2216
|
||||
- "/api/monkey-control/neets-to-stop". #2261
|
||||
- "GET /api/test/monkey" endpoint. #2269
|
||||
- "GET /api/test/log" endpoint. #2269
|
||||
|
||||
### Fixed
|
||||
- A bug in network map page that caused delay of telemetry log loading. #1545
|
||||
|
|
|
@ -31,7 +31,6 @@ from monkey_island.cc.resources import (
|
|||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||
from monkey_island.cc.resources.attack.attack_report import AttackReport
|
||||
from monkey_island.cc.resources.auth import Authenticate, Register, RegistrationStatus, init_jwt
|
||||
from monkey_island.cc.resources.blackbox.log_blackbox_endpoint import LogBlackboxEndpoint
|
||||
from monkey_island.cc.resources.blackbox.telemetry_blackbox_endpoint import (
|
||||
TelemetryBlackboxEndpoint,
|
||||
)
|
||||
|
@ -206,7 +205,6 @@ def init_restful_endpoints(api: FlaskDIWrapper):
|
|||
# API Spec: Fix all the following endpoints, see comments in the resource classes
|
||||
# Note: Preferably, the API will provide a rich feature set and allow access to all of the
|
||||
# necessary data. This would make these endpoints obsolete.
|
||||
api.add_resource(LogBlackboxEndpoint)
|
||||
api.add_resource(TelemetryBlackboxEndpoint)
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
from bson import json_util
|
||||
from flask import request
|
||||
|
||||
from monkey_island.cc.database import database, mongo
|
||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||
from monkey_island.cc.resources.request_authentication import jwt_required
|
||||
|
||||
|
||||
class LogBlackboxEndpoint(AbstractResource):
|
||||
# API Spec: Rename to noun, BlackboxTestsLogs or something
|
||||
urls = ["/api/test/log"]
|
||||
|
||||
@jwt_required
|
||||
def get(self):
|
||||
find_query = json_util.loads(request.args.get("find_query"))
|
||||
log = mongo.db.log.find_one(find_query)
|
||||
if not log:
|
||||
return {"results": None}
|
||||
log_file = database.gridfs.get(log["file_id"])
|
||||
return {"results": log_file.read().decode()}
|
Loading…
Reference in New Issue