* Docs links coversion: docs.microsoft.com -> learn.microsoft.com
Some markdown formatting
* Adding "msrc" to cspell words
* Undoing things auto formatter did
* Appling Ahson's suggestions
* first build pass
* move models
Refactor KeyVault backup/restore client
This commit represents a significant refactoring of the Azure Security KeyVault Administration client library, transitioning from a generic `KeyVaultClient` to a more specialized `BackupRestoreClient`. The refactoring includes:
- Renaming `KeyVaultClient` to `BackupRestoreClient` in both `backup_restore_client.hpp` and `backup_restore_client.cpp` to better reflect the focused functionality on backup and restore operations.
- Moving model definitions from `backup_restore_client.hpp` to `rest_client_models.hpp`, including structures for errors, full backup, restore, and selective key restore operations, along with their options. This change centralizes model definitions for improved maintainability and reuse across the client library.
- Updating method implementations in `backup_restore_client.cpp` to align with the `BackupRestoreClient` class name and its specialized backup and restore operations.
These changes aim to provide clearer separation of concerns within the library, making it more manageable and focused on backup and restore functionalities for Azure KeyVault.
* Add BackupRestoreClient with tests and options
This commit introduces the BackupRestoreClient for Azure Key Vault backup and restore operations, along with BackupRestoreClientOptions for configuration. Significant refactoring within the Azure::Security::KeyVault::Administration namespace simplifies namespace usage by directly using `using namespace Models;`. The BackupRestoreClient has been enhanced with a new constructor accepting `vaultUrl`, a `TokenCredential` shared pointer, and optionally `BackupRestoreClientOptions`. Additionally, a copy constructor and a default destructor have been added, alongside a private member `m_apiVersion` for API version management.
The BackupRestoreClientOptions struct extends Azure::Core::_internal::ClientOptions with an `ApiVersion` member initialized to "7.5". Changes in the implementation file include additional headers for internal use and authentication, and updates to the constructor for initializing member variables and setting up the HTTP pipeline.
Test infrastructure has been enhanced with modifications in `CMakeLists.txt` to include test source files, the introduction of a base test class `BackupRestoreClientTest` for setup, and a test case `CreateClient1` demonstrating client creation.
These changes collectively enhance the Azure Key Vault Administration library by adding a new client for backup and restore operations, improving code organization, and setting up a testing framework.
* Enhance BackupRestoreClient and tests
This commit significantly updates the BackupRestoreClient and its associated models, introducing new features for backup and restore operations, and improving error handling with a new Error model. The `BackupRestoreClient` class has been marked as `final` to prevent inheritance, and several new methods such as `FullBackup`, `FullBackupStatus`, `FullRestore`, `RestoreStatus`, and `SelectiveKeyRestore` have been added, along with corresponding data models in `rest_client_models.hpp`. These changes enhance the client's functionality and API clarity. Additionally, the test infrastructure has seen substantial improvements, including refactoring in `backup_restore_client_base_test.hpp` for better encapsulation and updated utility methods for more effective testing. The practical application of these enhancements is demonstrated in `backup_restore_client_test.cpp` through the `CreateClient1` test case, showcasing the use of the `FullBackup` method. Overall, these updates bolster the Azure Key Vault Backup and Restore client library's capabilities and test support.
* Enhance BackupRestoreClient for Azure backups
- Updated `BackupRestoreClient` to support full backups and restores using Azure blob storage SAS tokens, including changes to method signatures for SAS token and job identifier parameters.
- Introduced nullable types for `StatusDetails` and `Error` in operation models to handle optional response fields.
- Removed `FullBackupOptions`, `FullRestoreOperationOptions`, and `RestoreStatusOptions` structures in favor of direct parameter usage in methods.
- Refined HTTP request construction to include necessary headers and dynamically set API version.
- Updated JSON parsing logic to handle nullable fields and adapt to changed response JSON structure.
- Enhanced test infrastructure with methods for creating test-configured `BackupRestoreClient` and generating SAS tokens for backups. Added new tests for full backup, backup status, full restore, and restore status functionalities.
- Adjusted URL path construction and query parameter setting in HTTP requests for updated API endpoints and parameters compatibility.
* Refine SelectiveKeyRestore API and tests
This commit overhauls the SelectiveKeyRestore function in the Azure Key Vault Backup and Restore client library. The function signature in `backup_restore_client.hpp` has been updated to replace the `SelectiveKeyRestoreOperationOptions` parameter with two distinct parameters: `keyName` (std::string) and `restoreBlobDetails` (SelectiveKeyRestoreOperationParameters). This change enhances the API's clarity and usability by explicitly requiring the key name and restore blob details for the operation.
Additionally, the `SelectiveKeyRestoreOperationOptions` structure has been removed from `rest_client_models.hpp`, aligning with the shift towards using direct parameters for the selective key restore operation. Corresponding implementation adjustments in `backup_restore_client.cpp` include changes to request URL and JSON body construction, as well as improved error handling in response parsing.
The test suite in `backup_restore_client_test.cpp` has also been updated. The `CreateClient1` test case was removed, and a new test case, `RestoreSelectiveStatus`, was added to demonstrate the updated API's functionality through a full backup and selective key restore operation scenario.
These changes collectively improve the API's intuitiveness and demonstrate its practical application through updated test cases.
* oops
* fds
* negative tests
Enhance backup/restore tests and cleanups
- Added a new test case `BackupFullErrorStatus` to the `BackupRestoreClientTest` suite to simulate a full backup operation with an invalid URI and verify the transition of backup status from "InProgress" to "Failed" with detailed error status.
- Refined the `RestoreFull` test case by removing unnecessary line breaks, improving code formatting without affecting functionality.
- Adjusted formatting in the `RestoreFullStatus` test by removing unnecessary braces and line breaks, streamlining the code.
- Improved readability in the `RestoreSelectiveStatus` test by adding a space after a comma.
- Introduced a new test case `RestoreSelectiveInvalidKeyStatus` to test the system's handling of invalid key restore requests, ensuring error reporting is accurate when keys or their versions are not found.
* recordings and pipeline
* linux build issues
* comment
* parse the error type
* fix paths
* ewrwe
* fdss
* reencode ansi
* fdsfsd
* Enhance samples and refine project structure
- Adjusted `CMakeLists.txt` for better project clarity, moving `BUILD_SAMPLES_HSM` from `test/samples` to `samples` and adding new sample directories for backup and restore functionalities.
- Updated `sample1_administration.cpp` to use `Azure::Core::_internal::Environment::GetVariable` for environment variable access and removed settings management code to focus on specific functionalities.
- Added new sample applications `sample2_full_backup_restore.cpp` and `sample3_backup_selective_restore.cpp` demonstrating full and selective backup and restore operations using the Azure Key Vault administration client library, including detailed steps and error handling.
- Included `CMakeLists.txt` for each new sample, specifying C++ standards and linking necessary libraries, with a focus on ease of use and configuration through the inclusion of `get-env-helper`.
* restore sample 1
* attempt reformat doc
* gfddgdf
* attempt 2
* are you serious ?
* treter
* docs
* typo
* changelog
* doc
* KHlAAAAAAAAAAANg said Kirk
* error check
* Updates to API
* clangs
* test new macro use in cmake file
* clang again
* missing include
* update1
* LROs
* clang 11
* attempt2
* fhkwerjhfkj
* documentation
* attempt++
* separating the op in its own files
* clang
* docs ++
* docc +++
* clang
* typo
* slkjlkdsjflks
* rename to backupclient
* hoping it's building
* PR comments
* address magic param check
* assets update
* doxygen fixes
* enable doxygen errors now that doxygen is updated.
---------
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
* skeletor
* client
* rework
* all works plus test
* sample , self pr
* tests
* clang
* Mind your language .. Sir ...
* comments
* removed preprocessor directives
* removed template class
* dll clang
* Rick PR