Search in sources :

Example 1 with AzureKeyVaultParameters

use of tech.pegasys.web3signer.core.config.AzureKeyVaultParameters 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());
}
Also used : Signer(tech.pegasys.web3signer.dsl.signer.Signer) SignerConfigurationBuilder(tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder) AzureKeyVaultParameters(tech.pegasys.web3signer.core.config.AzureKeyVaultParameters) DefaultAzureKeyVaultParameters(tech.pegasys.web3signer.dsl.utils.DefaultAzureKeyVaultParameters) DefaultAzureKeyVaultParameters(tech.pegasys.web3signer.dsl.utils.DefaultAzureKeyVaultParameters) Test(org.junit.jupiter.api.Test)

Example 2 with AzureKeyVaultParameters

use of tech.pegasys.web3signer.core.config.AzureKeyVaultParameters 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));
}
Also used : Response(io.restassured.response.Response) SignerConfigurationBuilder(tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder) AzureKeyVaultParameters(tech.pegasys.web3signer.core.config.AzureKeyVaultParameters) DefaultAzureKeyVaultParameters(tech.pegasys.web3signer.dsl.utils.DefaultAzureKeyVaultParameters) DefaultAzureKeyVaultParameters(tech.pegasys.web3signer.dsl.utils.DefaultAzureKeyVaultParameters) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 AzureKeyVaultParameters (tech.pegasys.web3signer.core.config.AzureKeyVaultParameters)2 SignerConfigurationBuilder (tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder)2 DefaultAzureKeyVaultParameters (tech.pegasys.web3signer.dsl.utils.DefaultAzureKeyVaultParameters)2 Response (io.restassured.response.Response)1 Signer (tech.pegasys.web3signer.dsl.signer.Signer)1