conjur-cli 5.2.3 → 5.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c180984ae48ea8f700f458b5e4192220236a39c6
4
- data.tar.gz: 664acc9c44bed2de214b872dcf266ebac4261fa6
3
+ metadata.gz: 465b9de6e8a2c63bfc0ff50a4f421beac585e858
4
+ data.tar.gz: 1fa9c46b64f9029a34bc37ea50492c5a14866be7
5
5
  SHA512:
6
- metadata.gz: 0e6d6f661f6031014dda7e313197113495f7b52967a9e12345b1885798fd7df98767a7e75606f9fafd0e4f97c8fc3bdfaf9c9776ec46fc0efd198091d9053114
7
- data.tar.gz: fe1f4b89b9ffd8d22e85e62bd20477fc5fbd60852ae6e6e69d7ff8e6e605c4a987b940ffba2c71f1e72a4f9d088c81b2fffebba9e90243ed7d7c604865330810
6
+ metadata.gz: 908d69e05ec7941e47e724b484a828ce20e316c1abc4f9241d3c81cc9c5b6d09371a1e79b0ef2fe76608aa9af04728b884356191348e0e30f954555cfaa9bfa8
7
+ data.tar.gz: 43a250909cbdef74620981d1a2b437117b2f74c19bfb146297b0ec50aaba6108b434cbea226329a75d755033ab1d21814665063cb853f4010ae4a8caac07cc94
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 5.2.4
2
+
3
+ * Fix behavior of `conjur env`, when detecting variables vs literals
4
+
1
5
  # 5.2.3
2
6
 
3
7
  * Disable prompts in bootstrap when there's no tty
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source 'https://rubygems.org'
6
6
  # Specify your gem's dependencies in conjur.gemspec
7
7
  gemspec
8
8
 
9
- gem 'conjur-api', '>= 4.24', git: 'https://github.com/conjurinc/api-ruby.git', branch: 'master'
9
+ gem 'conjur-api', '>= 4.26', git: 'https://github.com/conjurinc/api-ruby.git', branch: 'master'
10
10
  gem 'semantic', '>= 1.4.1', git: 'https://github.com/jlindsey/semantic.git'
11
11
 
12
12
  group :test, :development do
@@ -25,7 +25,7 @@ module Conjur
25
25
  class Env
26
26
 
27
27
  class CustomTag
28
- def initialize id
28
+ def initialize id
29
29
  raise "#{self.class.name.split('::').last} requires a parameter" if id.to_s.empty?
30
30
  @id=id
31
31
  end
@@ -49,9 +49,9 @@ module Conjur
49
49
 
50
50
  class ConjurTempfile < CustomTag
51
51
  def evaluate value
52
- @tempfile = if File.directory?("/dev/shm") and File.writable?("/dev/shm")
52
+ @tempfile = if File.directory?("/dev/shm") and File.writable?("/dev/shm")
53
53
  Tempfile.new("conjur","/dev/shm")
54
- else
54
+ else
55
55
  Tempfile.new("conjur")
56
56
  end
57
57
  @tempfile.write(value)
@@ -63,7 +63,7 @@ module Conjur
63
63
  def initialize(options={})
64
64
  raise ":file and :yaml options can not be provided together" if ( options.has_key?(:file) and options.has_key?(:yaml) )
65
65
 
66
- yaml = if options.has_key?(:yaml)
66
+ yaml = if options.has_key?(:yaml)
67
67
  raise ":yaml option should be non-empty string" unless options[:yaml].kind_of?(String)
68
68
  raise ":yaml option should be non-empty string" if options[:yaml].empty?
69
69
  options[:yaml]
@@ -88,7 +88,7 @@ module Conjur
88
88
  definition.keys.select { |k| definition[k].kind_of? Fixnum }.each { |k| definition[k]="#{definition[k]}" }
89
89
  bad_types = definition.values.select { |v| not (v.kind_of?(String) or v.kind_of?(CustomTag)) }.map {|v| v.class}.uniq
90
90
  raise "Definition can not include values of types: #{bad_types}" unless bad_types.empty?
91
- definition.inject({}) do |memo,e|
91
+ definition.inject({}) do |memo,e|
92
92
  key, value = e
93
93
  substitutions.each do |k,v|
94
94
  value.gsub! k, v
@@ -103,32 +103,30 @@ module Conjur
103
103
  runtime_environment={}
104
104
  variable_ids= @definition.values.map { |v| v.conjur_id rescue nil }.compact
105
105
  conjur_values=api.variable_values(variable_ids)
106
- @definition.each { |environment_name, reference|
107
- runtime_environment[environment_name]= if reference.respond_to?(:evaluate)
108
- reference.evaluate( conjur_values[reference.conjur_id] )
109
- else
110
- reference # is a literal value
111
- end
112
- }
106
+ @definition.each do |environment_name, reference|
107
+ if reference.respond_to?(:evaluate)
108
+ runtime_environment[environment_name] = reference.evaluate( conjur_values[reference.conjur_id] )
109
+ else
110
+ runtime_environment[environment_name] = reference # is a literal value
111
+ end
112
+ end
113
113
  return runtime_environment
114
114
  end
115
115
 
116
116
  def check(api)
117
- Hash[
118
- @definition.map { |k,v|
119
-
120
- status = if v.respond_to? :conjur_id
121
- if api.resource("variable:"+v.conjur_id).permitted?(:execute)
122
- :available
123
- else
124
- :unavailable
125
- end
126
- else
127
- :literal
128
- end
129
-
117
+ Hash[
118
+ @definition.map.each do |k,v|
119
+ if v.respond_to? :conjur_id
120
+ if api.resource("variable:"+v.conjur_id).permitted?(:execute)
121
+ status = :available
122
+ else
123
+ status = :unavailable
124
+ end
125
+ else
126
+ status = :literal
127
+ end
130
128
  [ k, status ]
131
- }
129
+ end
132
130
  ]
133
131
  end
134
132
 
@@ -19,6 +19,6 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
  module Conjur
22
- VERSION = '5.2.3'
22
+ VERSION = '5.2.4'
23
23
  ::Version=VERSION
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.3
4
+ version: 5.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafal Rzepecki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-17 00:00:00.000000000 Z
12
+ date: 2016-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport