use of tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder in project web3signer by ConsenSys.
the class KeyManagerTestBase method setupSignerWithKeyManagerApi.
protected void setupSignerWithKeyManagerApi(final boolean insertSlashingProtectionData) throws URISyntaxException {
final SignerConfigurationBuilder builder = new SignerConfigurationBuilder();
builder.withKeyStoreDirectory(testDirectory).withMode("eth2").withAltairForkEpoch(MINIMAL_ALTAIR_FORK).withSlashingEnabled(true).withSlashingProtectionDbUsername(DB_USERNAME).withSlashingProtectionDbPassword(DB_PASSWORD).withKeyManagerApiEnabled(true);
startSigner(builder.build());
if (insertSlashingProtectionData) {
final SignerConfigurationBuilder importBuilder = new SignerConfigurationBuilder();
importBuilder.withMode("eth2").withSlashingEnabled(true).withSlashingProtectionDbUrl(signer.getSlashingDbUrl()).withSlashingProtectionDbUsername(DB_USERNAME).withSlashingProtectionDbPassword(DB_PASSWORD).withKeyStoreDirectory(testDirectory).withSlashingImportPath(getResourcePath("slashing/slashingImport_two_entries.json")).withHttpPort(// prevent wait for Ports file in AT
12345);
final Signer importSigner = new Signer(importBuilder.build(), null);
importSigner.start();
waitFor(() -> assertThat(importSigner.isRunning()).isFalse());
}
}
use of tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder in project web3signer by ConsenSys.
the class SigningAcceptanceTestBase method setupEth2SignerMinimalWithoutAltairFork.
protected void setupEth2SignerMinimalWithoutAltairFork() {
final SignerConfigurationBuilder builder = new SignerConfigurationBuilder();
builder.withKeyStoreDirectory(testDirectory).withMode("eth2").withNetwork("minimal");
startSigner(builder.build());
}
use of tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder in project web3signer by ConsenSys.
the class AzureKeyVaultAcceptanceTest method invalidVaultParametersFailsToStartSigner.
@Test
void invalidVaultParametersFailsToStartSigner() {
final AzureKeyVaultParameters azureParams = new DefaultAzureKeyVaultParameters("nonExistentVault", CLIENT_ID, TENANT_ID, CLIENT_SECRET);
final SignerConfigurationBuilder configBuilder = new SignerConfigurationBuilder().withMode("eth2").withAzureKeyVaultParameters(azureParams).withHttpPort(// required to prevent waiting for ports file.
9000);
final Signer signer = new Signer(configBuilder.build(), null);
signer.start();
waitFor(30, () -> assertThat(signer.isRunning()).isTrue());
waitFor(30, () -> assertThat(signer.isRunning()).isFalse());
}
use of tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder in project web3signer by ConsenSys.
the class AzureKeyVaultAcceptanceTest method ensureSecretsInKeyVaultAreLoadedAndReportedViaPublicKeysApi.
@Test
void ensureSecretsInKeyVaultAreLoadedAndReportedViaPublicKeysApi() {
final AzureKeyVaultParameters azureParams = new DefaultAzureKeyVaultParameters(VAULT_NAME, CLIENT_ID, TENANT_ID, CLIENT_SECRET);
final SignerConfigurationBuilder configBuilder = new SignerConfigurationBuilder().withMode("eth2").withAzureKeyVaultParameters(azureParams);
startSigner(configBuilder.build());
final Response response = signer.callApiPublicKeys(KeyType.BLS);
response.then().statusCode(200).contentType(ContentType.JSON).body("", contains(EXPECTED_KEY));
}
use of tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder in project web3signer by ConsenSys.
the class HttpHostAllowListAcceptanceTest method httpEndpointForNonAllowedHostRespondsWithForbiddenResponse.
@Test
void httpEndpointForNonAllowedHostRespondsWithForbiddenResponse() {
final SignerConfiguration signerConfiguration = new SignerConfigurationBuilder().withHttpAllowHostList(Collections.singletonList("127.0.0.1")).withMode("eth2").build();
startSigner(signerConfiguration);
given().baseUri(signer.getUrl()).contentType(ContentType.JSON).when().header("Host", "bar").get(UPCHECK_ENDPOINT).then().assertThat().statusCode(403);
}
Aggregations