-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Initial KeyVaultAccessControlClient for Java #12405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 34 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
f99f825
Created azure-security-keyvault-administration module including its P…
vcolin7 08f6264
Created AutoRest README and generated artifacts.
vcolin7 c351f17
Added sync methods
vcolin7 3b627b5
Modified the AutoRest specification to generate async methods only. R…
vcolin7 e4917eb
Created the AccessControl builder and clients (sync + async), public …
vcolin7 f9eebad
Regenerated classes with AutoRest v4 instead of v3.
vcolin7 b69e738
Added the 'KeyVault' prefix to all access control clients, implementa…
vcolin7 42a7cba
Added an API for listing role definitions.
vcolin7 0c75941
Added APIs for creating, getting, deleting and listing role assignments.
vcolin7 9d003dd
Polished README.
vcolin7 0b1fd31
Added the an entry for Key Vault Administration in version_client.txt
vcolin7 590045a
Renamed to not break the CI build.
vcolin7 8d556d4
Fixed copy/paste error on autorest.md
vcolin7 614cf26
Changed README references (keys -> administration).
vcolin7 6273df0
Addressed PR comments. Added a new ExpandableStringEnum: RoleScope. C…
vcolin7 d69de48
Merge branch 'master' into users/vicolina/keyvault-rbac
vcolin7 d966d81
Merge remote-tracking branch 'upstream/master' into users/vicolina/ke…
vcolin7 346b768
Addressed more PR feedback.
vcolin7 32084ad
Added the new Key Vault Administration library to eng/jacoco-test-cov…
vcolin7 14266a0
Re-generated code from the Swagger specification.
vcolin7 563f00d
Renamed many of the implementation models.
vcolin7 c6915b2
Added additional null checks for members in public methods that accep…
vcolin7 37b6be0
Added a module-info file.
vcolin7 ea4a103
Made small formatting corrections.
vcolin7 19ed63b
Removed an entry from module-info.java. Modified how KeyVaultAccessCo…
vcolin7 5e53892
Added missing package-info.java files.
vcolin7 e57a0fe
Corrected errors highlighted by APIView.
vcolin7 427ffdc
Reverted implementation classes to their original names and hid them …
vcolin7 0d75b43
Renamed KeyVaultRoleScope to KeyVaultRoleAssignmentScope.
vcolin7 0e42b1a
Fixed build issues.
vcolin7 b3dcfc7
Made model classes final.
vcolin7 4546a8c
Updated module-info.java
vcolin7 cbc2923
Renamed input parameter "scope" to "roleScope" in a multitude of publ…
vcolin7 8a74268
Fixed package-info.java Javadoc.
vcolin7 01e3e76
Fixed some strings used for logging.
vcolin7 2ee7459
Fixed JavaDoc formatting issues pointed out by @g2vinay.
vcolin7 0907fcb
Added samples to README.md
vcolin7 583d989
Merge branch 'master' into users/vicolina/keyvault-rbac
vcolin7 5a208bf
Fixed build analysis issues with the module's POM.
vcolin7 0169643
Fixed Build analysis issue related to README.
vcolin7 a476010
Fixed broken links in autorest.md and README.md
vcolin7 43a5fee
Fixed a bug in `KeyVaultAccessControlAsyncClient.createRoleAssignment…
vcolin7 43caa66
Updated azure-core versions.
vcolin7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
sdk/keyvault/azure-security-keyvault-administration/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Release History | ||
| ## 4.0.0-beta.1 (Unreleased) | ||
| - Added `KeyVaultAccessControlClient`. |
127 changes: 127 additions & 0 deletions
127
sdk/keyvault/azure-security-keyvault-administration/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # Azure Key Vault Administration library for Java | ||
|
|
||
| ## Getting started | ||
| ### Adding the package to your project | ||
| Maven dependency for the Azure Key Vault Administration library. Add it to your project's POM file. | ||
|
|
||
| [//]: # ({x-version-update-start;com.azure:azure-security-keyvault-administration;current}) | ||
| ```xml | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-security-keyvault-administration</artifactId> | ||
| <version>4.0.0-beta.1</version> | ||
| </dependency> | ||
| ``` | ||
| [//]: # ({x-version-update-end}) | ||
|
|
||
| ### Prerequisites | ||
| - Java Development Kit (JDK) with version 8 or above | ||
| - [Azure Subscription][azure_subscription] | ||
| - An existing [Azure Key Vault][azure_keyvault]. If you need to create a Key Vault, you can use the [Azure Cloud Shell](https://shell.azure.com/bash) to create one with this Azure CLI command. Replace `<your-resource-group-name>` and `<your-key-vault-name>` with your own, unique names: | ||
|
|
||
| ```Bash | ||
| az keyvault create --resource-group <your-resource-group-name> --name <your-key-vault-name> | ||
| ``` | ||
|
|
||
| ### Authenticate the client | ||
| In order to interact with the Azure Key Vault service, you'll need to create an instance of the [KeyClient](#create-key-client) class. You would need a **vault url** and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object using the default `DefaultAzureCredential` examples shown in this document. | ||
|
|
||
| The `DefaultAzureCredential` way of authentication by providing client secret credentials is being used in this getting started section but you can find more ways to authenticate with [azure-identity][azure_identity]. | ||
|
|
||
| #### Create/Get credentials | ||
| To create/get client secret credentials you can use the [Azure Portal][azure_create_application_in_portal], [Azure CLI][azure_keyvault_cli_full] or [Azure Cloud Shell](https://shell.azure.com/bash) | ||
|
|
||
| Here is an [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to | ||
|
|
||
| * Create a service principal and configure its access to Azure resources: | ||
|
|
||
| ```Bash | ||
| az ad sp create-for-rbac -n <your-application-name> --skip-assignment | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ```json | ||
| { | ||
| "appId": "generated-app-ID", | ||
| "displayName": "dummy-app-name", | ||
| "name": "http://dummy-app-name", | ||
| "password": "random-password", | ||
| "tenant": "tenant-ID" | ||
| } | ||
| ``` | ||
|
|
||
| * Use the above returned credentials information to set the **AZURE_CLIENT_ID** (appId), **AZURE_CLIENT_SECRET** (password), and **AZURE_TENANT_ID** (tenantId) environment variables. The following example shows a way to do this in Bash: | ||
|
|
||
| ```Bash | ||
| export AZURE_CLIENT_ID="generated-app-ID" | ||
| export AZURE_CLIENT_SECRET="random-password" | ||
| export AZURE_TENANT_ID="tenant-ID" | ||
| ``` | ||
|
|
||
| * Use the aforementioned Key Vault name to retrieve details of your Key Vault, which also contain your Key Vault URL: | ||
|
|
||
| ```Bash | ||
| az keyvault show --name <your-key-vault-name> | ||
| ``` | ||
|
|
||
| #### Create Access Control client | ||
|
|
||
| ## Key concepts | ||
| To be added. | ||
|
|
||
| ## Examples | ||
| ### Sync API | ||
| To be added. | ||
|
|
||
| ### Async API | ||
| To be added. | ||
|
|
||
| ## Key concepts | ||
| To be added. | ||
|
|
||
| ## Troubleshooting | ||
| ### General | ||
| To be added. | ||
|
|
||
| ### Default HTTP client | ||
| All client libraries by default use the Netty HTTP client. Adding the above dependency will automatically configure the client library to use the Netty HTTP client. Configuring or changing the HTTP client is detailed in the [HTTP clients wiki](https://github.com/Azure/azure-sdk-for-java/wiki/HTTP-clients). | ||
|
|
||
| ### Default SSL library | ||
| All client libraries, by default, use the Tomcat-native Boring SSL library to enable native-level performance for SSL operations. The Boring SSL library is an Uber JAR containing native libraries for Linux / macOS / Windows, and provides better performance compared to the default SSL implementation within the JDK. For more information, including how to reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki. | ||
|
|
||
| ## Next steps | ||
| Several Key Vault Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Azure Key Vault. | ||
|
|
||
| ## Next steps samples | ||
| Samples are explained in detail [here][samples_readme]. | ||
|
|
||
| ### Additional documentation | ||
| For more extensive documentation on Azure Key Vault, see the [API reference documentation][azkeyvault_rest]. | ||
|
|
||
| ## Contributing | ||
| This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. | ||
|
|
||
| When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the Code of Conduct FAQ or contact <opencode@microsoft.com> with any additional questions or comments. | ||
|
|
||
| <!-- LINKS --> | ||
| [source_code]: src | ||
| [api_documentation]: https://azure.github.io/azure-sdk-for-java | ||
| [azkeyvault_docs]: https://docs.microsoft.com/azure/key-vault/ | ||
| [azure_identity]: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/identity/azure-identity | ||
| [maven]: https://maven.apache.org/ | ||
| [azure_subscription]: https://azure.microsoft.com/ | ||
| [azure_keyvault]: https://docs.microsoft.com/azure/key-vault/quick-create-portal | ||
| [azure_cli]: https://docs.microsoft.com/cli/azure | ||
| [rest_api]: https://docs.microsoft.com/rest/api/keyvault/ | ||
| [azkeyvault_rest]: https://docs.microsoft.com/rest/api/keyvault/ | ||
| [azure_create_application_in_portal]: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal | ||
| [azure_keyvault_cli]: https://docs.microsoft.com/azure/key-vault/quick-create-cli | ||
| [azure_keyvault_cli_full]: https://docs.microsoft.com/cli/azure/keyvault?view=azure-cli-latest | ||
| [administration_samples]: src/samples/java/com/azure/security/keyvault/administration | ||
| [samples_readme]: src/samples/README.md | ||
| [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning | ||
|
|
||
|  | ||
105 changes: 105 additions & 0 deletions
105
sdk/keyvault/azure-security-keyvault-administration/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <parent> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-client-sdk-parent</artifactId> | ||
| <version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} --> | ||
| <relativePath>../../parents/azure-client-sdk-parent</relativePath> | ||
| </parent> | ||
|
|
||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <artifactId>azure-security-keyvault-administration</artifactId> | ||
|
vcolin7 marked this conversation as resolved.
|
||
| <version>4.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-administration;current} --> | ||
|
|
||
| <name>Microsoft Azure client library for KeyVault Administration</name> | ||
| <description>This module contains client library for Microsoft Azure KeyVault Administration.</description> | ||
| <url>https://github.com/Azure/azure-sdk-for-java</url> | ||
|
|
||
| <distributionManagement> | ||
| <site> | ||
| <id>azure-java-build-docs</id> | ||
| <url>${site.url}/site/${project.artifactId}</url> | ||
| </site> | ||
| </distributionManagement> | ||
|
|
||
| <scm> | ||
| <url>scm:git:https://github.com/Azure/azure-sdk-for-java</url> | ||
| <connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection> | ||
| <tag>HEAD</tag> | ||
| </scm> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} --> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-core</artifactId> | ||
| <version>1.7.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} --> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-core-http-netty</artifactId> | ||
| <version>1.5.4</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} --> | ||
| </dependency> | ||
| <!-- Test dependencies --> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-engine</artifactId> | ||
| <version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-params</artifactId> | ||
| <version>5.6.2</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.hamcrest</groupId> | ||
| <artifactId>hamcrest-library</artifactId> | ||
| <version>2.2</version> <!-- {x-version-update;org.hamcrest:hamcrest-library;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.projectreactor</groupId> | ||
| <artifactId>reactor-test</artifactId> | ||
| <version>3.3.9.RELEASE</version> <!-- {x-version-update;io.projectreactor:reactor-test;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-core-test</artifactId> | ||
| <version>1.4.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-core-http-okhttp</artifactId> | ||
| <version>1.2.5</version> <!-- {x-version-update;com.azure:azure-core-http-okhttp;dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-identity</artifactId> | ||
| <version>1.1.0</version> <!-- {x-version-update;com.azure:azure-identity;dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.