Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: neo4j

dextmorgn65dacf09445d
diff --git a/flowsint-web/src/lib/actions/search.ts b/flowsint-web/src/lib/actions/search.ts
new file mode 100644
index 00000000..2915f836
--- /dev/null
+++ b/flowsint-web/src/lib/actions/search.ts
@@ -0,0 +1,31 @@
+'use server'
+import { createClient } from "@/lib/supabase/server";
+import { scans } from "@/lib/utils";
+export async function performSearch(values: string[], scan_name: string, sketch_id: string) {
+ const supabase = await createClient()
+ await supabase.auth.refreshSession()
+ const { data: { session } } = await supabase.auth.getSession();
+ const jwt = session?.access_token;
+ const scan = scans.find((s) => s.scan_name === scan_name)
+ if (!scan) {
+ throw Error(`Scanner "${scan_name}" was not found.`)
+ }
+ const url = `${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/scan`;
+ const body = JSON.stringify({
+ scanner: scan.scan_name,
+ sketch_id: sketch_id,
+ values: values
+ })
+ const response = await fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Authorization': `Bearer ${jwt}`,
+ "Content-Type": "application/json",
+ },
+ body
+ },
+ );
+ const resp = await response.json()
+ if (response.status !== 200) throw Error(`Error: received status ${response.status}`)
+ return { ...resp, status: response.status };
+}
\ No newline at end of file
diff --git a/flowsint-web/src/lib/actions/transform.ts b/flowsint-web/src/lib/actions/transform.ts
new file mode 100644
index 00000000..730b8bcc
--- /dev/null
+++ b/flowsint-web/src/lib/actions/transform.ts
@@ -0,0 +1,26 @@
+'use server'
+import { createClient } from "@/lib/supabase/server";
+export async function performTransform(values: string[], transform_id: string, sketch_id: string | null) {
+ const supabase = await createClient()
+ await supabase.auth.refreshSession()
+ const { data: { session } } = await supabase.auth.getSession();
+ const jwt = session?.access_token;
+ const url = `${process.env.NEXT_PUBLIC_DOCKER_FLOWSINT_API}/transforms/${transform_id}/launch`;
+ const body = JSON.stringify({
+ values: values,
+ sketch_id: sketch_id
+ })
+ const response = await fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Authorization': `Bearer ${jwt}`,
+ "Content-Type": "application/json",
+ },
+ body
+ },
+ );
+ const resp = await response.json()
+ console.log(resp)
+ if (response.status !== 200) throw Error(`Error: received status ${response.status}`)
+ return { ...resp, status: response.status };
+}
\ No newline at end of file