* 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
* Re-enable running KeyVault samples on Ubuntu using AzureCliCredential.
* Re-enable running Attestation samples using AzureCliCredential.
* Re-enable running EventHubs samples using AzureCliCredential.
* Re-enable running Identity samples.
* Disable client_secret_credential_sample since it depends on env vars
that don't exist.
* Deprecated Azure::Core::ApplicationContext because its use is confusing and inconsistent with the original design.
---------
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
* Use GetTestCredentials in eventhubs admin client; updated samples to allow sample execution to be disabled
* Made sample execution optional
* re-enabled building keyvault samples
* Disabled RetrieveMultipleEvents test
* Disabled RetrieveMultipleEvents test
* Pull request feedback
* test1
* hgdfchg
* remove the remnants of azure client secret
* test KV with federated auth
* UseFederatedAuth
* fdsa
* kv template with managed
* try try again
* retry permissions
* add net acls
* blunt force replace the resource json
* put back stuff
* trey again with new method
* attempt
* missed something
* flip if else
* Temporarily use empty sub config file path for preview cloud
* remove client secret
* try to fix the identity tests
* live skip failing tests and return in samples
* samples for identity fix
* disable failing samples in identity
* fix winhttp failing test
* comment out code
* remove managed identity
* restore version from main
* revert readme changes
* PR comments
* test 2
* clang
* attempt default creds with pipeline chanined
* clangs
* identity test and clangs
* oops
* live
* cleanup
* reter
* test
* revert the DAC change
* missed one
* taking the samples to a farm upstate
* PR comments
* Fix bad merge
---------
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
* Move up macos and xcode version
* first pass
* to trigger builds, some other issue
* rewrwe
* Remove MSVC compiler warning suppressions in KeyVault
The code within the `mocked_transport_adapter_test.hpp` file, specifically within the `Azure::Security::KeyVault::Keys` namespace, has been updated. The `#if defined(_MSC_VER)` preprocessor directive along with its associated `#pragma warning(push)` and `#pragma warning(disable : 4996)` directives have been removed. The corresponding `#pragma warning(pop)` directive has also been removed. The lines of code that were between these preprocessor directives remain unchanged. These changes remove specific compiler warning suppressions for MSVC compilers, but do not alter the functional behavior of the code.
* dassa
* Add UseDotNet@2 where test proxy might run on a macos agent
* test CI
* fsd
* dasdas
* gregre
* gerregr
* ffdsfsd
* fwefew
* fewfwew
* reter
* fewfew
* fwefwe
* rewrw
* rwe
* temp move build step to exec faster
* gdfgd
* fsdfd
* fdsfs
* dgdf
* Roll forward instead of installing .NET 6
* remove manual install
* rewrew
* gfdffg
* rewrwe
* gfdgd
* fdsfs
* gfdgdf
* tertre
* dasda
* try http for test proxy
* revert readmes
* rew
* rew
* fdsfsd
* ewrew
* revert storages
* KV
* opentelemetry
* remove warnbing
* anton comments
* unit tests
* clangs
* clang
* comment out some asserts
* restore originals
* updated tests
* clangs
* restore cmake
* test
* Remove manual workaround (eng/common change fixes this)
* test2
* the fix doesn't work, need to put back
* Remove DOTNET_ROLL_FORWARD
* annotate macro , put back DOTNET_ROLL_FORWARD
* remove leftover files
* reww
* update changelog
* remove left over file
* remove some doxygen comments
---------
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
* Increment package version after release of azure-security-keyvault-certificates
* Increment package version after release of azure-security-keyvault-secrets
* Increment package version after release of azure-security-keyvault-keys
* Update release date and modify sections in CHANGELOG.md
This commit updates the release date for versions 4.3.0-beta.2 and 4.5.0-beta.2 in the CHANGELOG.md file from "Unreleased" to "2024-06-11". It also removes the "Features Added", "Breaking Changes", and "Bugs Fixed" sections for these versions. The "Other Changes" section has been updated to reflect the relocation of samples to the `samples` directory, updates to the `README.md` file, and updates to the samples.
* kashdhjlaks
* rewrwe
* Update sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
---------
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
* disable download tests , the cert was in another form in both of them, cleanup the recording
* tre
---------
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Update vcpkg portfile.cmake of sdk to add parameter HEAD_REF
* Update vcpkg portfile.cmake of sdk to use variable VERSION
* Update eng\scripts\Initialize-VcpkgRelease.ps1 regex for quoted REF
* Re-trigger CI
* Revert unnecessary change
---------
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Increment package version after release of azure-security-keyvault-keys
* Increment package version after release of azure-security-keyvault-secrets
* Increment package version after release of azure-security-keyvault-certificates
* Remove the use of ifdef for TESTING_BUILD in KeyVault clients, where they are not needed.
* Rename the TESTING_BUILD macro to be _azure_TESTING_BUILD to highlight this is internal only and reduce chances of collision.
* Update remaining macro names and add comments.
* Revert rename change which was using BUILD_TESTING cmake flag in source.
* All eng/ folder changes necessary to enable 1es-templates for the azure-sdk-for-cpp
* Includes updates to all ci.yml files to reflect new syntax requirements from 1es-template changes to archetype-sdk-client
* Revert "Remove the use of ifdef for TESTING_BUILD in KeyVault clients, where (#5406)"
This reverts commit 2d8c940f55.
* Revert "Rename the TESTING_BUILD macro to be _azure_TESTING_BUILD to highlight (#5390)"
This reverts commit 256c2df8b5.
* Revert "Use new macros in existing surface area, so that classes marked as final don't have virtual methods. (#5389)"
This reverts commit 3d7eaddb9d.
* Revert "For new surface area, classes marked as final should not have virtual methods. (#5331)"
This reverts commit ddd0f4bd07.
---------
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Use new macros in existing surface area, so that classes marked as final don't have virtual methods.
* Update doc comments.
* Use DOXYGEN_PREDEFINED to expand only the macros we want expanded.
* Add the compile definition for more projects.
* Address PR feedback.
* Make TestableTokenCache a friend class of TokenCache.
* Updated tests to support -UserAuth test resources switch to enable non-corpnet access.
* Try setting sample environment variables in sample script pipeline
* Increment package version after release of azure-security-keyvault-keys
* Increment package version after release of azure-security-keyvault-certificates
* Increment package version after release of azure-security-keyvault-secrets
* Increment package version after release of azure-security-keyvault-administration
* Fix spelling errors
* Exclusion list
* More updates for the exclusion list
* Even more updates for the exclusion list
* And even more updates for the exclusion list
---------
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* First cut at snippet generation - markdown files only for now.
* Removed trailing blank lines in updated file
* Use snippet generator for keyvault snippets
* Make vcpkg.json comment multiline
* Update core-opentelemetry tests to be able to compile with opentelemetry-cpp version 1.12.0
---------
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Move MHSM to region with more availability
Resolves#4613
* Trigger CI re-run
* Undo the trigger
---------
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
* Add a note to vcpkg manifest files that all changes made in the vcpkg repo alone might be lost.
* may => will
---------
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>