Skip to content

Commit

Permalink
Merge pull request #2613 from lenala/keyvault
Browse files Browse the repository at this point in the history
  • Loading branch information
bsiegel committed Nov 17, 2018
2 parents a6fa31f + 87cefe0 commit f1c6de6
Show file tree
Hide file tree
Showing 298 changed files with 71,342 additions and 0 deletions.
64 changes: 64 additions & 0 deletions keyvault/data-plane/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
*.class

#External libs
extlib/

# Auth files
*.auth
*.azureauth

# Local checkstyle
*.checkstyle

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# Azure Tooling #
node_modules
packages

# Eclipse #
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
bin/

# Other Tooling #
.classpath
.project
**/target/classes/**
**/target/generated-sources/**
**/target/generate-test-sources/**
**/target/maven-status/**
**/target/test-classes/com/**
**/target/surefire-reports/**
**/target/maven-archiver/**
!**/target/test-classes/session-records/**
.idea
*.iml

# Mac OS #
.DS_Store
.DS_Store?

# Windows #
Thumbs.db

# reduced pom files should not be included
dependency-reduced-pom.xml
19 changes: 19 additions & 0 deletions keyvault/data-plane/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: java
sudo: required
jdk:
- oraclejdk8
env:
global:
-AZURE_TEST_MODE=Playback
-'keyvault.vaulturi'=https://tifchen-keyvault-fancy.vault.azure.net
-'keyvault.vaulturi.alt'=https://tifchen-keyvault-fancier.vault.azure.net
script:
- LOG_PARAMS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn --batch-mode' ;
- mvn jetty:run & echo "==> Starting a Jetty server on the background ==" ;
- mvn install -DskipTests=true $LOG_PARAMS || travis_terminate 1 ;

- echo '==> Starting mvn test ===' ;
- mvn test -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -Dparallel=classes -DthreadCount=2 -DforkCount=1C || travis_terminate 1 ;



21 changes: 21 additions & 0 deletions keyvault/data-plane/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
129 changes: 129 additions & 0 deletions keyvault/data-plane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
[![Build Status](https://travis-ci.org/Azure/azure-keyvault-java.svg?branch=dev)](https://travis-ci.org/Azure/azure-keyvault-java)

# Microsoft Azure Key Vault SDK for Java

This is the Microsoft Azure Key Vault client library which allows for the consumption of Key Vault services. Azure Key Vault helps safeguard cryptographic keys and secrets used by cloud applications and services. By using Key Vault, you can encrypt keys and secrets (such as authentication keys, storage account keys, data encryption keys, .PFX files, and passwords) using keys protected by hardware security modules (HSMs). For added assurance, you can import or generate keys in HSMs. If you choose to do this, Microsoft processes your keys in FIPS 140-2 Level 2 validated HSMs (hardware and firmware).
Key Vault streamlines the key management process and enables you to maintain control of keys that access and encrypt your data. Developers can create keys for development and testing in minutes, and then seamlessly migrate them to production keys. Security administrators can grant (and revoke) permission to keys, as needed.
For more information refer to [What is Key Vault?](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-whatis) or [Getting Started](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started).

Documentation for this SDK can be found at [Azure Key Vault Java Documentation](https://docs.microsoft.com/en-us/java/api/overview/azure/keyvault)

## Sample code
You can find sample code that illustrates key vault usage scenarios [here](https://azure.microsoft.com/en-us/resources/samples/?sort=0&service=key-vault&platform=java).

<table>
<tr>
<th>Category</th>
<th>Samples</th>
</tr>
<tr>
<td>Authentication</td>
<td>
<ul>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-authentication">Authenticating with a service principal and a self-signed certificate</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-authentication">Authenticating with ADAL through a callback</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication/">Authenticating with a .pfx file</a>
</li>
</ul>
</td>
</tr>
<tr>
<td>Vault Management</td>
<td>
<ul>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication/">Creating a vault</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-network-acl/">Creating a vault with access restrictions based on IP and Azure Virtual Networks</a>
</li>
</ul>
</td>
</tr>
<tr>
<td>Secret Management</td>
<td>
<ul>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication
">Putting keys and secrets into a vault</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication/">Signing</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication/">Verification of signature with both Java Security and Azure Key Vault REST</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-certificate-authentication/">Injecting a .pfx file into a VM at deployment using a template</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-recovery/">Using the soft delete and backup restore features</a>
</li>
<li>
<a href="https://github.com/Azure-Samples/key-vault-java-recovery/">Managing storage accounts</a>
</li>
</ul>
</td>
</tr>
</table>

For more information on using Java with Azure, see [here](https://azure.microsoft.com/en-us/develop/java/)

## Download

To get the binaries of this library as distributed by Microsoft, ready for use within your project, you can use Maven. Add the following fragment to you POM's dependencies.

```xml
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-complete</artifactId>
<version>1.1.2</version>
</dependency>
```

## Pre-requisites
- A Java Developer Kit (JDK), v 1.7 or later
- Maven

## Building and Testing

Clone the repo, then run `mvn compile` from the root directory.

To run the recorded tests:
1. If you have not already, you need to install the [Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) package.
2. run `mvn jetty:run` to start a jetty server. This starts a service that will block the terminal so you will likely want to open a second terminal to run the actual tests.
3. In your second terminal run `mvn test`.

## Contributing

If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html).

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

# Previous Versions

| Version | Comments |
| :-------: | :-------- |
| [1.1.1](https://github.com/Azure/azure-keyvault-java/tree/1.1.1) | Version 1.1.1 release |
| [1.1](https://github.com/Azure/azure-keyvault-java/tree/1.1) | Version 1.1 release |
| [1.1-beta-1](https://github.com/Azure/azure-keyvault-java/tree/1.1-beta-1) | Version 1.1.0 **beta** release |
| [1.1-alpha-2](https://github.com/Azure/azure-keyvault-java/tree/v1.1-alpha-2) | Version 1.1.0 **alpha** release |
| [1.0.0](https://github.com/Azure/azure-keyvault-java/tree/v1.0.0) | Version 1.0.0 release |

# More information
* [Azure Key Vault Java Documentation](https://docs.microsoft.com/en-us/java/api/overview/azure/keyvault)
* [What is Key Vault?](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-whatis)
* [Get started with Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started)
* [Azure Key Vault General Documentation](https://docs.microsoft.com/en-us/azure/key-vault/)
* [Azure Key Vault REST API Reference](https://docs.microsoft.com/en-us/rest/api/keyvault/)
* [Azure Active Directory Documenation](https://docs.microsoft.com/en-us/azure/active-directory/)
19 changes: 19 additions & 0 deletions keyvault/data-plane/REGENERATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Regenerating SDK

The code in the azure-keyvault package is generated via AutoREST. After code generation, there are currently several manual modifications that need to be made for the build to succeed. In the root of the azure-keyvault-java repo, there is a Python script called "regenerate_and_fix_sdk.py" which will automatically regenerate the code and apply the necessary fixes. To regenerate the code using this script:

- Install AutoREST: https://github.com/Azure/autorest/blob/master/docs/installing-autorest.md
- Open the script in your favorite editor and change "swagger_source_branch" to contain the branch of the Azure REST spec API repo that you'd like the API spec to be sourced from – likely either "master" or "keyvault_preview"
- If there is a tag you'd like to pass to AutoREST – set the "autorest_tag" branch accordingly.
- Using Python 3.6+, run the script from the root of the checked out repository. Verify that no errors appear, and then build/test the SDK.



The changes made by the script post-regeneration are as follows:

* The generated webkey models will be removed


* Any generated model class which has a corresponding custom class in the "models/custom" folder will be changed to inherit from the custom class.
* Any class which utilizes webkey models will have the correct imports from the azure-keyvault-webkey package added
* AutoREST occasionally generates broken parameter declarations in the Javadoc comments - these are repaired.
72 changes: 72 additions & 0 deletions keyvault/data-plane/azure-keyvault-complete/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
the MIT License. See License.txt in the project root for license information. -->
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-parent</artifactId>
<version>1.1.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-complete</artifactId>
<version>1.1.2</version>
<packaging>pom</packaging>

<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>

<name>Microsoft Azure Key Vault SDK Complete</name>
<description>This encapsulate all modules of the Microsoft Azure Key Vault SDK.</description>
<url>https://github.com/Azure/azure-keyvault-java</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>

<scm>
<url>scm:git:https://github.com/Azure/azure-keyvault-java</url>
<connection>scm:git:git@github.com:Azure/azure-keyvault-java.git</connection>
<tag>HEAD</tag>
</scm>

<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-core</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-webkey</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-extensions</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-cryptography</artifactId>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit f1c6de6

Please sign in to comment.