use of com.azure.security.keyvault.secrets.models.DeletedSecret in project lowkey-vault by nagyesta.
the class SecretsStepDefs method countSecretsWithKeyNamePrefixAreDeleted.
@Given("{int} secrets with {name} prefix are deleted")
public void countSecretsWithKeyNamePrefixAreDeleted(final int count, final String prefix) {
final List<String> deleted = IntStream.range(0, count).mapToObj(i -> {
final DeletedSecret actual = context.getClient(context.getSecretServiceVersion()).beginDeleteSecret(prefix + (i + 1)).waitForCompletion().getValue();
context.setLastDeleted(actual);
return actual;
}).map(DeletedSecret::getRecoveryId).collect(Collectors.toList());
context.setDeletedRecoveryIds(deleted);
}
use of com.azure.security.keyvault.secrets.models.DeletedSecret in project lowkey-vault by nagyesta.
the class SecretsStepDefs method theSecretIsPurged.
@When("the secret is purged")
public void theSecretIsPurged() {
final DeletedSecret deleted = context.getLastDeleted();
context.getClient(context.getSecretServiceVersion()).purgeDeletedSecret(deleted.getName());
}
use of com.azure.security.keyvault.secrets.models.DeletedSecret in project lowkey-vault by nagyesta.
the class SecretsStepDefs method theSecretIsDeleted.
@And("the secret is deleted")
public void theSecretIsDeleted() {
final DeletedSecret actual = context.getClient(context.getSecretServiceVersion()).beginDeleteSecret(context.getLastResult().getName()).waitForCompletion().getValue();
context.setLastDeleted(actual);
}
use of com.azure.security.keyvault.secrets.models.DeletedSecret in project lowkey-vault by nagyesta.
the class SecretsStepDefs method secretIsRecovered.
@When("secret is recovered")
public void secretIsRecovered() {
final DeletedSecret deleted = context.getLastDeleted();
final KeyVaultSecret secret = context.getClient(context.getSecretServiceVersion()).beginRecoverDeletedSecret(deleted.getName()).waitForCompletion().getValue();
context.addFetchedSecret(secret.getName(), secret);
}
Aggregations