Commit Graph

3198 Commits

Author SHA1 Message Date
Anton Kolesnyk
8fdb1fcd57
Azure Core August Beta Release (#5858)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-08-01 14:11:08 -07:00
George Arama
e5f2cda065
remove const (#5869) 2024-08-01 20:57:05 +00:00
George Arama
20e3bd3ff4
Updates for the api review (#5861)
* update nemaspace usage

* updated based on PR comments
2024-08-01 00:48:07 +00:00
George Arama
34c2441523
Enable UseFederatedAuth by default (#5852)
* enable use federated

* 401 unauthorized

* 401

* cleanup readmes

* DISABLE RUN

* Remove UseFederatedAuth overrides from ci.yml

* DISABLE RUN for admin samples,
2024-07-31 17:10:39 -07:00
Anton Kolesnyk
2c0a35dad4
Undo unnecessary Core vcpkg dependency version bump (#5860)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-31 22:23:29 +00:00
Anton Kolesnyk
d32aab96eb
Acknowledge community contributions in changelogs (#5850)
* Acknowledge cusomer contributions

* Update cspell

* Add more contributors

* More cspell

* Update contributions

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-31 13:44:28 -07:00
Robert Schulze
401b97e0ac
Remove unneeded <regex> includes (#5851)
* Remove unneeded <regex> includes

* Fix build (hopefully)
2024-07-31 13:07:47 -07:00
George Arama
ec6a66d53e
Keyvault full backup/restore support (#5744)
* 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
2024-07-31 10:29:41 -07:00
Azure SDK Bot
ce0e7ced1d
update the migration script entrypoint to catch git config errors before the push happens (#5853)
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
2024-07-30 12:49:46 -07:00
Robert Schulze
6960ad1247
XML: Use RAII wrappers instead of manual memory management (#5767)
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Anton Popov <anton@clickhouse.com>
2024-07-30 09:48:48 +08:00
Anton Kolesnyk
0f62b3aa63
Add consumption-time value of __cplusplus to User-Agent (#5662)
* Add consumption-time value of __cplusplus to User-Agent

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-29 18:31:51 -07:00
arwell
46757b69b1
Fix exception when an int32 value comes from the json (#5781)
* Fix exception when an int32 value comes from the json

* Update serializers.cpp

Fix Pipeline errors

* Format using clang

* add more tests

---------

Co-authored-by: George Arama <gearama@microsoft.com>
2024-07-29 12:50:34 -07:00
Azure SDK Bot
3b6a7a80d5
updating the proxy certs (#5849)
Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
2024-07-28 13:01:49 -07:00
Azure SDK Bot
67f1632454
Change the daily docs branch name (#5847)
Co-authored-by: James Suplizio <jasupliz@microsoft.com>
2024-07-26 12:55:04 -07:00
Azure SDK Bot
7176808c7f
Add remaining preview/sov cloud sub configs to common dir (#5844)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
2024-07-24 12:38:54 -07:00
Ahson Khan
2c80cfba2b
Update storage service owners in CODEOWNERS (#5842) 2024-07-23 20:08:52 -07:00
microzchang
175a761dbb
Storage Fix live test failure (#5836) 2024-07-23 14:48:35 +08:00
Robert Schulze
6c9af55bae
Fix libcxx15 build (#5765) 2024-07-23 12:19:55 +08:00
Azure SDK Bot
cce5fc98a6
Increment package version after release of azure-identity (#5835) 2024-07-22 20:26:28 -07:00
Ahson Khan
b1674473eb
Prepare for the July Identity beta release. (#5770)
* Prepare for the July Identity beta release.

* Update release date.

* Update CL - remove empty headings.
2024-07-22 19:06:04 -07:00
Ahson Khan
193bbe6963
Add support for providing a Resource ID to ManagedIdentityCredential. (#5832)
* Add support for providing a Resource ID to ManagedIdentityCredential.

* Fix typo in param name.

* Fix clang format and undo removing of private methods (that are unused).

* Address PR feedback.

* Add back Azure:: to fix doxygen docs issue.
2024-07-22 19:00:13 -07:00
Ahson Khan
00304a0556
Add support for customizing the IMDS endpoint within ManagedIdentityCredential using an env var. (#5834)
* Add support for customizing the IMDS endpoint within
ManagedIdentityCredential using an env var.

* Clean up the impl.

* Add imds as an opt-out for spell checl.

* Address PR feedback.
2024-07-22 18:27:16 -07:00
Wes Haggard
c32fd0dc80
Explicitly install python (#5833)
Looks like the latest windows image failed to have python installed. So explicitly installing it.
2024-07-22 15:19:42 -07:00
JinmingHu
4dd4b18af9
UseFederatedAuth storage test (#5810) 2024-07-20 02:00:18 +00:00
Ahson Khan
bbc5a307a8
Update live.tests.yml samples display name to be shorter. (#5828) 2024-07-19 14:24:22 -07:00
Azure SDK Bot
522b25508d
Sync eng/common directory with azure-sdk-tools for PR 8650 (#5812)
* missed a condition passthrough

---------

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com>
2024-07-19 13:44:47 -07:00
Larry Osterman
ab777719ea
Fix credentials used for eventhubs admin tests. Fixes #5820 (#5825)
* Log credential creation


* Fail on exception after dumping it
2024-07-19 13:44:04 -07:00
Azure SDK Bot
0ec395d016
Add Azure Health Data Service product slug (#5831)
Co-authored-by: Scott Addie <scott.addie@microsoft.com>
2024-07-19 13:40:59 -07:00
Scott Addie
4b8d7a05e0
Reformat DefaultAzureCredential flow chart (#5829) 2024-07-18 22:50:26 +00:00
Wes Haggard
3329e9d854
Update Preview Test Sub to use new connection (#5826)
In order to get both deployment and clean-up working we need to have a connection that points at the right subscription. Today azure-sdk-tests points to the name Test Sub but I created azure-sdk-tests-preview connection which points to the Preview Test Sub.

This will fix the clean-up step which is currently failing for things deployed in Preview.
2024-07-18 15:20:39 -07:00
Ahson Khan
9b9f76a737
Re-enable running previously disabled samples using AzureCliCredential. (#5818)
* 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.
2024-07-18 14:45:27 -07:00
Azure SDK Bot
e67bcaa558
Sync eng/common directory with azure-sdk-tools for PR 8602 (#5801)
* add additional argument to Save-Package-Properties to allow for usage in pull request context

---------

Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
2024-07-18 11:44:18 -07:00
Azure SDK Bot
01263ec39b
Increment version for storage releases (#5808)
* Increment package version after release of azure-storage-common

* Increment package version after release of azure-storage-blobs

* Increment package version after release of azure-storage-files-datalake

* Increment package version after release of azure-storage-files-shares

* Increment package version after release of azure-storage-queues
2024-07-18 16:55:22 +08:00
Rick Winter
21b4db68f6
Update CODEOWNERS_baseline_errors.txt (#5806)
Update CODEOWNERS
2024-07-17 13:58:56 -07:00
Larry Osterman
90089ad326
Cleaned up Azure::Core::Context API surface (#5676)
* 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>
2024-07-17 12:38:30 -07:00
Larry Osterman
2b987eeed8
Improve code coverage numbers by excluding some options (#5805)
* Potentially improve code coverage numbers by excluding some options

* Removed dead lines; replicated switches to both gcovr executions

* added link to gcovr branch coverage faq
2024-07-17 18:36:10 +00:00
Rick Winter
5f71ab8515
Ignore spelling in the CODEOWNER baseline (#5811) 2024-07-17 17:59:26 +00:00
microzchang
fbccfdd758
Storage July Release (#5753)
* Storage July Release

* Update release date
2024-07-17 17:26:41 +08:00
microzchang
60fbccf8c0
Storage Fix AccessType live test failure (#5807)
* Fix live test failure

* update datalake tests
2024-07-17 17:26:21 +08:00
Ahson Khan
b9c776c9ff
Update link in README.md to fix link verification issue. (#5804) 2024-07-16 13:13:14 -07:00
Larry Osterman
e19dc2371c
Use GetTestCredentials in eventhubs admin client; updated samples to allow sample execution to be disabled (#5799)
* 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
2024-07-16 10:29:54 -07:00
Ahson Khan
7e9906f884
Added ClientAssertionCredential to enable applications to authenticate with custom client assertions. (#5789)
* Added `ClientAssertionCredential` to enable applications to authenticate with custom client assertions.

* Rename test file.

* Update client assertion credential tests.

* Fix typo.

* Address PR feedback - pass in function by value and some comment fixup.

* Update log messages to use credential name as a prefix.
2024-07-15 19:30:56 -07:00
Anton Kolesnyk
e47e3168fe
Acknowledge community contribution in the changelog (#5797)
* Mention community contribution in the changelog

* cspell

* Remove double spaces

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-15 18:45:06 +00:00
Azure SDK Bot
fb6c039f5e
Increment package version after release of azure-core (#5794) 2024-07-12 21:34:14 +00:00
Azure SDK Bot
ae14b41e8e
Sync eng/common directory with azure-sdk-tools for PR 8598 (#5777)
* Set storage account test resources to disable blob public access

* Skip adding network rules to storage accounts that don't need them during cleanup

* Add succeeded check to set pipeline subnet info step

* Disable network firewall by default in resource creation/removal

---------

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
2024-07-12 17:15:32 -04:00
Anton Kolesnyk
6b9e1cc691
Revert commits related to the new RetryPolicy method (#5793)
* Revert "Update the RetryPolicy for the GA release, keeping ShouldRetry extension point hidden. (#5771)"

This reverts commit 9ccd206ff8.

* Revert "Update the RetryPolicy and ShouldRetry customization logic to allow loosening the retry condition. (#5656)"

This reverts commit f1d95520d1.

* Do not remove changelog entry from a previous beta release

* Revert "Add a virtual ShouldRetry method to the RetryPolicy for customization. (#5584)"

This reverts commit ab90ef68b0.

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-12 12:03:43 -07:00
Anton Kolesnyk
e8c7c559d9
Azure Core July GA Release (#5792)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2024-07-12 10:24:12 -07:00
Ahson Khan
9ccd206ff8
Update the RetryPolicy for the GA release, keeping ShouldRetry extension point hidden. (#5771)
* Update the RetryPolicy for the GA release, keeping ShouldRetry extension
point hidden.

* Mark test helper virtual functions private, so they aren't
accessible/callable by callers.

* Update the changelog.

* Update CL.
2024-07-11 17:39:37 -07:00
George Arama
313fb0e58f
Move tests to use azure pipeline credentials (#5754)
* 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>
2024-07-11 17:38:19 -07:00
Ahson Khan
aadeca2c5c
Turn federated auth on for Identity tests. (#5785)
* Turn federated auth on for Identity tests.

* Update test resources json.
2024-07-12 00:00:15 +00:00