Skip to content

Commit

Permalink
Move AT DSL to fixtures sourceset (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-on authored Mar 16, 2020
1 parent dbcb445 commit 0377ab6
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 78 deletions.
2 changes: 0 additions & 2 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ dependencies {

testImplementation 'org.apache.logging.log4j:log4j-api'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.apache.tuweni:tuweni-net'
testImplementation(testFixtures(project(":keystorage:hashicorp")))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

import static org.assertj.core.api.Assertions.assertThat;

import tech.pegasys.signers.dsl.DockerClientFactory;
import tech.pegasys.signers.dsl.certificates.CertificateHelpers;
import tech.pegasys.signers.dsl.hashicorp.HashicorpNode;
import tech.pegasys.signing.hashicorp.HashicorpConnection;
import tech.pegasys.signing.hashicorp.HashicorpConnectionFactory;
import tech.pegasys.signing.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader;
import tech.pegasys.signing.hashicorp.util.HashicorpConfigUtil;
import tech.pegasys.signers.hashicorp.HashicorpConnection;
import tech.pegasys.signers.hashicorp.HashicorpConnectionFactory;
import tech.pegasys.signers.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader;
import tech.pegasys.signers.hashicorp.dsl.DockerClientFactory;
import tech.pegasys.signers.hashicorp.dsl.HashicorpNode;
import tech.pegasys.signers.hashicorp.dsl.certificates.CertificateHelpers;
import tech.pegasys.signers.hashicorp.util.HashicorpConfigUtil;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -42,7 +42,7 @@ public class HashicorpVaultAccessAcceptanceTest {
private static final Logger LOG = LogManager.getLogger();

private final Vertx vertx = Vertx.vertx();
final DockerClient docker = new DockerClientFactory().create();
private final DockerClient docker = new DockerClientFactory().create();
private HashicorpNode hashicorpNode;

private final String SECRET_KEY = "storedSecetKey";
Expand Down
4 changes: 0 additions & 4 deletions keystorage/hashicorp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ dependencies {
integrationTestImplementation sourceSets.testFixtures.output

testFixturesImplementation 'com.github.docker-java:docker-java'
testFixturesImplementation 'org.apache.logging.log4j:log4j-core'
testFixturesImplementation 'org.apache.logging.log4j:log4j-slf4j-impl'
testFixturesImplementation 'org.apache.logging.log4j:log4j-api'
testFixturesImplementation 'org.assertj:assertj-core'
testFixturesImplementation 'org.awaitility:awaitility'
testFixturesImplementation 'org.apache.tuweni:tuweni-net'
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-engine'
testFixturesImplementation 'org.bouncycastle:bcpkix-jdk15on'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockserver.configuration.ConfigurationProperties.javaKeyStoreFilePath;
import static org.mockserver.configuration.ConfigurationProperties.javaKeyStorePassword;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
import static tech.pegasys.signing.hashicorp.util.HashicorpConfigUtil.createConfigFile;
import static tech.pegasys.signers.hashicorp.util.HashicorpConfigUtil.createConfigFile;

import tech.pegasys.signing.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader;
import tech.pegasys.signers.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader;

import java.io.IOException;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static io.vertx.core.http.HttpMethod.GET;

import tech.pegasys.signing.hashicorp.config.KeyDefinition;
import tech.pegasys.signers.hashicorp.config.KeyDefinition;

import java.util.Map;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import tech.pegasys.signing.hashicorp.config.ConnectionParameters;
import tech.pegasys.signing.hashicorp.config.TlsOptions;
import tech.pegasys.signers.hashicorp.config.ConnectionParameters;
import tech.pegasys.signers.hashicorp.config.TlsOptions;

import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

public class HashicorpException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import java.util.Collections;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import java.util.EnumSet;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config;
package tech.pegasys.signers.hashicorp.config;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config;
package tech.pegasys.signers.hashicorp.config;

public class HashicorpKeyConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config;
package tech.pegasys.signers.hashicorp.config;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config;
package tech.pegasys.signers.hashicorp.config;

import tech.pegasys.signing.hashicorp.TrustStoreType;
import tech.pegasys.signers.hashicorp.TrustStoreType;

import java.nio.file.Path;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config.loader.toml;

import tech.pegasys.signing.hashicorp.HashicorpException;
import tech.pegasys.signing.hashicorp.TrustStoreType;
import tech.pegasys.signing.hashicorp.config.ConnectionParameters;
import tech.pegasys.signing.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signing.hashicorp.config.KeyDefinition;
import tech.pegasys.signing.hashicorp.config.TlsOptions;
package tech.pegasys.signers.hashicorp.config.loader.toml;

import tech.pegasys.signers.hashicorp.HashicorpException;
import tech.pegasys.signers.hashicorp.TrustStoreType;
import tech.pegasys.signers.hashicorp.config.ConnectionParameters;
import tech.pegasys.signers.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signers.hashicorp.config.KeyDefinition;
import tech.pegasys.signers.hashicorp.config.TlsOptions;

import java.nio.file.Path;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.config.loader.toml;
package tech.pegasys.signers.hashicorp.config.loader.toml;

import tech.pegasys.signing.hashicorp.HashicorpException;
import tech.pegasys.signers.hashicorp.HashicorpException;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static org.assertj.core.api.Assertions.assertThatThrownBy;

import tech.pegasys.signing.hashicorp.config.ConnectionParameters;
import tech.pegasys.signing.hashicorp.config.TlsOptions;
import tech.pegasys.signers.hashicorp.config.ConnectionParameters;
import tech.pegasys.signers.hashicorp.config.TlsOptions;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

import tech.pegasys.signing.hashicorp.config.ConnectionParameters;
import tech.pegasys.signing.hashicorp.config.TlsOptions;
import tech.pegasys.signers.hashicorp.config.ConnectionParameters;
import tech.pegasys.signers.hashicorp.config.TlsOptions;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp;
package tech.pegasys.signers.hashicorp;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.loader;
package tech.pegasys.signers.hashicorp.loader;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import tech.pegasys.signing.hashicorp.HashicorpException;
import tech.pegasys.signing.hashicorp.TrustStoreType;
import tech.pegasys.signing.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signing.hashicorp.config.TlsOptions;
import tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader;
import tech.pegasys.signing.hashicorp.util.HashicorpConfigUtil;
import tech.pegasys.signers.hashicorp.HashicorpException;
import tech.pegasys.signers.hashicorp.TrustStoreType;
import tech.pegasys.signers.hashicorp.config.HashicorpKeyConfig;
import tech.pegasys.signers.hashicorp.config.TlsOptions;
import tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader;
import tech.pegasys.signers.hashicorp.util.HashicorpConfigUtil;

import java.io.IOException;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl;
package tech.pegasys.signers.hashicorp.dsl;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.DockerCmdExecFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.hashicorp;
package tech.pegasys.signers.hashicorp.dsl;

import tech.pegasys.signers.dsl.certificates.SelfSignedCertificate;
import tech.pegasys.signers.hashicorp.dsl.certificates.SelfSignedCertificate;

import java.util.Map;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.hashicorp;
package tech.pegasys.signers.hashicorp.dsl;

// This assumes there is a Vault Server running at the vault URL (for AT, typically in a docker)
public class HashicorpVaultCommands {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.hashicorp;
package tech.pegasys.signers.hashicorp.dsl;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.hashicorp;
package tech.pegasys.signers.hashicorp.dsl;

import static java.nio.file.Files.createTempDirectory;

import tech.pegasys.signers.dsl.certificates.SelfSignedCertificate;
import tech.pegasys.signers.hashicorp.dsl.certificates.SelfSignedCertificate;

import java.io.IOException;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.hashicorp;
package tech.pegasys.signers.hashicorp.dsl;

public class HashicorpVaultTokens {
private final String unsealKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.certificates;
package tech.pegasys.signers.hashicorp.dsl.certificates;

import java.io.FileOutputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signers.dsl.certificates;
package tech.pegasys.signers.hashicorp.dsl.certificates;

import static java.nio.charset.StandardCharsets.UTF_8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.signing.hashicorp.util;
package tech.pegasys.signers.hashicorp.util;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.Files.createTempFile;
import static java.nio.file.Files.writeString;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_KEY_NAME;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_KEY_PATH;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_SERVER_HOST;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_SERVER_PORT;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TIMEOUT;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_ENABLE;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_PASSWORD;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_PATH;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_TYPE;
import static tech.pegasys.signing.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TOKEN;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_KEY_NAME;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_KEY_PATH;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_SERVER_HOST;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_SERVER_PORT;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TIMEOUT;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_ENABLE;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_PASSWORD;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_PATH;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TLS_TS_TYPE;
import static tech.pegasys.signers.hashicorp.config.loader.toml.TomlConfigLoader.PROP_HASHICORP_TOKEN;

import java.io.IOException;
import java.nio.file.Path;
Expand Down

0 comments on commit 0377ab6

Please sign in to comment.