Skip to content

Commit c81a1a2

Browse files
committed
Fixed cspell issues and samples READMEs
1 parent f45831d commit c81a1a2

File tree

14 files changed

+417
-148
lines changed

14 files changed

+417
-148
lines changed

.vscode/cspell.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,10 @@
13711371
"words": [
13721372
"FIPS",
13731373
"IMDS",
1374-
"mhsm"
1374+
"mhsm",
1375+
"OAEP",
1376+
"upns",
1377+
"vcolin" // TODO: Remove after all TODOs are removed from the codebase
13751378
]
13761379
}
13771380
],

sdk/keyvault-v2/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Documentation for this SDK can be found at [Azure Key Vault Java Documentation][
1717

1818
To get started with a specific library, see the **README.md** file located in the library's project folder. You can find
1919
service libraries in the `/sdk/keyvault-v2/azure-security-keyvault-<subcomponent>` directory.
20+
2021
- [Azure Key Vault Keys][azure_keyvault_keys_library] is a cloud service that enables you to safeguard and manage
2122
cryptographic keys.
2223
- [Azure Key Vault Certificates][azure_keyvault_certificates_library] is a cloud service that allows you to securely

sdk/keyvault-v2/azure-security-keyvault-administration/README.md

+53-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Azure Key Vault Administration client library for Java
2+
23
Azure Key Vault Managed HSM is a fully-managed, highly-available, single-tenant, standards-compliant cloud service that
34
enables you to safeguard cryptographic keys for your cloud applications using FIPS 140-2 Level 3 validated HSMs.
45

@@ -10,6 +11,7 @@ key-level role-based access control (RBAC).
1011
## Getting started
1112

1213
### Prerequisites
14+
1315
- A [Java Development Kit (JDK)][jdk_link], version 8 or later.
1416
- Here are details about [Java 8 client compatibility with Azure Certificate Authority][azure_ca]
1517
- An [Azure Subscription][azure_subscription].
@@ -21,6 +23,7 @@ key-level role-based access control (RBAC).
2123
### Adding the package to your product
2224

2325
#### Use the Azure SDK BOM
26+
2427
Please include the `azure-sdk-bom` to your project to take dependency on the General Availability (GA) version of the
2528
library. In the following snippet, replace the {bom_version_to_target} placeholder with the version number. To learn
2629
more about the BOM, see the [AZURE SDK BOM README][azure_sdk_bom].
@@ -51,20 +54,24 @@ and then include the direct dependency in the dependencies section without the v
5154
```
5255

5356
#### Use a direct dependency
57+
5458
If you want to take dependency on a particular version of the library that is not present in the BOM, add the direct
5559
dependency to your project as follows.
5660

5761
[//]: # ({x-version-update-start;com.azure.v2:azure-security-keyvault-administration;current})
62+
5863
```xml
5964
<dependency>
6065
<groupId>com.azure.v2</groupId>
6166
<artifactId>azure-security-keyvault-administration</artifactId>
6267
<version>5.0.0-beta.1</version>
6368
</dependency>
6469
```
70+
6571
[//]: # ({x-version-update-end})
6672

6773
### Authenticate the client
74+
6875
In order to interact with the Azure Key Vault service, you will need to create an instance of either the
6976
[`KeyVaultAccessControlClient`](#create-an-access-control-client) class, the
7077
[`KeyVaultBackupClient`](#create-a-backup-client) class, or the [`KeyVaultSettingsClient`](#create-a-settings-client)
@@ -77,6 +84,7 @@ You can find more information on different ways of authenticating and their corr
7784
[Azure Identity documentation][azure_identity].
7885

7986
#### Create an access control client
87+
8088
Once you perform [the authentication set up that suits you best][default_azure_credential] and replaced
8189
**your-managed-hsm-endpoint** with the URL for your key vault or managed HSM, you can create the
8290
`KeyVaultAccessControlClient`:
@@ -89,6 +97,7 @@ KeyVaultAccessControlClient keyVaultAccessControlClient = new KeyVaultAccessCont
8997
```
9098

9199
#### Create a backup client
100+
92101
Once you perform [the authentication set up that suits you best][default_azure_credential] and replaced
93102
**your-managed-hsm-endpoint** with the URL for your key vault or managed HSM, you can create the `KeyVaultBackupClient`:
94103

@@ -100,6 +109,7 @@ KeyVaultBackupClient keyVaultBackupClient = new KeyVaultBackupClientBuilder()
100109
```
101110

102111
#### Create a settings client
112+
103113
Once you perform [the authentication set up that suits you best][default_azure_credential] and replaced
104114
**your-managed-hsm-endpoint** with the URL for your key vault or managed HSM, you can create the
105115
`KeyVaultSettingsClient`:
@@ -112,22 +122,27 @@ KeyVaultBackupClient keyVaultBackupClient = new KeyVaultBackupClientBuilder()
112122
```
113123

114124
## Key concepts
125+
115126
### Key Vault Access Control Client
127+
116128
The Key Vault Access Control Client performs the interactions with the Azure Key Vault or Managed HSM services for
117129
getting, setting, deleting, and listing role assignments, as well as listing role definitions. Once you've initialized a
118130
role assignment, you can interact with the primary resource types on the service.
119131

120132
### Role Definition
133+
121134
A role definition is a collection of permissions. It defines the operations that can be performed, such as read, write,
122135
and delete. It can also define the operations that are excluded from allowed operations.
123136

124137
Role definitions can be listed and specified as part of a role assignment.
125138

126139
### Role Assignment
140+
127141
A role assignment is the association of a role definition to a service principal. They can be created, listed, fetched
128142
individually, and deleted.
129143

130144
### Key Vault Backup Client
145+
131146
The Key Vault Backup Client provides operations for performing full key backups, full key restores, and selective key
132147
restores.
133148

@@ -137,27 +152,34 @@ restores.
137152
> [generate a SAS token in Storage Explorer][portal_sas_token].
138153
139154
### Pre-Backup Operation
155+
140156
A pre-backup operation represents a long-running operation that checks if it is possible to perform a full key backup.
141157

142158
### Backup Operation
159+
143160
A backup operation represents a long-running operation for a full key backup.
144161

145162
### Pre-Restore Operation
163+
146164
A pre-restore operation represents a long-running operation that checks if it is possible to perform a full key restore
147165
from a backup.
148166

149167
### Restore Operation
168+
150169
A restore operation represents a long-running operation for both a full key and selective key restore.
151170

152171
### Key Vault Settings Client
172+
153173
The Key Vault Settings client allows manipulation of an Azure Key Vault or Managed HSM account's settings, with
154174
operations such as: getting, updating, and listing.
155175

156176
## Access control operations
157177

158178
### Examples
179+
159180
The following sections provide several code snippets covering some of the most common role-based access control tasks,
160181
including:
182+
161183
- [List role definitions](#list-role-definitions)
162184
- [Create or update a role definition](#create-or-update-a-role-definition)
163185
- [Retrieve a role definition](#retrieve-a-role-definition)
@@ -167,6 +189,7 @@ including:
167189
- [Delete a role assignment](#delete-a-role-assignment)
168190

169191
##### List role definitions
192+
170193
List the role definitions in the key vault or managed HSM by calling `listRoleDefinitions()`.
171194

172195
```java readme-sample-listRoleDefinitions
@@ -178,6 +201,7 @@ roleDefinitions.forEach(roleDefinition ->
178201
```
179202

180203
##### Create or update a role definition
204+
181205
Create or update a role definition. The following example shows how to create a role definition with a randomly
182206
generated name.
183207

@@ -189,6 +213,7 @@ System.out.printf("Created role definition with randomly generated name '%s' and
189213
```
190214

191215
##### Retrieve a role definition
216+
192217
Get an existing role definition. To do this, the scope and 'name' property from an existing role definition are
193218
required.
194219

@@ -202,6 +227,7 @@ System.out.printf("Retrieved role definition with name '%s' and role name '%s'.%
202227
```
203228

204229
##### Delete a role definition
230+
205231
Delete a role definition. To do this, the scope and 'name' property from an existing role definition are required.
206232

207233
```java readme-sample-deleteRoleDefinition
@@ -213,6 +239,7 @@ System.out.printf("Deleted role definition with name '%s'.%n", roleDefinitionNam
213239
```
214240

215241
##### List role assignments
242+
216243
List the role assignments in the key vault or managed HSM by calling `listRoleAssignments()`.
217244

218245
```java readme-sample-listRoleAssignments
@@ -224,6 +251,7 @@ roleAssignments.forEach(roleAssignment ->
224251
```
225252

226253
##### Create a role assignment
254+
227255
Create a role assignment. To do this, a role definition id and a service principal object id are required.
228256

229257
A role definition id can be obtained from the 'id' property of one of the role definitions returned from
@@ -249,6 +277,7 @@ System.out.printf("Created role assignment with randomly generated name '%s' for
249277
```
250278

251279
##### Retrieve a role assignment
280+
252281
Get an existing role assignment. To do this, the 'name' property from an existing role assignment is required.
253282

254283
```java readme-sample-getRoleAssignment
@@ -258,7 +287,9 @@ KeyVaultRoleAssignment roleAssignment =
258287

259288
System.out.printf("Retrieved role assignment with name '%s'.%n", roleAssignment.getName());
260289
```
290+
261291
##### Delete a role assignment
292+
262293
To remove a role assignment from a service principal, the role assignment must be deleted. To do this, the 'name'
263294
property from an existing role assignment is required.
264295

@@ -273,12 +304,15 @@ System.out.printf("Deleted role assignment with name '%s'.%n", roleAssignmentNam
273304
## Backup and restore operations
274305

275306
### Examples
307+
276308
The following sections provide several code snippets covering some of the most common backup-related tasks, including:
309+
277310
- [Backup a Key Vault](#backup-a-collection-of-keys)
278311
- [Restore a Key Vault](#restore-a-collection-of-keys)
279312
- [Restore a key](#selectively-restore-a-key)
280313

281314
##### Backup a collection of keys
315+
282316
Back up an entire collection of keys using `beginBackup()`.
283317

284318
```java readme-sample-beginBackup
@@ -306,6 +340,7 @@ if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COM
306340
```
307341

308342
##### Restore a collection of keys
343+
309344
Restore an entire collection of keys from a backup using `beginRestore()`.
310345

311346
```java readme-sample-beginRestore
@@ -331,6 +366,7 @@ if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COM
331366
```
332367

333368
##### Selectively restore a key
369+
334370
Restore a specific key from a backup using `beginSelectiveRestore()`.
335371

336372
```java readme-sample-beginSelectiveKeyRestore
@@ -359,12 +395,15 @@ if (finalPollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COM
359395
## Settings operations
360396

361397
### Examples
398+
362399
The following sections provide several code snippets covering some of the most common settings-related tasks, including:
400+
363401
- [Listing settings](#get-all-settings)
364402
- [Retrieving a setting](#retrieve-a-specific-setting)
365403
- [Updating a setting](#update-a-specific-setting)
366404

367405
##### Get all settings
406+
368407
List all the settings for an Azure Key Vault or Managed HSM account.
369408

370409
```java readme-sample-getSettings
@@ -376,6 +415,7 @@ for (KeyVaultSetting setting : getSettingsResult.getSettings()) {
376415
```
377416

378417
##### Retrieve a specific setting
418+
379419
Retrieve a specific setting.
380420

381421
```java readme-sample-getSetting
@@ -387,6 +427,7 @@ System.out.printf("Retrieved setting '%s' with value '%s'.%n", setting.getName()
387427
```
388428

389429
##### Update a specific setting
430+
390431
Update a specific setting.
391432

392433
```java readme-sample-updateSetting
@@ -398,16 +439,18 @@ System.out.printf("Updated setting '%s' to '%s'.%n", updatedSetting.getName(), u
398439
```
399440

400441
## Troubleshooting
442+
401443
See our [troubleshooting guide][troubleshooting_guide] for details on how to diagnose various failure scenarios.
402444

403445
### General
446+
404447
Azure Key Vault clients raise exceptions. For example, if you try to retrieve a key after it is deleted a `404` error
405448
is returned, indicating the resource was not found. In the following snippet, the error is handled gracefully by
406449
catching the exception and displaying additional information about the error.
407450

408451
```java readme-sample-troubleshooting
409452
try {
410-
keyVaultAccessControlClient.getRoleAssignment(KeyVaultRoleScope.GLOBAL, "<role-assginment-name>");
453+
keyVaultAccessControlClient.getRoleAssignment(KeyVaultRoleScope.GLOBAL, "<role-assignment-name>");
411454
} catch (HttpResponseException e) {
412455
System.out.println(e.getMessage());
413456
}
@@ -427,23 +470,27 @@ better performance compared to the default SSL implementation within the JDK. Fo
427470
reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki.
428471

429472
## Next steps
473+
430474
Several Azure Key Vault Java client library samples are available to you in the SDK's GitHub repository. These samples
431475
provide example code for additional scenarios commonly encountered while working with Azure Key Vault.
432476

433477
## Next steps samples
478+
434479
Samples are explained in detail [here][samples_readme].
435480

436481
### Additional documentation
437-
For more extensive documentation on Azure Key Vault, see the [API reference documentation][azkeyvault_rest].
482+
483+
For more extensive documentation on Azure Key Vault, see the [API reference documentation][azure_keyvault_rest].
438484

439485
## Contributing
486+
440487
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License
441488
Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For
442-
details, visit https://cla.microsoft.com.
489+
details, see the [Microsoft CLA][microsoft_cla].
443490

444491
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate
445492
the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to
446-
do this once across all repos using our CLA.
493+
do this once across all repos using our [CLA][microsoft_cla].
447494

448495
This project has adopted the [Microsoft Open Source Code of Conduct][microsoft_code_of_conduct]. For more information
449496
see the Code of Conduct FAQ or contact <[email protected]> with any additional questions or comments.
@@ -460,13 +507,12 @@ For details on contributing to this repository, see the [contributing guide][con
460507
[api_documentation]: https://azure.github.io/azure-sdk-for-java
461508
[administration_samples]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault-v2/azure-security-keyvault-administration/src/samples/java/com/azure/v2/security/keyvault/administration
462509
[azkeyvault_docs]: https://learn.microsoft.com/azure/key-vault/
463-
[azkeyvault_rest]: https://learn.microsoft.com/rest/api/keyvault/
510+
[azure_keyvault_rest]: https://learn.microsoft.com/rest/api/keyvault/
464511
[azure_ca]: https://learn.microsoft.com/azure/security/fundamentals/azure-ca-details?tabs=root-and-subordinate-cas-list#client-compatibility-for-public-pkis
465512
[azure_cli]: https://learn.microsoft.com/cli/azure
466513
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
467514
[azure_keyvault]: https://learn.microsoft.com/azure/key-vault/general/overview
468515
[azure_keyvault_cli]: https://learn.microsoft.com/azure/key-vault/general/quick-create-cli
469-
[azure_keyvault_mhsm]: https://learn.microsoft.com/azure/key-vault/managed-hsm/overview
470516
[azure_keyvault_mhsm_cli]: https://learn.microsoft.com/azure/key-vault/managed-hsm/quick-create-cli
471517
[azure_keyvault_portal]: https://learn.microsoft.com/azure/key-vault/general/quick-create-portal
472518
[azure_subscription]: https://azure.microsoft.com/free/
@@ -476,6 +522,7 @@ For details on contributing to this repository, see the [contributing guide][con
476522
[http_clients_wiki]: https://learn.microsoft.com/azure/developer/java/sdk/http-client-pipeline#http-clients
477523
[jdk_link]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable
478524
[managed_identity]: https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
525+
[microsoft_cla]: https://cla.microsoft.com
479526
[microsoft_code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
480527
[samples_readme]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault-v2/azure-security-keyvault-administration/src/samples/README.md
481528
[performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning

sdk/keyvault-v2/azure-security-keyvault-administration/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator.
4646
<properties>
4747
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4848

49-
<!-- Code quiality reports -->
49+
<!-- Code quality reports -->
5050
<checkstyle.suppressionsLocation>checkstyle-suppressions.xml</checkstyle.suppressionsLocation>
5151
<spotless.skip>false</spotless.skip>
5252
<spotbugs.excludeFilterFile>spotbugs-exclude.xml</spotbugs.excludeFilterFile>

0 commit comments

Comments
 (0)