feat: rename ip_to geolocation to ip_to_infos

This commit is contained in:
dextmorgn
2025-09-04 15:08:20 +02:00
parent 1d6ee46fb2
commit cce0e51faf
8 changed files with 25 additions and 18 deletions

View File

@@ -511,7 +511,7 @@ def process_node_data(node: Node, inputs: Dict[str, Any]) -> Dict[str, Any]:
"creation_date": "2020-01-01",
}
elif class_name == "GeolocationScanner":
elif class_name == "IpToInfosScanner":
# Geolocation scanner
outputs[output_name] = {
"country": "France",

View File

@@ -54,7 +54,7 @@ const GraphPanel = ({ graphData, isLoading }: GraphPanelProps) => {
const setFilters = useGraphStore(s => s.setFilters)
const filters = useGraphStore(s => s.filters)
const { actionItems, isLoading: isLoadingActionItems } = useActionItems()
const NODE_COUNT_THRESHOLD = settings.general.graphViewerThreshold.value
const NODE_COUNT_THRESHOLD = settings?.general?.graphViewerThreshold?.value || 1000
const { sketch } = useLoaderData({
from: '/_auth/dashboard/investigations/$investigationId/$type/$id',

View File

@@ -13,15 +13,18 @@ const DEFAULT_SETTINGS = {
description: "Display the MiniMap on the graph panel."
},
graphViewerThreshold: {
type: "number",
value: 1500,
min: 10,
max: 20000,
step: 5,
type: "select",
value: 800,
options: [
{ value: 100, label: "100" },
{ value: 400, label: "400" },
{ value: 800, label: "800" },
{ value: 2000, label: "2000" }
],
description: "Threshold to switch from general graph to less interactive but more performant) viewer."
},
},
},
graph: {
nodeSize: {
type: "number",

View File

@@ -15,7 +15,7 @@ from flowsint_transforms.domain.to_history import DomainToHistoryScanner
from flowsint_transforms.email.to_domains import EmailToDomainsScanner
from flowsint_transforms.individual.to_domains import IndividualToDomainsScanner
from flowsint_transforms.ip.to_domain import ReverseResolveScanner
from flowsint_transforms.ip.to_geolocation import GeolocationScanner
from flowsint_transforms.ip.to_infos import IpToInfosScanner
from flowsint_transforms.ip.to_asn import IpToAsnScanner
# ASN-related scanners
@@ -147,7 +147,7 @@ TransformRegistry.register(DomainToAsnScanner)
TransformRegistry.register(DomainToHistoryScanner)
# IP-related scanners
TransformRegistry.register(GeolocationScanner)
TransformRegistry.register(IpToInfosScanner)
TransformRegistry.register(IpToAsnScanner)
# ASN-related scanners

View File

@@ -374,6 +374,7 @@ class Scanner(ABC):
final_properties["sketch_id"] = self.sketch_id
final_properties["label"] = final_properties.get("label", key_value)
set_clauses = [f"n.{prop} = ${prop}" for prop in final_properties.keys()]
params = {key_prop: key_value, **final_properties}

View File

@@ -9,8 +9,8 @@ InputType: TypeAlias = List[Ip]
OutputType: TypeAlias = List[Ip]
class GeolocationScanner(Scanner):
"""[ip-api.com] Get geolocation data for IP addresses."""
class IpToInfosScanner(Scanner):
"""[ip-api.com] Get information data for IP addresses."""
# Define types as class attributes - base class handles schema generation automatically
InputType = List[Ip]
@@ -18,7 +18,7 @@ class GeolocationScanner(Scanner):
@classmethod
def name(cls) -> str:
return "ip_to_geolocation"
return "ip_to_infos"
@classmethod
def category(cls) -> str:
@@ -131,5 +131,5 @@ class GeolocationScanner(Scanner):
return {}
InputType = GeolocationScanner.InputType
OutputType = GeolocationScanner.OutputType
InputType = IpToInfosScanner.InputType
OutputType = IpToInfosScanner.OutputType

View File

@@ -1,7 +1,7 @@
from flowsint_transforms.ips.geolocation import GeolocationScanner
from flowsint_transforms.ips.geolocation import IpToInfosScanner
from flowsint_types.ip import Ip, Ip
scanner = GeolocationScanner("sketch_123", "scan_123")
scanner = IpToInfosScanner("sketch_123", "scan_123")
def test_preprocess_valid_ips():

View File

@@ -16,3 +16,6 @@ export function deepObjectDiff(obj1, obj2) {
return diffObject
}
const diffObject = deepObjectDiff({ key1: "value1", key2: "value2" }, { key1: "value1", key2: "value3", key3: "value4" })
console.log(diffObject)