fix(routers+imports): fix missing DetectionRule import and correct -> list return type annotations that actually return paginated dicts
Aegis CI / lint-and-test (push) Has been cancelled

This commit is contained in:
kitos
2026-06-11 13:22:51 +02:00
parent 6ca37f743f
commit 7ded48bdb7
7 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -190,7 +190,7 @@ def list_campaigns(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List campaigns with optional filters and pagination. """List campaigns with optional filters and pagination.
Args: Args:
+2 -2
View File
@@ -64,7 +64,7 @@ def list_defensive_techniques(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List all D3FEND defensive techniques with optional filters.""" """List all D3FEND defensive techniques with optional filters."""
# Return list_defensive_techniques_svc( # Return list_defensive_techniques_svc(
return list_defensive_techniques_svc( return list_defensive_techniques_svc(
@@ -102,7 +102,7 @@ def get_defenses_for_attack_technique_endpoint(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""Get all D3FEND defensive techniques mapped to a given ATT&CK technique.""" """Get all D3FEND defensive techniques mapped to a given ATT&CK technique."""
# Return get_defenses_for_attack_technique(db, mitre_id) # Return get_defenses_for_attack_technique(db, mitre_id)
return get_defenses_for_attack_technique(db, mitre_id) return get_defenses_for_attack_technique(db, mitre_id)
+3 -3
View File
@@ -80,7 +80,7 @@ def list_detection_rules(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List detection rules with optional filters and pagination.""" """List detection rules with optional filters and pagination."""
# Return list_rules( # Return list_rules(
return list_rules( return list_rules(
@@ -112,7 +112,7 @@ def get_detection_rules_for_template(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""Get detection rules associated with a test template.""" """Get detection rules associated with a test template."""
# Return get_rules_for_template(db, template_id) # Return get_rules_for_template(db, template_id)
return get_rules_for_template(db, template_id) return get_rules_for_template(db, template_id)
@@ -151,7 +151,7 @@ def get_detection_rules_for_test(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""Get detection rules relevant to a test, along with their evaluation results. """Get detection rules relevant to a test, along with their evaluation results.
Finds rules by matching the test's technique_id to detection rules, Finds rules by matching the test's technique_id to detection rules,
+1 -1
View File
@@ -97,7 +97,7 @@ def list_osint_items(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: user # Entry: user
user: User = Depends(get_current_user), user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List OSINT items with optional filters. """List OSINT items with optional filters.
Args: Args:
+1 -1
View File
@@ -87,7 +87,7 @@ def list_snapshots(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List coverage snapshots ordered by creation date (newest first).""" """List coverage snapshots ordered by creation date (newest first)."""
# Return list_snapshots_svc(db, offset=offset, limit=limit) # Return list_snapshots_svc(db, offset=offset, limit=limit)
return list_snapshots_svc(db, offset=offset, limit=limit) return list_snapshots_svc(db, offset=offset, limit=limit)
+2 -2
View File
@@ -62,7 +62,7 @@ def list_threat_actors(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""List threat actors with optional filters and pagination. """List threat actors with optional filters and pagination.
**Requires** authentication (any role). **Requires** authentication (any role).
@@ -138,7 +138,7 @@ def get_threat_actor_gaps(
db: Session = Depends(get_db), db: Session = Depends(get_db),
# Entry: current_user # Entry: current_user
current_user: User = Depends(get_current_user), current_user: User = Depends(get_current_user),
) -> list: ) -> dict:
"""Identify techniques of this actor that are NOT fully validated. """Identify techniques of this actor that are NOT fully validated.
**Requires** authentication (any role). **Requires** authentication (any role).
@@ -50,6 +50,7 @@ from sqlalchemy.orm import Session
# Import DataSource from app.models.data_source # Import DataSource from app.models.data_source
from app.models.data_source import DataSource from app.models.data_source import DataSource
from app.models.detection_rule import DetectionRule
from app.models.technique import Technique from app.models.technique import Technique
from app.services.audit_service import log_action from app.services.audit_service import log_action