Skip to content

Fix missing metadata.source_kind in exported JSON (#15)#16

Merged
p0dalirius merged 1 commit into
mainfrom
bugfix-export-metadata-source-kind
Jun 22, 2026
Merged

Fix missing metadata.source_kind in exported JSON (#15)#16
p0dalirius merged 1 commit into
mainfrom
bugfix-export-metadata-source-kind

Conversation

@p0dalirius

Copy link
Copy Markdown
Contributor

Linked Issue

Closes #15

Root Cause

The graph is built with NewOpenGraph("KeyCredentialBase"), which records the source kind, but it was serialized via og.ExportJSON(false). The boolean argument is includeMetadata; when false, OpenGraph.ExportJSON skips writing the top-level metadata object entirely. As a result every artifact was produced without the metadata.source_kind block that BloodHound uses to scope ingests.

Fix Description

Call og.ExportJSON(true) so the serializer emits the metadata sibling of graph with "source_kind": "KeyCredentialBase". This is the minimal change that restores the documented output shape; the rest of the export path is unchanged.

How Verified

Static: with includeMetadata == true, the guarded block at gopengraph/OpenGraph.go:577 writes graphData["metadata"] = {"source_kind": g.sourceKind}, and g.sourceKind is "KeyCredentialBase" from NewOpenGraph. go build ./... and go vet ./... pass.

Test Coverage

None: exercising the full export requires a live LDAP/AD target to populate the graph; the changed line is a one-argument flag whose downstream behavior is covered by gopengraph's own export tests.

Scope of Change

  • Files changed: main.go
  • Submodule pointer updated: no
  • Behavioral changes outside the bug fix: none

@p0dalirius
p0dalirius merged commit 8b3d4c2 into main Jun 22, 2026
8 checks passed
@p0dalirius
p0dalirius deleted the bugfix-export-metadata-source-kind branch June 22, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output JSON omits metadata.source_kind block

1 participant