Skip to content

Commit f2a499b

Browse files
committed
Added Keys base files.
1 parent 3c725d5 commit f2a499b

Some content is hidden

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

59 files changed

+11371
-0
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ com.azure.resourcemanager:azure-resourcemanager-migration-assessment;1.0.0-beta.
478478
com.azure.resourcemanager:azure-resourcemanager-databasewatcher;1.0.0-beta.1;1.0.0-beta.2
479479
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
480480
com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1
481+
com.azure.v2:azure-security-keyvault-keys;1.0.0-beta.1;1.0.0-beta.1
481482
com.azure.v2:azure-security-keyvault-secrets;1.0.0-beta.1;1.0.0-beta.1
482483
io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.2
483484
io.clientcore:core;1.0.0-beta.5;1.0.0-beta.6
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
- Azure Key Vault Keys client library for Java. This package contains Microsoft Azure KeyVault client library.
6+
7+
### Features Added
8+
9+
### Breaking Changes
10+
11+
### Bugs Fixed
12+
13+
### Other Changes

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

Lines changed: 373 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Troubleshooting Azure Key Vault Keys SDK Issues
2+
See our general [Azure Key Vault SDK Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/TROUBLESHOOTING.md) to troubleshoot issues common to the Azure Key Vault SDKs for Java.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "java",
4+
"TagPrefix": "java/keyvault/azure-security-keyvault-keys-v2",
5+
"Tag": ""
6+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Azure Key Vault Keys for Java
2+
3+
> see https://aka.ms/autorest
4+
5+
This is the Autorest configuration file for KeyVault Keys.
6+
7+
---
8+
## Getting Started
9+
To build the SDK for KeyVault Secrets, simply [Install Autorest](https://aka.ms/autorest) and
10+
in this folder, run:
11+
12+
> `autorest`
13+
14+
To see additional help and options, run:
15+
16+
> `autorest --help`
17+
18+
### Setup
19+
```ps
20+
npm install -g autorest
21+
```
22+
23+
### Generation
24+
25+
```ps
26+
cd <swagger-folder>
27+
autorest
28+
```
29+
30+
## Configuration
31+
32+
```yaml
33+
use: '@autorest/[email protected]'
34+
output-folder: ../
35+
java: true
36+
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/keys.json
37+
title: KeyClient
38+
namespace: com.azure.security.keyvault.keys
39+
models-subpackage: implementation.models
40+
custom-types-subpackage: models
41+
custom-types: KeyCurveName,KeyExportEncryptionAlgorithm,KeyOperation,KeyRotationPolicyAction,KeyType,ReleaseKeyResult
42+
customization-class: src/main/java/KeysCustomizations.java
43+
enable-sync-stack: true
44+
generate-client-as-impl: true
45+
license-header: MICROSOFT_MIT_SMALL
46+
disable-client-builder: true
47+
directive:
48+
- rename-model:
49+
from: KeyReleaseResult
50+
to: ReleaseKeyResult
51+
```
52+
53+
### Rename expandable string enum models
54+
55+
```yaml
56+
directive:
57+
- from: "keys.json"
58+
where: $.definitions
59+
transform: >
60+
$.KeyType = $.JsonWebKey.properties.kty;
61+
$.KeyType["x-ms-enum"].name = "KeyType";
62+
$.JsonWebKey.properties.kty = { "$ref": "#/definitions/KeyType" };
63+
$.KeyProperties.properties.kty = { "$ref": "#/definitions/KeyType" };
64+
$.KeyCreateParameters.properties.kty = { "$ref": "#/definitions/KeyType" };
65+
66+
$.KeyCurveName = $.JsonWebKey.properties.crv;
67+
$.KeyCurveName.description = "Elliptic curve name.";
68+
$.KeyCurveName["x-ms-enum"].name = "KeyCurveName";
69+
$.JsonWebKey.properties.crv = { "$ref": "#/definitions/KeyCurveName" };
70+
$.KeyProperties.properties.crv = { "$ref": "#/definitions/KeyCurveName" };
71+
$.KeyCreateParameters.properties.crv = { "$ref": "#/definitions/KeyCurveName" };
72+
73+
$.KeyExportEncryptionAlgorithm = $.KeyExportParameters.properties.enc;
74+
$.KeyExportEncryptionAlgorithm["x-ms-enum"].name = "KeyExportEncryptionAlgorithm";
75+
$.KeyExportParameters.properties.enc = { "$ref": "#/definitions/KeyExportEncryptionAlgorithm" };
76+
$.KeyReleaseParameters.properties.enc = { "$ref": "#/definitions/KeyExportEncryptionAlgorithm" };
77+
78+
$.KeyOperation = $.KeyCreateParameters.properties.key_ops.items;
79+
$.KeyOperation.enum = $.KeyOperation.enum.filter(item => item !== "export");
80+
$.KeyOperation["x-ms-enum"].name = "KeyOperation";
81+
$.JsonWebKey.properties.key_ops.items = { "$ref": "#/definitions/KeyOperation" };
82+
$.KeyCreateParameters.properties.key_ops.items = { "$ref": "#/definitions/KeyOperation" };
83+
$.KeyUpdateParameters.properties.key_ops.items = { "$ref": "#/definitions/KeyOperation" };
84+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.azure</groupId>
9+
<artifactId>azure-code-customization-parent</artifactId>
10+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-code-customization-parent;current} -->
11+
<relativePath>../../../parents/azure-code-customization-parent</relativePath>
12+
</parent>
13+
14+
<name>Microsoft Azure Security Key Vault Keys code generation customization</name>
15+
<description>This package contains code generation customization for Microsoft Azure Security Key Vault Keys</description>
16+
17+
<groupId>com.azure.tools</groupId>
18+
<artifactId>azure-security-keyvault-keys-v2-autorest-customization</artifactId>
19+
<version>1.0.0-beta.1</version>
20+
<packaging>jar</packaging>
21+
</project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
import com.azure.autorest.customization.Customization;
5+
import com.azure.autorest.customization.Editor;
6+
import com.azure.autorest.customization.LibraryCustomization;
7+
import org.slf4j.Logger;
8+
9+
/**
10+
* Contains customizations for Azure KeyVault's Keys swagger code generation.
11+
*/
12+
public class KeysCustomizations extends Customization {
13+
@Override
14+
public void customize(LibraryCustomization libraryCustomization, Logger logger) {
15+
// Remove unnecessary files.
16+
removeFiles(libraryCustomization.getRawEditor());
17+
18+
// Rename KeyVaultServiceVersion to KeyServiceVersion.
19+
libraryCustomization.getPackage("com.azure.v2.security.keyvault.keys")
20+
.getClass("KeyVaultServiceVersion")
21+
.rename("KeyServiceVersion");
22+
}
23+
24+
private static void removeFiles(Editor editor) {
25+
editor.removeFile("src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java");
26+
editor.removeFile("src/main/java/com/azure/security/keyvault/keys/KeyClient.java");
27+
editor.removeFile("src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java");
28+
}
29+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!--
2+
~ Code generated by Microsoft (R) TypeSpec Code Generator.
3+
-->
4+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.azure.v2</groupId>
8+
<artifactId>azure-security-keyvault-keys-v2</artifactId>
9+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure.v2:azure-security-keyvault-keys;current} -->
10+
<packaging>jar</packaging>
11+
12+
<name>SDK for KeyVault</name>
13+
<description>This package contains KeyVault client library.</description>
14+
15+
<licenses>
16+
<license>
17+
<name>The MIT License (MIT)</name>
18+
<url>http://opensource.org/licenses/MIT</url>
19+
<distribution>repo</distribution>
20+
</license>
21+
</licenses>
22+
23+
<properties>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<spotless.skip>false</spotless.skip>
26+
</properties>
27+
<dependencies>
28+
<dependency>
29+
<groupId>io.clientcore</groupId>
30+
<artifactId>core</artifactId>
31+
<version>1.0.0-beta.5</version> <!-- {x-version-update;io.clientcore:core;external_dependency} -->
32+
</dependency>
33+
<dependency>
34+
<groupId>com.azure</groupId>
35+
<artifactId>azure-core-v2</artifactId>
36+
<version>2.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core-v2;current} -->
37+
</dependency>
38+
</dependencies>
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-compiler-plugin</artifactId>
44+
<version>3.13.0</version>
45+
<configuration>
46+
<release>17</release>
47+
</configuration>
48+
</plugin>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-source-plugin</artifactId>
52+
<version>3.3.1</version>
53+
<executions>
54+
<execution>
55+
<id>attach-sources</id>
56+
<goals>
57+
<goal>jar</goal>
58+
</goals>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
<plugin>
63+
<groupId>org.codehaus.mojo</groupId>
64+
<artifactId>build-helper-maven-plugin</artifactId>
65+
<version>3.0.0</version>
66+
<executions>
67+
<execution>
68+
<id>add-test-source</id>
69+
<phase>generate-test-sources</phase>
70+
<goals>
71+
<goal>add-test-source</goal>
72+
</goals>
73+
<configuration>
74+
<sources>
75+
<source>${basedir}/src/samples</source>
76+
</sources>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
</plugins>
82+
</build>
83+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Code generated by Microsoft (R) TypeSpec Code Generator.
2+
3+
package com.azure.v2.security.keyvault.keys;
4+
5+
import io.clientcore.core.http.models.ServiceVersion;
6+
7+
/**
8+
* Service version of KeyVaultClient.
9+
*/
10+
public enum KeyServiceVersion implements ServiceVersion {
11+
/**
12+
* Enum value 7.5.
13+
*/
14+
V7_5("7.5");
15+
16+
private final String version;
17+
18+
KeyServiceVersion(String version) {
19+
this.version = version;
20+
}
21+
22+
/**
23+
* {@inheritDoc}
24+
*/
25+
@Override
26+
public String getVersion() {
27+
return this.version;
28+
}
29+
30+
/**
31+
* Gets the latest service version supported by this client library.
32+
*
33+
* @return The latest {@link KeyServiceVersion}.
34+
*/
35+
public static KeyServiceVersion getLatest() {
36+
return V7_5;
37+
}
38+
}

0 commit comments

Comments
 (0)