Search in sources :

Example 1 with ApacheHttpClientProvider

use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider in project lowkey-vault by nagyesta.

the class ManagementStepDefs method aVaultIsCreatedWithName.

@Given("a vault is created with name {name}")
public void aVaultIsCreatedWithName(final String vaultName) {
    final String vaultAuthority = vaultName + ".localhost:8443";
    final String vaultUrl = "https://" + vaultAuthority;
    final AuthorityOverrideFunction overrideFunction = new AuthorityOverrideFunction(vaultAuthority, CONTAINER_AUTHORITY);
    context.setProvider(new ApacheHttpClientProvider(vaultUrl, overrideFunction));
    context.getClient().createVault(URI.create(vaultUrl), RecoveryLevel.RECOVERABLE_AND_PURGEABLE, 90);
}
Also used : ApacheHttpClientProvider(com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider) AuthorityOverrideFunction(com.github.nagyesta.lowkeyvault.http.AuthorityOverrideFunction) Given(io.cucumber.java.en.Given)

Example 2 with ApacheHttpClientProvider

use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider in project lowkey-vault by nagyesta.

the class SecretsStepDefs method theSecretClientIsCreatedWithVaultNameSelected.

@Given("a secret client is created with the vault named {name}")
public void theSecretClientIsCreatedWithVaultNameSelected(final String vaultName) {
    final String vaultAuthority = vaultName + ".localhost:8443";
    final String vaultUrl = "https://" + vaultAuthority;
    final AuthorityOverrideFunction overrideFunction = new AuthorityOverrideFunction(vaultAuthority, CONTAINER_AUTHORITY);
    context.setProvider(new ApacheHttpClientProvider(vaultUrl, overrideFunction));
}
Also used : ApacheHttpClientProvider(com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider) AuthorityOverrideFunction(com.github.nagyesta.lowkeyvault.http.AuthorityOverrideFunction) Given(io.cucumber.java.en.Given)

Example 3 with ApacheHttpClientProvider

use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider in project lowkey-vault by nagyesta.

the class KeysStepDefs method theKeyClientIsCreatedWithVaultNameSelected.

@Given("a key client is created with the vault named {name}")
public void theKeyClientIsCreatedWithVaultNameSelected(final String vaultName) {
    final String vaultAuthority = vaultName + ".localhost:8443";
    final String vaultUrl = "https://" + vaultAuthority;
    final AuthorityOverrideFunction overrideFunction = new AuthorityOverrideFunction(vaultAuthority, CONTAINER_AUTHORITY);
    context.setProvider(new ApacheHttpClientProvider(vaultUrl, overrideFunction));
}
Also used : ApacheHttpClientProvider(com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider) AuthorityOverrideFunction(com.github.nagyesta.lowkeyvault.http.AuthorityOverrideFunction) Given(io.cucumber.java.en.Given)

Aggregations

ApacheHttpClientProvider (com.github.nagyesta.lowkeyvault.http.ApacheHttpClientProvider)3 AuthorityOverrideFunction (com.github.nagyesta.lowkeyvault.http.AuthorityOverrideFunction)3 Given (io.cucumber.java.en.Given)3