smart_proxy_vault 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59bbf36d677feac1a85674ef5b6e4592cbaabef9
4
- data.tar.gz: 9eb12ef4c3225de70436601091f30dcc0dc61e64
3
+ metadata.gz: d958e77e7944556550d5d7f3fdb6cea588e7c45d
4
+ data.tar.gz: 8927ce08debe184621ef09211bcaba46711a1d49
5
5
  SHA512:
6
- metadata.gz: 52623d07b6e789637e376e452128e6a6c198554aad07dcb1da727f20b5885675cc11f16b1bff5fc64505b95ae9e4359dd841a1fa5fac5dbe69ba914220d4f6dd
7
- data.tar.gz: 48f28cecae0135f976ddc9a601c92dc37ad0119c9566003a6f4feda0c64778f53c379daddb3070540e536acb72f1a7845540c4a59590bafc2d1a32e1316d31b6
6
+ metadata.gz: b77ebcc1be5d16d2fb732943a670dafe22f6dc4cf2a7b70463b54f2fea3b564e5e424cdb2202905d7ea9f1cab93822f26bee903248e4ee8950e7cef9ddff8b41
7
+ data.tar.gz: 69daadef0e185c5fd29486fcc426f602ffe96a0a5dd3ad659d19bbad742424e901e7cd4e48084d36bdd6f39740e1333f8c8ad09535bdb948b5d43481c9067d39
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.4.2](https://github.com/theforeman/smart_proxy_vault/tree/v0.4.1)
4
+ - Fixed issue with requesting a role token that didn't contain the default policy
5
+
3
6
  ## [v0.4.1](https://github.com/theforeman/smart_proxy_vault/tree/v0.4.1)
4
7
  - Fix for https://github.com/hashicorp/vault-ruby/issues/121
5
8
 
data/README.md CHANGED
@@ -95,7 +95,7 @@ If set to true, this plugin will add the requesting client's ID (as determined b
95
95
 
96
96
  #####:token_options:
97
97
 
98
- A hash of parameters that will be passed to the token creation call ([/auth/token/create](https://www.vaultproject.io/docs/auth/token.html)).
98
+ A hash of parameters that will be passed to the token creation call except when requesting a role token ([/auth/token/create](https://www.vaultproject.io/docs/auth/token.html)).
99
99
 
100
100
  #### Chef Backend
101
101
 
@@ -46,7 +46,7 @@ module VaultPlugin
46
46
  def issue(ttl, role)
47
47
  begin
48
48
  opts = options ttl
49
- role.nil? ? Client.issue_token(opts) : Client.issue_role_token(role, opts)
49
+ role.nil? ? Client.issue_token(opts) : Client.issue_role_token(role, metadata)
50
50
  rescue StandardError => e
51
51
  log_halt 500, 'Failed to generate Vault token ' + e.message
52
52
  end
@@ -1,3 +1,3 @@
1
1
  module VaultPlugin
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -24,6 +24,12 @@ class RequestTest < Test::Unit::TestCase
24
24
  end
25
25
  end
26
26
 
27
+ def stub_add_token_metadata
28
+ any_instance_of(VaultPlugin::Endpoint) do |klass|
29
+ stub(klass).add_token_metadata? { false }
30
+ end
31
+ end
32
+
27
33
  def token
28
34
  {lease_id: "",
29
35
  renewable: false,
@@ -81,8 +87,7 @@ class RequestTest < Test::Unit::TestCase
81
87
 
82
88
  def stub_response_role
83
89
  stub_request(:post, "https://vault.example.com/v1/auth/token/create/foo").
84
- with(:body => "{\"ttl\":\"12h\"}",
85
- :headers => { 'Accept'=>['*/*', 'application/json'],
90
+ with(:headers => { 'Accept'=>['*/*', 'application/json'],
86
91
  'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
87
92
  'Content-Type'=>'application/json',
88
93
  'User-Agent'=>['Ruby', 'VaultRuby/0.7.3 (+github.com/hashicorp/vault-ruby)'],
@@ -134,8 +139,9 @@ class RequestTest < Test::Unit::TestCase
134
139
  end
135
140
 
136
141
  def test_vault_token_issue_role
142
+ stub_add_token_metadata
137
143
  stub_response_role
138
- get '/token/issue', role: 'foo', ttl: '12h'
144
+ get '/token/issue', role: 'foo'
139
145
  assert last_response.ok?
140
146
  end
141
147
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-16 00:00:00.000000000 Z
12
+ date: 2017-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler