Skip to content

Commit

Permalink
Merge pull request zendesk#1241 from zendesk/grosser/vault
Browse files Browse the repository at this point in the history
newer vault server no longer gets read as json
  • Loading branch information
grosser authored Aug 30, 2016
2 parents 0706110 + c04b6a5 commit 8dd69f6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ GEM
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.0.5)
vault (0.4.0)
vault (0.5.0)
warden (1.2.6)
rack (>= 1.0)
warden-doorkeeper (0.3.0)
Expand Down
19 changes: 19 additions & 0 deletions config/initializers/vault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,23 @@ def vault_instances(key)
end
end
end

# fixed in vault server 0.6.2 https://github.com/hashicorp/vault/pull/1795
Vault::Client.prepend(Module.new do
def success(response)
response.content_type = 'application/json' if response.body && response.body.start_with?('{', '[')
super
end
end)

# fixed in vault gem 0.5.1 https://github.com/hashicorp/vault-ruby/pull/93
if defined?(Vault::Secret)
Vault::Secret.class_eval do
def to_h
self.class.fields.each_with_object({}) do |(k, _), hash|
hash[k] = instance_variable_get(:"@#{k}")
end
end
end
end
end
Binary file removed vendor/cache/vault-0.4.0.gem
Binary file not shown.
Binary file added vendor/cache/vault-0.5.0.gem
Binary file not shown.

0 comments on commit 8dd69f6

Please sign in to comment.