Commit Graph

19 Commits

Author SHA1 Message Date
gearama
45c02dc359
Kv cleanup (#6519)
* Certs stage1

* keys part 1

* screts part 1

* Keys part2

* keys step3

* QFT

* clang

* Preserve Cert order

* recored tests add checks for preserve
2025-04-14 10:46:16 -07:00
gearama
020ffec789
Certs update (#6507)
* generate code and build the generated code

* client

* update name

* put back things

* work in progress for get

* get and get version

* das

* issuer ops

* set/get/delete contacts

* backup restore

* Get /update policy

* purge

* get deleted

* Update props

* Merge cert

* import cert

* Create

* Start delete

* Recover

* Delete/Cacel op

* GetCertsProps

* Get versions

* get deleted certs

* getissuers

* some cleanup and tests all working

* samples

* test record

* PR build

* more PR stuffs

* PR update part i lost count

* clang

* Update sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-basic-operations/certificate_basic_operations.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-get-certificates/certificate_get_certificates.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/keyvault/azure-security-keyvault-certificates/samples/certificate-import-certificate/certificate_import_certificate.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/keyvault/azure-security-keyvault-certificates/test/ut/certificate_client_base_test.hpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* Update sdk/keyvault/azure-security-keyvault-certificates/test/ut/certificate_client_test.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* comments

* explicitly turn off

* friend comments

* clang

---------

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
2025-04-07 12:31:45 -07:00
gearama
da1f4c399f
Keys update (#6491)
* Generate files

* GetKey done

* Creates done

* GetDeletedKey

* StartDeleteKey

* StartRecoverDeleted

* backup/restore

* purge/rotate

* import

* update properties

* get/update rotation policy

* release key

* GetProps of keys

* GetVersions

* GetDeletedKeys

* remove test used for test

* cleanup tests

* remove some methods

* tests

* PR pipeline

* more PR

* fsdfs

* clang

* update to hsm

* PR comments

* PR

* rwe

* Rerecord for HSM and fix get

* gdf
2025-03-31 11:16:41 -07:00
gearama
125c305961
Keyvault Secrets remake (#6463)
* first stab at a client tsp /tspconfig scripts

* space

* updates to clientTSP

* update for latest specs for KV

* gfd

* gfd

* hghf

* dfgdf

* jhg

* oopsie

* comments

* headers

* clang & param

* coverage

* more comments not gened

* spell

* more comments

* regen for testing

* gfd

* gdf

* tretre

* update to use tsp client

* vcxvx

* fdsfsd

* fds

* round 2

* api view

* dsa

* rte

* update to use code injection

* clang and comments

* gfd

* updates

* clang

* fsd

* spell

* comments

* some cleanup

* first test passing

* dsa

* second test

* startdeletesecret

* update secret ptoeprties

* recover secret

* cleanup clang

* docs

* update recordings and clean up tests

* ggfd

* ooops

* samples build

* gdf

* samples run

* perf tests

* CLANG

* fds

* CLAAAAAAAAANG

* update to latest version of the TSPs

* update to latest codegen

* gdfgdf

* replace method

* client and stuffs

* PR comments

* remove security from path

* clang

* qfe

* gdf

* update to models and to the lastest codegen

* forgot cmake file

* Update sdk/keyvault/azure-security-keyvault-secrets/samples/sample1-basic-operations/sample1_basic_operations.cpp

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>

* test api view

* dfsfsd

* ccxcvx

* step1

* delete, and lor and paged

* all work

* works and serializers and test for them gone

* cleanup test files

* sample

* tests passing

* dfsfsd

* latest codegen

* after merge

* fsd

* gfd

* gfd

* ApiView

* move to _details namespace

* put back readme

* update readmes

* clang

* dfsd

* get rid of snippets, validation fails without explanation as to what the failure is

* update locations of methods tp cpp files

* format files

* cover

---------

Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
2025-03-14 13:46:49 -07:00
George Arama
d609c00412
Backup Tests redo PR (#5916)
* redo PR

* fdedws

* added logging
2024-08-15 23:13:21 +00: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
George Arama
3c7972b1cc
enable download live only tests (#5586) 2024-04-30 20:58:00 +00:00
Scott Beddall
fd021f468c
Pin Newest Version of test-proxy in CI (#5568)
* pin version to proxy with common sanitizers added
* fixes for keyvault, storage, core, other misc packages to deal with new common proxy version
2024-04-24 15:57:50 -07:00
George Arama
e2f0e0a50b
Liveonly tests , the cert was in another form in both of them… (#5520)
* 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>
2024-04-12 12:10:03 -07:00
George Arama
7cf80b5cf7
HSM Tests to run from recordings only (#5463)
* mroe quotes

* dssf

* qweqeqw

* record only

* remove HSM from live platform

* clangs

* weqw

* spellcheck

* oopsie daisy

* trigger storage

* undo changes

* part 2

* update tests

* ffds

* gfdg

* fgdgd

* skip tests

* clangs
2024-03-25 15:35:56 -07:00
George Arama
a733518306
Keyvault regen (#5445)
* mroe quotes

* dssf

* update to api version 7.5 , added field to key properties , regen tests

* update hsm location

* fds
2024-03-15 11:00:41 -07:00
Anton Kolesnyk
37060211b5
Fix malformed URL in KeyVault (#5129)
* Fix malformed URL in KeyVault

* Update changelog

---------

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2023-11-07 21:33:05 -08:00
George Arama
7946b83b9b
separate hsm tests from keys, and regen the tests (#4392)
* separate hsm tests from keys, and regen the tests

* adding assets

* cleanup includes

* clang and map

* hgghg
2023-03-08 11:19:50 -08:00
George Arama
e48cf92704
update to version 7.4 for admin. update tests (#4388) 2023-02-27 12:03:57 -08:00
George Arama
cc09902b17
rollback OKP change (#4271) 2023-01-24 15:44:19 -08:00
George Arama
275f6f8077
Okp (#4239)
* first pass

* part2

* part3

* part 5

* pre PR

* updated tests

* fix test

* clangs

* updated changelog
2023-01-13 11:00:46 -08:00
George Arama
41e3e89cf8
live settings tests (#4242)
* settings tests

* oops the other way around

* asstes

* sample and readm e

* try try again

* typo
2023-01-13 10:40:18 -08:00
George Arama
efee11268e
Settings API (#4210)
* 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
2023-01-11 10:55:15 -08:00
George Arama
ef4d41267f
Test proxy (#4118)
* start

* recording

* playback

* refactor, playback and record

* recordings for kv

* klklk

* open telemetry, identity

* attest

* all tests recorded except storage

* STORAGE RECORDINGDS

* some cleanup

* ignore result

* testproxy remade

* fiiine , do something with the result , goooosh

* install test proxy

* clang

* clang

* certs maybe

* cmake generate fix,

* start test proxy script

* start test proxy on env

* clang, move TP after build

* reregen

* certs

* sda

* dss

* allow insecure connections

* put back

* debug

* iuy

* try again

* ewew

* chmod

* try again

* update sanitizer

* output testproxy log

* sjhgasjgdajh

* folder

* worxy

* fix tests and log file

* format files

* clang format

* clang

* sa

* sa

* cleanup

* cspell

* oops

* remove redundant method

* tests

* put back original

* restore to 933486385a

* recordings

* remove storage values

* storage recordings

* disable non functioning tests

* remove core install of test proxy

* _LIVEONLY_ tests

* clang install when needed

* logs on condition

* skip tests

* revert cpp to original version

* quick test

* right that one

* one skip

* identity pushed

* maybe

* override

* clang

* clang

* attestetion

* keyvault

* reenable 20+ tests

* 5 tests left , lease related

* a bit of cleanup

* try now

* snitizers

* some fixes

* capitalization

* clang , cover, peakA

* WEIRD NAME THING ON WINDOWS

* storage recordings

* one more livee

* createappenddelete_liveonly

* CreateWithTags_LIVEONLY_

* try capitalization

* another onw

* maybe now

* all liveonly

* try restore before test

* typo

* condition

* clang and cc

* azure core ci

* qwqwq

* dsasdas

* cleanup1

* typo

* spaces

* cleanup2

* cleanup 3

* remove start proxy

* cleanup +1

* Update cmake-modules/TestProxyPrep.cmake

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Update eng/scripts/Start-TestProxy.ps1

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* Update eng/scripts/Stop-TestProxy.ps1

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

* PR comments

* clangs

* Update sdk/core/azure-core-test/src/test_proxy_policy.cpp

* build

Co-authored-by: Rick Winter <rick.winter@microsoft.com>
2022-12-13 10:58:19 -08:00