feat(mbe): Hide recovery APIs for mbe#85
Merged
pranavjain97 merged 2 commits intomasterfrom Jul 25, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Implements a recovery mode feature that allows administrators to control access to wallet recovery APIs through configuration. The feature adds a recoveryMode boolean flag that must be enabled for recovery operations to execute.
- Added
recoveryModeconfiguration option to both enclaved and master express configurations - Implemented recovery mode validation in wallet recovery handlers to prevent unauthorized access
- Added comprehensive test coverage for both enabled and disabled recovery mode scenarios
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/types/index.ts | Adds recoveryMode boolean property to BaseConfig interface |
| src/initConfig.ts | Implements recoveryMode configuration reading from RECOVERY_MODE environment variable |
| src/api/master/handlers/recoveryWallet.ts | Adds recovery mode validation to wallet recovery handler |
| src/api/master/handlers/recoveryConsolidationsWallet.ts | Adds recovery mode validation to consolidation recovery handler |
| src/api/master/handlerUtils.ts | Implements checkRecoveryMode utility function with error handling |
| src/tests/config.test.ts | Adds test for recovery mode configuration reading |
| src/tests/api/master/recoveryWallet.test.ts | Updates test config to enable recovery mode |
| src/tests/api/master/recoveryConsolidationsWallet.test.ts | Updates test config to enable recovery mode |
| src/tests/api/master/nonRecovery.test.ts | Adds comprehensive test suite for disabled recovery mode scenarios |
| src/tests/api/master/musigRecovery.test.ts | Updates test config to enable recovery mode |
Comments suppressed due to low confidence (2)
src/tests/api/master/nonRecovery.test.ts:101
- The test only verifies that an error occurs but doesn't validate the specific error message or type. Consider adding assertions to verify the exact error message matches the one thrown by checkRecoveryMode.
it('should fail to run recovery if not in recovery mode', async () => {
src/tests/api/master/nonRecovery.test.ts:137
- The test only checks the status code but doesn't validate the error message or details. Consider adding assertions to verify the response contains the expected error message from checkRecoveryMode.
it('should fail to run recovery consolidation if not in recovery mode', async () => {
824a322 to
9db337e
Compare
pranavjain97
previously approved these changes
Jul 24, 2025
| getAsUser: sinon.stub(), | ||
| register: sinon.stub(), | ||
| } as unknown as BitGoAPI; | ||
|
|
Contributor
There was a problem hiding this comment.
this shoudn't be needed; you can just create a bitgo instance. See this for eg.
Contributor
|
update conflicts. |
9db337e to
3fc3f3b
Compare
pranavjain97
approved these changes
Jul 25, 2025
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.
TASKS: WP-5318