feat(#97): bind AdminClient::createSnapshot() and forceRecoveryWithDataLoss() (direct C API) - #106
Merged
Merged
Conversation
…ecovery_with_data_loss in AdminClient - NativeClient: declare fdb_database_create_snapshot() and fdb_database_force_recovery_with_data_loss() - AdminClient::createSnapshot(uid, snapCommand) with 32-hex-char UID validation and printable-ASCII command validation - AdminClient::forceRecoveryWithDataLoss(dcId) with token validation - AdminClient::forceRecovery() reimplemented on the direct C API call (alias of forceRecoveryWithDataLoss), no longer throws LogicException - Guarded destructive integration tests (FDB_ENABLE_DESTRUCTIVE_ADMIN_TESTS) - docs/admin.md and CHANGELOG.md updated
7 tasks
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.
Closes #97
What
fdb_database_create_snapshot()andfdb_database_force_recovery_with_data_loss().[0-9a-fA-F]{32}and the command against printable ASCII (0x20–0x7E, 1–256 bytes) before the FFI call.forceRecoveryWithDataLoss()) instead of throwingLogicException— this removes the last attempted special-key write for an operation the special-key space never supported ([Security] AdminClient writes unvalidated input into privileged special keys; several special-key paths unverified #43). The existingconfigure()LogicException behavior is unchanged.Tests
tests/Unit/AdminClientTest.php: UID/command/dcId validation rejection tests.tests/Integration/AdminInputValidationTest.php: force-recovery validation now exercises the new C-API path.tests/Integration/AdminDestructiveOperationsTest.php: destructive happy-path coverage, skipped unlessFDB_ENABLE_DESTRUCTIVE_ADMIN_TESTS=1(andFDB_DR_TARGET_DC_IDfor the actual recovery), sincecreate_snapshotrequires snapshot support and force recovery destroys data.Docs
docs/admin.md: Force Recovery section rewritten, new DR Snapshots section, validation-contract table and methods reference updated.CHANGELOG.md: Added + Changed entries under Unreleased.Verification
composer lintclean (PHPCS + Rector dry-run + PHPStan 9)composer test:unit: 562 tests OK (one pre-existing FFI::cast deprecation, unrelated)DirectoryTest::directoryInsidePartitionHasSingleContentPrefixreproduces on master and passes on retry.