You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defer proxy-file loading until AsyncFetcher first needs proxies
cache proxy configuration after first access
add filesystem and in-memory credential adapters
migrate Brave credential lookup to the injectable boundary
document the boundary rationale and link Brave's first-party query API
Why
Importing core code previously read proxy configuration immediately, and provider constructors reached directly into global filesystem-backed credential state. Those hidden reads made imports depend on an operator's machine and made isolated tests and embedded use harder.
Production lookup behavior and directory precedence remain unchanged. Brave is the single tracer implementation; this PR does not introduce a broader configuration framework.
This is the upstream version of NotoriousRebel/theHarvester#84, replayed onto laramies/theHarvester:dev as a clean focused branch.
Validation
12 focused tests passed
Ruff check and format passed for changed implementation files
mypy passed
patch equivalence against the reviewed fork PR was confirmed with git range-diff
Please preserve the existing Core.brave_key() accessor. The dev base exposes this method, but this PR removes it even though the stated contract says production lookup behavior remains unchanged. Existing integrations or tests that call Core.brave_key() will fail with AttributeError after the merge.
Recommended change: retain Core.brave_key() as a compatibility wrapper (it can delegate through the filesystem credential adapter) and add a regression test asserting that the accessor remains available and returns the configured Brave key.
As a non-blocking design improvement, consider expressing CredentialAdapter as a Protocol with get(provider, field) rather than a union of the two bundled implementations. The current union makes the runtime boundary injectable but causes static type checkers to reject compatible third-party adapters.
This PR also conflicts directly with #2406 in discovery/bravesearch.py. I recommend landing this configuration boundary first, then rebasing #2406 so its logging conversion is applied to the adapter-based implementation without reintroducing direct print() calls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AsyncFetcherfirst needs proxiesWhy
Importing core code previously read proxy configuration immediately, and provider constructors reached directly into global filesystem-backed credential state. Those hidden reads made imports depend on an operator's machine and made isolated tests and embedded use harder.
Production lookup behavior and directory precedence remain unchanged. Brave is the single tracer implementation; this PR does not introduce a broader configuration framework.
This is the upstream version of NotoriousRebel/theHarvester#84, replayed onto
laramies/theHarvester:devas a clean focused branch.Validation
git range-diff