31 Commits
Author SHA1 Message Date
dextmorgnandGitHub 48d1df13d6 Merge pull request #185 from rachit367/feat/detect-file-hashes
feat(types): detect MD5/SHA1/SHA256 file hashes on import
2026-06-20 17:50:13 +02:00
rachit367 2e12e42bba feat(types): detect MD5/SHA1/SHA256 file hashes on import
TXT imports of file hashes were detected as Username, because File.detect
always returned False and Username.detect matches any 3-80 char
alphanumeric string. Hashes therefore couldn't be used as File entities
to pivot from (VirusTotal, MalwareBazaar, sandboxes), per #45.

- File.detect now recognizes 32/40/64-char hex strings (MD5/SHA1/SHA256),
  and File.from_string stores the value in the matching hash_* field
  (normalized to lowercase) while keeping it as the filename/label.
- Username.detect now explicitly rejects hash-shaped strings, so hash
  detection is correct regardless of type-registration order (File is
  already registered before Username, but this removes the implicit
  dependency).

Tests cover detection of each hash type (case/whitespace), rejection of
non-hashes, from_string field population, the Username regression, and
end-to-end detect_type() resolution to File.

Closes #45
2026-06-09 11:30:37 +05:30
dextmorgn 612d39eadf test: provide dummy Neo4j credentials in conftest
Any code path reaching the Neo4jConnection singleton requires NEO4J_*
env vars at construction — tests only passed thanks to developers'
local .env files. Driver creation is lazy, nothing connects.

Verified by running all four suites with every .env removed:
458 passed.
2026-06-05 15:34:58 +02:00
dextmorgn dc36ef633e test(core): factor out env-independent no-connection repo setup
Previous fix covered one occurrence; 17 other tests built
Neo4jGraphRepository(neo4j_connection=None), hitting the singleton
fallback that requires NEO4J_* env vars. Single helper, no env
dependency left.
2026-06-05 15:26:08 +02:00
dextmorgn 22c6908a0e test(core): stop relying on env credentials in no-connection test
Neo4jGraphRepository(neo4j_connection=None) falls back to the
Neo4jConnection singleton, which requires NEO4J_* env vars — the test
only passed locally thanks to .env. Pass a mock instead; the test
nulls _connection right after anyway.
2026-06-05 15:17:37 +02:00
Melih Daskiran 25eb3a0400 Fix zip alignment mismatch, phone validation return value, and vault owner_id type matching 2026-06-04 21:46:44 +03:00
Mubashir RahimandClaude Opus 4.8 1fdbdbd094 fix(import): preserve apostrophes in valid JSON imports
parse_json unconditionally replaced every single quote with a double
quote (`.replace("'", '"')`) before calling json.loads. This corrupted
any valid JSON string value containing an apostrophe, e.g. a person's
surname "Sarah O'Brien" became "Sarah O"Brien", causing the parse to
fail with "Invalid JSON" and the whole import to be rejected.

Parse strict JSON first so well-formed payloads (including apostrophes
in string values) import correctly, and only fall back to the lenient
single-quote replacement for Python-dict-style payloads that are not
valid JSON on their own.

Adds regression tests covering an apostrophe-bearing JSON value and the
retained single-quoted fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 14:34:22 +05:00
Ghraven 60cfa16b8d fix: use aware timestamp for investigation updates 2026-06-03 08:37:45 +08:00
Ghraven b707961e68 fix: use timezone-aware service timestamps 2026-05-31 02:35:11 +08:00
dextmorgn 8cd6b237bb fix(core/tests): update failing test 2026-04-11 14:44:29 +02:00
gustavorps a574d4ebea feat(core): soft delete 2026-02-20 15:41:46 -03:00
dextmorgn 07f32c983a feat: use ai sdk useChat 2026-02-12 22:04:21 +01:00
dextmorgn a461f9997d feat: progress on enricher templates 2026-02-12 22:03:28 +01:00
dextmorgn 5ff6ba2b1c feat(core): enrichers from templates 2026-02-12 22:03:04 +01:00
dextmorgn 327123a729 feat(core): template enricher v1 2026-02-12 22:03:03 +01:00
dextmorgn 2bb1fdbfc1 feat(core): enricher template 2026-02-12 22:03:03 +01:00
dextmorgn dd0c53f089 feat(core): use repositories in services 2026-02-07 17:22:51 +01:00
dextmorgn c8085c6400 test(core): update test 2026-01-24 19:31:12 +01:00
dextmorgn 3c6a23ebfa feat(core): refactor Neo4jDict to GraphDict 2026-01-22 09:41:01 +01:00
dextmorgn 3c39f9aeb7 feat(core): cleaner code separation + usage of nodeLabel
- big refactor to properly use GraphService, and enforce dependency injection

BREAKING CHANGE: The usage of node.label is no longer supported in the app, a specific node format
is used throughout the app and for inserting in the neo4j.
2026-01-21 17:17:13 +01:00
dextmorgn baa344f364 feat(core): add json import support 2026-01-10 18:07:33 +01:00
dextmorgn 7562da12a6 feat(core): only support pydantic object insert and manipulation 2025-12-05 15:45:23 +01:00
dextmorgn 901ed15567 feat(core): update dependencies + orchestrator 2025-11-30 12:49:24 +01:00
dextmorgn 95add9c4fd feat(core): type registry + better import 2025-11-28 20:07:48 +01:00
dextmorgn 2123ea5b8d feat: complete refactor 2025-11-27 17:16:41 +01:00
dextmorgn 306b2958ba feat: parse httpUrl on db insert 2025-11-20 17:59:47 +01:00
dextmorgn ade74800aa feat: minifiy transform logic 2025-11-20 10:59:18 +01:00
dextmorgn 7b91bb2442 feat: type validation + simplified transform system 2025-11-19 22:13:38 +01:00
dextmorgn f616b84785 refactor(core): vault tests in dedicated folder 2025-11-05 15:39:11 +01:00
dextmorgn 0f39813c9c feat(core): import data + tests 2025-11-05 15:38:25 +01:00
dextmorgn 894d6c0674 fix(core): keys for transforms are now only fetched from vault 2025-11-01 12:51:32 +01:00