com.lordofthejars.nosqlunit.vault.DataLoader Maven / Gradle / Ivy
package com.lordofthejars.nosqlunit.vault;
import com.bettercloud.vault.response.AuthResponse;
import org.yaml.snakeyaml.Yaml;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
public class DataLoader {
private static final String TOKENS = "tokens";
private VaultConnection vault;
public DataLoader(VaultConnection vault) {
this.vault = vault;
}
public void load(InputStream inputStream) {
final Yaml yaml = new Yaml();
final Object load = yaml.load(inputStream);
if (areOnlySecrets(load)) {
final List