Showing with 11 additions and 3 deletions.
  1. +8 −0 CHANGELOG.md
  2. +2 −2 lib/puppet_x/tragiccode/azure.rb
  3. +1 −1 metadata.json
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [1.0.2](https://github.com/tragiccode/tragiccode-azure_key_vault/tree/1.0.2) (2018-12-19)

[Full Changelog](https://github.com/tragiccode/tragiccode-azure_key_vault/compare/1.0.1...1.0.2)

### Fixed

- \(GH-47\) Fix ruby 1.9 issue with uri [\#48](https://github.com/TraGicCode/tragiccode-azure_key_vault/pull/48) ([TraGicCode](https://github.com/TraGicCode))

## [1.0.1](https://github.com/tragiccode/tragiccode-azure_key_vault/tree/1.0.1) (2018-12-14)

[Full Changelog](https://github.com/tragiccode/tragiccode-azure_key_vault/compare/1.0.0...1.0.1)
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet_x/tragiccode/azure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module TragicCode
class Azure
def self.get_access_token(api_version)
uri = URI("http://169.254.169.254/metadata/identity/oauth2/token?api-version=#{api_version}&resource=https%3A%2F%2Fvault.azure.net")
req = Net::HTTP::Get.new(uri.to_s)
req = Net::HTTP::Get.new(uri.request_uri)
req['Metadata'] = 'true'
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(req)
Expand All @@ -18,7 +18,7 @@ def self.get_access_token(api_version)
def self.get_secret(vault_name, secret_name, vault_api_version, access_token, secret_version)
version_parameter = secret_version.empty? ? secret_version : "/#{secret_version}"
uri = URI("https://#{vault_name}.vault.azure.net/secrets/#{secret_name}#{version_parameter}?api-version=#{vault_api_version}")
req = Net::HTTP::Get.new(uri.to_s)
req = Net::HTTP::Get.new(uri.request_uri)
req['Authorization'] = "Bearer #{access_token}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tragiccode-azure_key_vault",
"version": "1.0.1",
"version": "1.0.2",
"author": "tragiccode",
"summary": "The azure_key_vault module allows you to easily fetch secrets securely within your puppet manifests.",
"license": "Apache-2.0",
Expand Down