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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/lib/conjur/conjurenv.rb +24 -26
- data/lib/conjur/version.rb +1 -1
- 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: 465b9de6e8a2c63bfc0ff50a4f421beac585e858
|
4
|
+
data.tar.gz: 1fa9c46b64f9029a34bc37ea50492c5a14866be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908d69e05ec7941e47e724b484a828ce20e316c1abc4f9241d3c81cc9c5b6d09371a1e79b0ef2fe76608aa9af04728b884356191348e0e30f954555cfaa9bfa8
|
7
|
+
data.tar.gz: 43a250909cbdef74620981d1a2b437117b2f74c19bfb146297b0ec50aaba6108b434cbea226329a75d755033ab1d21814665063cb853f4010ae4a8caac07cc94
|
data/CHANGELOG.md
CHANGED
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.
|
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
|
data/lib/conjur/conjurenv.rb
CHANGED
@@ -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
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
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
|
|
data/lib/conjur/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|