From eab2975133635f8bac9ef10021b54c02e46cfc6b Mon Sep 17 00:00:00 2001 From: wisdomfreak-1 Date: Sun, 19 May 2024 17:35:46 +0530 Subject: [PATCH] clean up --- routes/assets.py | 9 +-------- routes/certificates.py | 8 +------- routes/informational_vulnerabilities.py | 10 ---------- routes/network_information.py | 8 +------- routes/org.py | 8 +------- routes/phishing_domain.py | 8 +------- routes/secrets.py | 8 +------- routes/vulnerabilities.py | 9 +-------- 8 files changed, 7 insertions(+), 61 deletions(-) diff --git a/routes/assets.py b/routes/assets.py index 22e7480..4f6413f 100644 --- a/routes/assets.py +++ b/routes/assets.py @@ -9,14 +9,7 @@ from config.db import db, Assets_collection, Findings_collection router = APIRouter(prefix="/assets", tags=["assets"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] - + @router.get("/technologies_q", status_code=200) async def technologies_q(current_user: Annotated[User, Security(get_current_user, scopes=["admin", "read","write"])], org: str = Query(None, description="Organization name")): match_stage = {} diff --git a/routes/certificates.py b/routes/certificates.py index ff9e0d8..0ea6d6a 100644 --- a/routes/certificates.py +++ b/routes/certificates.py @@ -10,13 +10,7 @@ router = APIRouter(prefix="/certificates", tags=["certificates"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] + #table @router.get("/search", status_code=status.HTTP_200_OK) diff --git a/routes/informational_vulnerabilities.py b/routes/informational_vulnerabilities.py index bac6ba2..e882fd5 100644 --- a/routes/informational_vulnerabilities.py +++ b/routes/informational_vulnerabilities.py @@ -11,16 +11,6 @@ router = APIRouter(prefix="/infovulnerabilities", tags=["INFO Vul"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] - - #vulnerabilities_severity api route @router.get("/severity", status_code=status.HTTP_201_CREATED) diff --git a/routes/network_information.py b/routes/network_information.py index 5c94f18..5739d60 100644 --- a/routes/network_information.py +++ b/routes/network_information.py @@ -11,13 +11,7 @@ router = APIRouter(prefix="/network_information", tags=["network_information"]) #mongo connect client -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] + #table route diff --git a/routes/org.py b/routes/org.py index ca0c298..09d3c95 100644 --- a/routes/org.py +++ b/routes/org.py @@ -4,13 +4,7 @@ router = APIRouter(prefix="/org", tags=["org details"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] + @router.get("/organizations", status_code=status.HTTP_200_OK) async def get_organizations(): diff --git a/routes/phishing_domain.py b/routes/phishing_domain.py index 76fcc8f..770c175 100644 --- a/routes/phishing_domain.py +++ b/routes/phishing_domain.py @@ -10,13 +10,7 @@ router = APIRouter(prefix="/phishing_domain", tags=["phishing_domain"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] + #table @router.get("/search", status_code=status.HTTP_200_OK) diff --git a/routes/secrets.py b/routes/secrets.py index 63f3edd..d7e4ea6 100644 --- a/routes/secrets.py +++ b/routes/secrets.py @@ -10,13 +10,7 @@ router = APIRouter(prefix="/secrets", tags=["secrets"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] + @router.get("/total_count", status_code=status.HTTP_200_OK) async def total_count(current_user: Annotated[User, Security(get_current_user, scopes=["admin", "read","write"])], org: str = Query(None, description="Organization name")): diff --git a/routes/vulnerabilities.py b/routes/vulnerabilities.py index e69124f..bff345c 100644 --- a/routes/vulnerabilities.py +++ b/routes/vulnerabilities.py @@ -12,14 +12,7 @@ router = APIRouter(prefix="/vulnerabilities", tags=["vulnerabilities"]) -# client = MongoClient("mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.1") - - - -# #mongodb details -# db = client["mantis"] -# Assets_collection = db["assets_collection"] -# Findings_collection = db["findings_collection"] +