smart_proxy_vault 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/smart_proxy_vault/api.rb +1 -1
- data/lib/smart_proxy_vault/version.rb +1 -1
- data/test/request_test.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d958e77e7944556550d5d7f3fdb6cea588e7c45d
|
4
|
+
data.tar.gz: 8927ce08debe184621ef09211bcaba46711a1d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77ebcc1be5d16d2fb732943a670dafe22f6dc4cf2a7b70463b54f2fea3b564e5e424cdb2202905d7ea9f1cab93822f26bee903248e4ee8950e7cef9ddff8b41
|
7
|
+
data.tar.gz: 69daadef0e185c5fd29486fcc426f602ffe96a0a5dd3ad659d19bbad742424e901e7cd4e48084d36bdd6f39740e1333f8c8ad09535bdb948b5d43481c9067d39
|
data/CHANGELOG.md
CHANGED
@@ -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,
|
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
|
data/test/request_test.rb
CHANGED
@@ -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(:
|
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'
|
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.
|
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:
|
12
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|