Skip to content

Commit c2f4db4

Browse files
vcolin7maorleger
andauthored
Updated service version to 7.3 and re-recorded tests for Key Vault libraries (Azure#27953)
* Updated service version to 7.3 and re-recorded tests for Key Vault Administration. * Updated service version to 7.3 and re-recorded tests for Key Vault Certificates. * Updated service version to 7.3 and re-recorded tests for Key Vault Secrets. * Updated service version to 7.3 and re-recorded tests for Key Vault Keys. * Re-generated implementation layer of Key Vault Administration. * Updated CHANGELOG files. * Added specific commit for link in swagger autorest.md file Co-authored-by: Maor Leger <[email protected]> * Fixed issues with test recordings in Key Vault Administration. * Fixed issues with test recordings in Key Vault Certificates. Refactored and reformatted test classes. * Fixed issues with test recordings in Key Vault Keys. Refactored and reformatted test classes. * Fixed issues with test recordings in Key Vault Secrets. Refactored and reformatted test classes. * Fixed build issue. * Fixed checkstyle issues. * Fixed failing KV Admin test. Co-authored-by: Maor Leger <[email protected]>
1 parent c343e66 commit c2f4db4

File tree

291 files changed

+33248
-53617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+33248
-53617
lines changed

sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 4.1.0-beta.6 (Unreleased)
44

55
### Features Added
6+
- Added support for service version `7.3`
67

78
### Breaking Changes
89

sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/KeyVaultAdministrationServiceVersion.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public enum KeyVaultAdministrationServiceVersion implements ServiceVersion {
1515
V7_2("7.2"),
1616

1717
/**
18-
* Service version {@code 7.3-preview}.
18+
* Service version {@code 7.3}.
1919
*/
20-
V7_3_PREVIEW("7.3-preview");
20+
V7_3("7.3");
2121

2222
private final String version;
2323

@@ -36,6 +36,6 @@ public String getVersion() {
3636
* @return The latest {@link KeyVaultAdministrationServiceVersion}.
3737
*/
3838
public static KeyVaultAdministrationServiceVersion getLatest() {
39-
return V7_3_PREVIEW;
39+
return V7_3;
4040
}
4141
}

sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultAccessControlClientImplBuilder.java

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
package com.azure.security.keyvault.administration.implementation;
66

7+
import com.azure.core.annotation.Generated;
78
import com.azure.core.annotation.ServiceClientBuilder;
89
import com.azure.core.http.HttpClient;
910
import com.azure.core.http.HttpHeaders;
1011
import com.azure.core.http.HttpPipeline;
1112
import com.azure.core.http.HttpPipelineBuilder;
13+
import com.azure.core.http.HttpPipelinePosition;
1214
import com.azure.core.http.policy.AddHeadersPolicy;
1315
import com.azure.core.http.policy.CookiePolicy;
1416
import com.azure.core.http.policy.HttpLogOptions;
@@ -26,32 +28,35 @@
2628
import java.util.HashMap;
2729
import java.util.List;
2830
import java.util.Map;
31+
import java.util.stream.Collectors;
2932

3033
/** A builder for creating a new instance of the KeyVaultAccessControlClient type. */
3134
@ServiceClientBuilder(serviceClients = {KeyVaultAccessControlClientImpl.class})
3235
public final class KeyVaultAccessControlClientImplBuilder {
33-
private static final String SDK_NAME = "name";
36+
@Generated private static final String SDK_NAME = "name";
3437

35-
private static final String SDK_VERSION = "version";
38+
@Generated private static final String SDK_VERSION = "version";
3639

37-
private final Map<String, String> properties = new HashMap<>();
40+
@Generated private final Map<String, String> properties = new HashMap<>();
3841

3942
/** Create an instance of the KeyVaultAccessControlClientImplBuilder. */
43+
@Generated
4044
public KeyVaultAccessControlClientImplBuilder() {
4145
this.pipelinePolicies = new ArrayList<>();
4246
}
4347

4448
/*
4549
* Api Version
4650
*/
47-
private String apiVersion;
51+
@Generated private String apiVersion;
4852

4953
/**
5054
* Sets Api Version.
5155
*
5256
* @param apiVersion the apiVersion value.
5357
* @return the KeyVaultAccessControlClientImplBuilder.
5458
*/
59+
@Generated
5560
public KeyVaultAccessControlClientImplBuilder apiVersion(String apiVersion) {
5661
this.apiVersion = apiVersion;
5762
return this;
@@ -60,14 +65,15 @@ public KeyVaultAccessControlClientImplBuilder apiVersion(String apiVersion) {
6065
/*
6166
* The HTTP pipeline to send requests through
6267
*/
63-
private HttpPipeline pipeline;
68+
@Generated private HttpPipeline pipeline;
6469

6570
/**
6671
* Sets The HTTP pipeline to send requests through.
6772
*
6873
* @param pipeline the pipeline value.
6974
* @return the KeyVaultAccessControlClientImplBuilder.
7075
*/
76+
@Generated
7177
public KeyVaultAccessControlClientImplBuilder pipeline(HttpPipeline pipeline) {
7278
this.pipeline = pipeline;
7379
return this;
@@ -76,14 +82,15 @@ public KeyVaultAccessControlClientImplBuilder pipeline(HttpPipeline pipeline) {
7682
/*
7783
* The serializer to serialize an object into a string
7884
*/
79-
private SerializerAdapter serializerAdapter;
85+
@Generated private SerializerAdapter serializerAdapter;
8086

8187
/**
8288
* Sets The serializer to serialize an object into a string.
8389
*
8490
* @param serializerAdapter the serializerAdapter value.
8591
* @return the KeyVaultAccessControlClientImplBuilder.
8692
*/
93+
@Generated
8794
public KeyVaultAccessControlClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
8895
this.serializerAdapter = serializerAdapter;
8996
return this;
@@ -92,14 +99,15 @@ public KeyVaultAccessControlClientImplBuilder serializerAdapter(SerializerAdapte
9299
/*
93100
* The HTTP client used to send the request.
94101
*/
95-
private HttpClient httpClient;
102+
@Generated private HttpClient httpClient;
96103

97104
/**
98105
* Sets The HTTP client used to send the request.
99106
*
100107
* @param httpClient the httpClient value.
101108
* @return the KeyVaultAccessControlClientImplBuilder.
102109
*/
110+
@Generated
103111
public KeyVaultAccessControlClientImplBuilder httpClient(HttpClient httpClient) {
104112
this.httpClient = httpClient;
105113
return this;
@@ -109,14 +117,15 @@ public KeyVaultAccessControlClientImplBuilder httpClient(HttpClient httpClient)
109117
* The configuration store that is used during construction of the service
110118
* client.
111119
*/
112-
private Configuration configuration;
120+
@Generated private Configuration configuration;
113121

114122
/**
115123
* Sets The configuration store that is used during construction of the service client.
116124
*
117125
* @param configuration the configuration value.
118126
* @return the KeyVaultAccessControlClientImplBuilder.
119127
*/
128+
@Generated
120129
public KeyVaultAccessControlClientImplBuilder configuration(Configuration configuration) {
121130
this.configuration = configuration;
122131
return this;
@@ -125,14 +134,15 @@ public KeyVaultAccessControlClientImplBuilder configuration(Configuration config
125134
/*
126135
* The logging configuration for HTTP requests and responses.
127136
*/
128-
private HttpLogOptions httpLogOptions;
137+
@Generated private HttpLogOptions httpLogOptions;
129138

130139
/**
131140
* Sets The logging configuration for HTTP requests and responses.
132141
*
133142
* @param httpLogOptions the httpLogOptions value.
134143
* @return the KeyVaultAccessControlClientImplBuilder.
135144
*/
145+
@Generated
136146
public KeyVaultAccessControlClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
137147
this.httpLogOptions = httpLogOptions;
138148
return this;
@@ -142,14 +152,15 @@ public KeyVaultAccessControlClientImplBuilder httpLogOptions(HttpLogOptions http
142152
* The retry policy that will attempt to retry failed requests, if
143153
* applicable.
144154
*/
145-
private RetryPolicy retryPolicy;
155+
@Generated private RetryPolicy retryPolicy;
146156

147157
/**
148158
* Sets The retry policy that will attempt to retry failed requests, if applicable.
149159
*
150160
* @param retryPolicy the retryPolicy value.
151161
* @return the KeyVaultAccessControlClientImplBuilder.
152162
*/
163+
@Generated
153164
public KeyVaultAccessControlClientImplBuilder retryPolicy(RetryPolicy retryPolicy) {
154165
this.retryPolicy = retryPolicy;
155166
return this;
@@ -158,20 +169,21 @@ public KeyVaultAccessControlClientImplBuilder retryPolicy(RetryPolicy retryPolic
158169
/*
159170
* The list of Http pipeline policies to add.
160171
*/
161-
private final List<HttpPipelinePolicy> pipelinePolicies;
172+
@Generated private final List<HttpPipelinePolicy> pipelinePolicies;
162173

163174
/*
164175
* The client options such as application ID and custom headers to set on a
165176
* request.
166177
*/
167-
private ClientOptions clientOptions;
178+
@Generated private ClientOptions clientOptions;
168179

169180
/**
170181
* Sets The client options such as application ID and custom headers to set on a request.
171182
*
172183
* @param clientOptions the clientOptions value.
173184
* @return the KeyVaultAccessControlClientImplBuilder.
174185
*/
186+
@Generated
175187
public KeyVaultAccessControlClientImplBuilder clientOptions(ClientOptions clientOptions) {
176188
this.clientOptions = clientOptions;
177189
return this;
@@ -183,6 +195,7 @@ public KeyVaultAccessControlClientImplBuilder clientOptions(ClientOptions client
183195
* @param customPolicy The custom Http pipeline policy to add.
184196
* @return the KeyVaultAccessControlClientImplBuilder.
185197
*/
198+
@Generated
186199
public KeyVaultAccessControlClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
187200
pipelinePolicies.add(customPolicy);
188201
return this;
@@ -193,9 +206,10 @@ public KeyVaultAccessControlClientImplBuilder addPolicy(HttpPipelinePolicy custo
193206
*
194207
* @return an instance of KeyVaultAccessControlClientImpl.
195208
*/
209+
@Generated
196210
public KeyVaultAccessControlClientImpl buildClient() {
197211
if (apiVersion == null) {
198-
this.apiVersion = "7.3-preview";
212+
this.apiVersion = "7.3";
199213
}
200214
if (pipeline == null) {
201215
this.pipeline = createHttpPipeline();
@@ -208,6 +222,7 @@ public KeyVaultAccessControlClientImpl buildClient() {
208222
return client;
209223
}
210224

225+
@Generated
211226
private HttpPipeline createHttpPipeline() {
212227
Configuration buildConfiguration =
213228
(configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
@@ -227,16 +242,24 @@ private HttpPipeline createHttpPipeline() {
227242
if (headers.getSize() > 0) {
228243
policies.add(new AddHeadersPolicy(headers));
229244
}
245+
policies.addAll(
246+
this.pipelinePolicies.stream()
247+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
248+
.collect(Collectors.toList()));
230249
HttpPolicyProviders.addBeforeRetryPolicies(policies);
231250
policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);
232251
policies.add(new CookiePolicy());
233-
policies.addAll(this.pipelinePolicies);
252+
policies.addAll(
253+
this.pipelinePolicies.stream()
254+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
255+
.collect(Collectors.toList()));
234256
HttpPolicyProviders.addAfterRetryPolicies(policies);
235257
policies.add(new HttpLoggingPolicy(httpLogOptions));
236258
HttpPipeline httpPipeline =
237259
new HttpPipelineBuilder()
238260
.policies(policies.toArray(new HttpPipelinePolicy[0]))
239261
.httpClient(httpClient)
262+
.clientOptions(clientOptions)
240263
.build();
241264
return httpPipeline;
242265
}

sdk/keyvault/azure-security-keyvault-administration/src/main/java/com/azure/security/keyvault/administration/implementation/KeyVaultBackupClientImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ Mono<SelectiveKeyRestoreOperationResponse> selectiveKeyRestoreOperation(
179179
}
180180

181181
/**
182-
* Creates a full backup using a user-provided SAS token to an Azure blob storage container.
182+
* Creates a full backup using a user-provided SAS token to an Azure blob storage container. This operation is
183+
* supported only by the Managed HSM service.
183184
*
184185
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
185186
* @param azureStorageBlobContainerUri Azure blob shared access signature token pointing to a valid Azure blob
@@ -189,7 +190,7 @@ Mono<SelectiveKeyRestoreOperationResponse> selectiveKeyRestoreOperation(
189190
* @throws IllegalArgumentException thrown if parameters fail the validation.
190191
* @throws KeyVaultErrorException thrown if the request is rejected by server.
191192
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
192-
* @return full backup operation.
193+
* @return full backup operation on successful completion of {@link Mono}.
193194
*/
194195
@ServiceMethod(returns = ReturnType.SINGLE)
195196
public Mono<FullBackupResponse> fullBackupWithResponseAsync(
@@ -207,7 +208,7 @@ public Mono<FullBackupResponse> fullBackupWithResponseAsync(
207208
* @throws IllegalArgumentException thrown if parameters fail the validation.
208209
* @throws KeyVaultErrorException thrown if the request is rejected by server.
209210
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
210-
* @return full backup operation.
211+
* @return full backup operation along with {@link Response} on successful completion of {@link Mono}.
211212
*/
212213
@ServiceMethod(returns = ReturnType.SINGLE)
213214
public Mono<Response<FullBackupOperation>> fullBackupStatusWithResponseAsync(
@@ -226,7 +227,7 @@ public Mono<Response<FullBackupOperation>> fullBackupStatusWithResponseAsync(
226227
* @throws IllegalArgumentException thrown if parameters fail the validation.
227228
* @throws KeyVaultErrorException thrown if the request is rejected by server.
228229
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
229-
* @return restore operation.
230+
* @return restore operation on successful completion of {@link Mono}.
230231
*/
231232
@ServiceMethod(returns = ReturnType.SINGLE)
232233
public Mono<FullRestoreOperationResponse> fullRestoreOperationWithResponseAsync(
@@ -244,7 +245,7 @@ public Mono<FullRestoreOperationResponse> fullRestoreOperationWithResponseAsync(
244245
* @throws IllegalArgumentException thrown if parameters fail the validation.
245246
* @throws KeyVaultErrorException thrown if the request is rejected by server.
246247
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
247-
* @return restore operation.
248+
* @return restore operation along with {@link Response} on successful completion of {@link Mono}.
248249
*/
249250
@ServiceMethod(returns = ReturnType.SINGLE)
250251
public Mono<Response<RestoreOperation>> restoreStatusWithResponseAsync(
@@ -265,7 +266,7 @@ public Mono<Response<RestoreOperation>> restoreStatusWithResponseAsync(
265266
* @throws IllegalArgumentException thrown if parameters fail the validation.
266267
* @throws KeyVaultErrorException thrown if the request is rejected by server.
267268
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
268-
* @return selective Key Restore operation.
269+
* @return selective Key Restore operation on successful completion of {@link Mono}.
269270
*/
270271
@ServiceMethod(returns = ReturnType.SINGLE)
271272
public Mono<SelectiveKeyRestoreOperationResponse> selectiveKeyRestoreOperationWithResponseAsync(

0 commit comments

Comments
 (0)