Skip to content

fix(core): remove tracked BlockCypher API token from integration tests - #1477

Open
mertcano wants to merge 1 commit into
deso-protocol:mainfrom
mertcano:mertcano-patch-1
Open

fix(core): remove tracked BlockCypher API token from integration tests#1477
mertcano wants to merge 1 commit into
deso-protocol:mainfrom
mertcano:mertcano-patch-1

Conversation

@mertcano

Copy link
Copy Markdown

Description

This PR addresses a high-severity secrets management vulnerability within the core repository. It removes a hardcoded BlockCypher API credential from tracked test files, eliminating unnecessary disclosure and the risk of unauthorized external API usage.

Key Changes

  • Secrets Management (lib/bitcoin_burner_test.go):
    • Replaced the directly committed BlockCypher token with an environment variable lookup (os.Getenv("BLOCKCYPHER_API_KEY"))[cite: 43].
    • Implemented a fail-safe fallback that cleanly skips the external integration test (t.Skip) if the BLOCKCYPHER_API_KEY is not provided at runtime, ensuring the test suite does not fail locally for contributors lacking external credentials[cite: 43].
    • Updated all BlockCypherCheckBitcoinDoubleSpend assertions to pass the dynamically loaded blockCypherAPIKey instead of a static string[cite: 43].

Validation & Testing

  • Reviewer Action Required: The previously committed BlockCypher API token remains in the Git history and must be revoked or rotated by the repository owners. To execute TestCheckDoubleSpend locally, maintainers must now explicitly provide a valid BLOCKCYPHER_API_KEY in their testing environment[cite: 43].

### Description
This PR addresses a high-severity secrets management vulnerability within the `core` repository. It removes a hardcoded BlockCypher API credential from tracked test files, eliminating unnecessary disclosure and the risk of unauthorized external API usage.

### Key Changes
* **Secrets Management (`lib/bitcoin_burner_test.go`):** 
  - Replaced the directly committed BlockCypher token with an environment variable lookup (`os.Getenv("BLOCKCYPHER_API_KEY")`)[cite: 43].
  - Implemented a fail-safe fallback that cleanly skips the external integration test (`t.Skip`) if the `BLOCKCYPHER_API_KEY` is not provided at runtime, ensuring the test suite does not fail locally for contributors lacking external credentials[cite: 43].
  - Updated all `BlockCypherCheckBitcoinDoubleSpend` assertions to pass the dynamically loaded `blockCypherAPIKey` instead of a static string[cite: 43].

### Validation & Testing
* **Reviewer Action Required:** The previously committed BlockCypher API token remains in the Git history and must be revoked or rotated by the repository owners. To execute `TestCheckDoubleSpend` locally, maintainers must now explicitly provide a valid `BLOCKCYPHER_API_KEY` in their testing environment[cite: 43].
@mertcano
mertcano requested a review from a team as a code owner August 29, 2026 19:47
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.

1 participant