fold core-shaded module into core
Original commit: elastic/x-pack-elasticsearch@90af059f72
This commit is contained in:
parent
bd416b7a73
commit
ebd9bf1d2c
|
@ -1,21 +0,0 @@
|
|||
<?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>
|
||||
<artifactId>elasticsearch-license</artifactId>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>elasticsearch-license-core-shaded</artifactId>
|
||||
|
||||
<properties>
|
||||
<license.basedir combine.self="override">${project.parent.basedir}</license.basedir>
|
||||
<tests.ifNoTests>warn</tests.ifNoTests>
|
||||
<!-- we aren't really a plugin... -->
|
||||
<skip.integ.tests>true</skip.integ.tests>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -14,12 +14,4 @@
|
|||
<skip.integ.tests>true</skip.integ.tests>
|
||||
</properties>
|
||||
<artifactId>elasticsearch-license-core</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch-license-core-shaded</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
package org.elasticsearch.license.core.shaded;
|
||||
package org.elasticsearch.license.core;
|
||||
|
||||
|
||||
import org.elasticsearch.common.Base64;
|
|
@ -11,7 +11,6 @@ import org.elasticsearch.common.xcontent.ToXContent;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.license.core.shaded.CryptUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
|||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.license.core.License;
|
||||
import org.elasticsearch.license.core.Licenses;
|
||||
import org.elasticsearch.license.core.shaded.CryptUtils;
|
||||
import org.elasticsearch.license.core.CryptUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.security.SecureRandom;
|
|||
import static org.elasticsearch.common.cli.CliToolConfig.Builder.cmd;
|
||||
import static org.elasticsearch.common.cli.CliToolConfig.Builder.option;
|
||||
import static org.elasticsearch.common.cli.CliToolConfig.config;
|
||||
import static org.elasticsearch.license.core.shaded.CryptUtils.writeEncryptedPrivateKey;
|
||||
import static org.elasticsearch.license.core.shaded.CryptUtils.writeEncryptedPublicKey;
|
||||
import static org.elasticsearch.license.core.CryptUtils.writeEncryptedPrivateKey;
|
||||
import static org.elasticsearch.license.core.CryptUtils.writeEncryptedPublicKey;
|
||||
|
||||
public class KeyPairGeneratorTool extends CliTool {
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class KeyPairGenerationToolTests extends CliToolTestCase {
|
|||
KeyPairGeneratorTool keyPairGeneratorTool = new KeyPairGeneratorTool();
|
||||
Path publicKeyFilePath = createTempFile().toAbsolutePath();
|
||||
Path privateKeyFilePath = createTempFile().toAbsolutePath();
|
||||
Settings settings = Settings.builder().put("path.home", createTempDir()).build();
|
||||
Settings settings = Settings.builder().put("path.home", createTempDir("KeyPairGenerationToolTests")).build();
|
||||
|
||||
Files.delete(publicKeyFilePath);
|
||||
Files.delete(privateKeyFilePath);
|
||||
|
|
|
@ -32,15 +32,12 @@ public class LicenseGenerationToolTests extends CliToolTestCase {
|
|||
|
||||
protected Path pubKeyPath = null;
|
||||
protected Path priKeyPath = null;
|
||||
protected Path homeDir = null;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
logger.error("project.basedir [{}]", System.getProperty("project.basedir"));
|
||||
pubKeyPath = getDataPath(TestUtils.PUBLIC_KEY_RESOURCE);
|
||||
priKeyPath = getDataPath(TestUtils.PRIVATE_KEY_RESOURCE);
|
||||
homeDir = createTempDir();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -185,7 +182,7 @@ public class LicenseGenerationToolTests extends CliToolTestCase {
|
|||
|
||||
private String runLicenseGenerationTool(Path pubKeyPath, Path priKeyPath, Set<License> licenseSpecs, ExitStatus expectedExitStatus) throws Exception {
|
||||
CaptureOutputTerminal outputTerminal = new CaptureOutputTerminal();
|
||||
Settings settings = Settings.builder().put("path.home", homeDir).build();
|
||||
Settings settings = Settings.builder().put("path.home", createTempDir("LicenseGenerationToolTests")).build();
|
||||
LicenseGenerator licenseGenerator = new LicenseGenerator(outputTerminal, pubKeyPath, priKeyPath, licenseSpecs);
|
||||
assertThat(execute(licenseGenerator, settings), equalTo(expectedExitStatus));
|
||||
assertThat(outputTerminal.getTerminalOutput().size(), equalTo(1));
|
||||
|
|
|
@ -14,8 +14,6 @@ import org.elasticsearch.license.core.License;
|
|||
import org.elasticsearch.license.core.Licenses;
|
||||
import org.elasticsearch.license.licensor.AbstractLicensingTestBase;
|
||||
import org.elasticsearch.license.licensor.TestUtils;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -33,18 +31,6 @@ import static org.hamcrest.core.IsEqual.equalTo;
|
|||
|
||||
public class LicenseVerificationToolTests extends CliToolTestCase {
|
||||
|
||||
protected static Path homeDir = null;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() throws Exception {
|
||||
homeDir = createTempDir();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void cleanUp() throws Exception {
|
||||
homeDir = null;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParsingMissingLicense() throws Exception {
|
||||
LicenseVerificationTool licenseVerificationTool = new LicenseVerificationTool();
|
||||
|
@ -198,7 +184,7 @@ public class LicenseVerificationToolTests extends CliToolTestCase {
|
|||
|
||||
private String runLicenseVerificationTool(Set<License> licenses, Path publicKeyPath, ExitStatus expectedExitStatus) throws Exception {
|
||||
CaptureOutputTerminal outputTerminal = new CaptureOutputTerminal();
|
||||
Settings settings = Settings.builder().put("path.home", homeDir).build();
|
||||
Settings settings = Settings.builder().put("path.home", createTempDir("LicenseVerificationToolTests")).build();
|
||||
LicenseVerifier licenseVerifier = new LicenseVerifier(outputTerminal, licenses, publicKeyPath);
|
||||
assertThat(execute(licenseVerifier, settings), equalTo(expectedExitStatus));
|
||||
if (expectedExitStatus == ExitStatus.OK) {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<include>org.elasticsearch:elasticsearch-license-plugin</include>
|
||||
<include>org.elasticsearch:elasticsearch-license-plugin-api</include>
|
||||
<include>org.elasticsearch:elasticsearch-license-core</include>
|
||||
<include>org.elasticsearch:elasticsearch-license-core-shaded</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>org.elasticsearch:elasticsearch</exclude>
|
||||
|
|
|
@ -15,8 +15,8 @@ import java.io.IOException;
|
|||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.elasticsearch.license.core.shaded.CryptUtils.decrypt;
|
||||
import static org.elasticsearch.license.core.shaded.CryptUtils.encrypt;
|
||||
import static org.elasticsearch.license.core.CryptUtils.decrypt;
|
||||
import static org.elasticsearch.license.core.CryptUtils.encrypt;
|
||||
|
||||
public class TrialLicenseUtils {
|
||||
|
||||
|
|
Loading…
Reference in New Issue