Skip to content

fix: Move URL from secrets.toml to config.toml for asset upload feature - BED-9063 - #63

Closed
StranDutton wants to merge 2 commits into
mainfrom
fix/BED-9063-bloodhound-asset-upload-config-split
Closed

fix: Move URL from secrets.toml to config.toml for asset upload feature - BED-9063#63
StranDutton wants to merge 2 commits into
mainfrom
fix/BED-9063-bloodhound-asset-upload-config-split

Conversation

@StranDutton

@StranDutton StranDutton commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

BED-9063: Split BloodHound asset upload config between config.toml and secrets.toml

Context

BED-8838 moved the BHE URL out of secrets.toml into config.toml for the scheduler/collection destination (destination.bloodhoundenterprise), but missed the CLI Asset Upload destination (destination.bloodhound), which still required url as a secret.

Changes

  • destinations/bloodhound/destination.py: url param on saved_searches and privilege_zones now resolves via dlt.config.value instead of dlt.secrets.value. token remains dlt.secrets.value.
  • core/convert.py: Removed dead code left over from an abandoned first implementation — the Credentials dataclass, Converter._credentials property, and the unused self.client / self.upload_id attributes (and their now-unused BloodHound import). These referenced a client that was never actually instantiated; the real ingest path uses BloodHoundEnterprise via the @dlt.destination function pattern.

Important

Please open a related PR for an update to the offical BloodHound documentation!

Testing

  • Full pytest suite run
  • Backwards-compatibility check: manually verified that dlt.config.value still resolves url if a user's secrets.toml still has it there.

Summary by CodeRabbit

  • Bug Fixes
    • Improved BloodHound destination configuration so connection URLs are sourced consistently from application configuration.
  • Refactor
    • Removed obsolete credential handling from the conversion workflow, simplifying how connection details are prepared.
    • Kept conversion behavior the same, including choosing between enterprise ingest and file output based on the selected method.

@StranDutton StranDutton self-assigned this Jul 27, 2026
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The converter no longer defines BloodHound credentials or client state. BloodHound destination functions now default their URL from dlt.config.value.

Changes

BloodHound configuration

Layer / File(s) Summary
Move connection configuration to destinations
src/openhound/core/convert.py, src/openhound/destinations/bloodhound/destination.py
The converter’s BloodHound client and credentials are removed, and both destination URL defaults switch from dlt.secrets.value to dlt.config.value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • SpecterOps/OpenHound#57: Updates the BloodHound destination URL default from dlt.secrets.value to dlt.config.value.

Poem

I’m a rabbit hopping through config’s new lane,
Credentials leave the converter domain.
URLs bloom where destinations start,
Cleaner settings guide each part.
Thump, thump—less code to maintain!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: moving the upload URL from secrets.toml to config.toml.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/BED-9063-bloodhound-asset-upload-config-split

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openhound/destinations/bloodhound/destination.py`:
- Line 1: Restore the malformed import at the start of
src/openhound/core/convert.py by separating the module reference from the
logging import, ensuring convert.py contains a valid Python import statement and
can be loaded by both destinations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 179e67f9-d8ad-4ea6-8078-25ca2f41ac51

📥 Commits

Reviewing files that changed from the base of the PR and between d68e14b and c9d8534.

📒 Files selected for processing (2)
  • src/openhound/core/convert.py
  • src/openhound/destinations/bloodhound/destination.py
💤 Files with no reviewable changes (1)
  • src/openhound/core/convert.py

Comment thread src/openhound/destinations/bloodhound/destination.py Outdated
@StranDutton

Copy link
Copy Markdown
Contributor Author

Moving this work to /v0.2.13 branch, closing this PR

@coderabbitai coderabbitai Bot mentioned this pull request Jul 28, 2026
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.

2 participants