lib/consul/async/consul_template.rb in consul-templaterb-1.3.1 vs lib/consul/async/consul_template.rb in consul-templaterb-1.4.0
- old
+ new
@@ -137,13 +137,12 @@
path = "/v1/#{path}".gsub(/\/{2,}/, '/')
query_params = {list: "true"}
create_if_missing(path, query_params) { ConsulTemplateVaultSecretList.new(VaultEndpoint.new(vault_conf, path, 'GET',true, query_params,JSON.generate(data: {keys: []}))) }
end
- def secret(path = '', post_data = nil )
- puts post_data
- raise "You need to provide a vault token to use 'secrets' keyword" if vault_conf.token.nil?
- path = "/v1/#{path}"
+ def secret(path = '', post_data = nil)
+ raise "You need to provide a vault token to use 'secret' keyword" if vault_conf.token.nil?
+ path = "/v1/#{path}".gsub(/\/{2,}/, '/')
query_params = {}
method = post_data ? "POST" : "GET"
create_if_missing(path, query_params) { ConsulTemplateVaultSecret.new(VaultEndpoint.new(vault_conf, path, method, true, query_params, JSON.generate(data: {}))) }
end