fix(core): remove tracked BlockCypher API token from integration tests - #1477
Open
mertcano wants to merge 1 commit into
Open
fix(core): remove tracked BlockCypher API token from integration tests#1477mertcano wants to merge 1 commit into
mertcano wants to merge 1 commit into
Conversation
### 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].
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR addresses a high-severity secrets management vulnerability within the
corerepository. It removes a hardcoded BlockCypher API credential from tracked test files, eliminating unnecessary disclosure and the risk of unauthorized external API usage.Key Changes
lib/bitcoin_burner_test.go):os.Getenv("BLOCKCYPHER_API_KEY"))[cite: 43].t.Skip) if theBLOCKCYPHER_API_KEYis not provided at runtime, ensuring the test suite does not fail locally for contributors lacking external credentials[cite: 43].BlockCypherCheckBitcoinDoubleSpendassertions to pass the dynamically loadedblockCypherAPIKeyinstead of a static string[cite: 43].Validation & Testing
TestCheckDoubleSpendlocally, maintainers must now explicitly provide a validBLOCKCYPHER_API_KEYin their testing environment[cite: 43].