Skip to content

Personal API keys (NARA, MuckRock, GovInfo env) still sent over Tor #131

Open

Description

@JordanCoin

Found 2026-11-06 during review of #129.

With network.tor: true the route notice says "via Tor, real IP hidden", but these personal credentials still travel with the request and tell the server who is asking:

  • OPENFOIA_NARA_API_KEY (records search/fetch -s nara)
  • OPENFOIA_MUCKROCK_TOKEN (MuckRock adapter)
  • OPENFOIA_GOVINFO_API_KEY env fallback in GovInfoAdapter.__init__ (govinfo.py ~69) on any path that passes api_key=None and is not get_adapter or crossref

#128 and #129 already withhold the configured records.api_data_gov_key over Tor and pass the literal DEMO_KEY. Apply the same rule to the three above: when egress.is_tor, do not send a personal credential; where the source needs one to work at all (NARA), say so and skip rather than deanonymize. Update the route notice to say "credentials withheld" when that happens. Tests per adapter with the env var set and a TOR policy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FWQw8DDrDZ2tFzswSSEtce

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions