conjur-cli 6.2.0 → 6.2.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Jenkinsfile +22 -31
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/bin/conjur +3 -1
- data/ci/cli-test.sh +5 -1
- data/conjur-cli.gemspec +1 -2
- data/dev/docker-compose.yml +1 -0
- data/dev/start.sh +3 -3
- data/features/hostfactory/tokens.feature +1 -1
- data/features/pubkeys/show.feature +0 -4
- data/features/step_definitions/cli_steps.rb +0 -19
- data/features/step_definitions/overrides.rb +3 -5
- data/features/support/hooks.rb +0 -11
- data/lib/conjur/cli.rb +1 -3
- data/lib/conjur/version.rb +1 -1
- data/needs-publishing +28 -0
- data/test.sh +5 -0
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0520b947529d571863374704ce0b613a07b6e63fa1e9cb37932e0d254e17353
|
4
|
+
data.tar.gz: 490b04289eb77fdbb1c7d56fc317ac6266111af4cde3fb6a655c92e48cf50cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726d627c741a1a7ae611316dd482e6b2d6633e8d193fef1879f1acd5d8a86e68f8f5a0e5f0d6679085b7f15a86930a2a747c6a43c307ebedcd31494d52b1714e
|
7
|
+
data.tar.gz: 0424f34f72f7b625270eb42cbfe432160ab4a063a2600d82b7a8efe51d07df5e95a42d85b5dc3138d4074e63d2e28b8fc2a448d6c6ffe61f1715cd477269b2a2
|
data/CHANGELOG.md
CHANGED
data/Jenkinsfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#!/usr/bin/env groovy
|
2
|
+
|
1
3
|
pipeline {
|
2
4
|
agent { label 'executor-v2' }
|
3
5
|
|
@@ -6,10 +8,14 @@ pipeline {
|
|
6
8
|
buildDiscarder(logRotator(daysToKeepStr: '30'))
|
7
9
|
}
|
8
10
|
|
11
|
+
triggers {
|
12
|
+
cron(getDailyCronString())
|
13
|
+
}
|
14
|
+
|
9
15
|
stages {
|
10
|
-
stage('Test 2.
|
16
|
+
stage('Test 2.4') {
|
11
17
|
environment {
|
12
|
-
RUBY_VERSION = '2.
|
18
|
+
RUBY_VERSION = '2.4'
|
13
19
|
}
|
14
20
|
steps {
|
15
21
|
sh './test.sh'
|
@@ -17,9 +23,9 @@ pipeline {
|
|
17
23
|
}
|
18
24
|
}
|
19
25
|
|
20
|
-
stage('Test 2.
|
26
|
+
stage('Test 2.5') {
|
21
27
|
environment {
|
22
|
-
RUBY_VERSION = '2.
|
28
|
+
RUBY_VERSION = '2.5'
|
23
29
|
}
|
24
30
|
steps {
|
25
31
|
sh './test.sh'
|
@@ -27,9 +33,9 @@ pipeline {
|
|
27
33
|
}
|
28
34
|
}
|
29
35
|
|
30
|
-
stage('Test 2.
|
36
|
+
stage('Test 2.6') {
|
31
37
|
environment {
|
32
|
-
RUBY_VERSION = '2.
|
38
|
+
RUBY_VERSION = '2.6'
|
33
39
|
}
|
34
40
|
steps {
|
35
41
|
sh './test.sh'
|
@@ -37,12 +43,18 @@ pipeline {
|
|
37
43
|
}
|
38
44
|
}
|
39
45
|
|
40
|
-
stage('Build standalone image
|
46
|
+
stage('Build standalone image') {
|
47
|
+
steps {
|
48
|
+
sh './build-standalone'
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
stage('Push standalone image to DockerHub') {
|
41
53
|
when {
|
42
54
|
branch 'master'
|
43
55
|
}
|
56
|
+
|
44
57
|
steps {
|
45
|
-
sh './build-standalone'
|
46
58
|
sh './push-image'
|
47
59
|
}
|
48
60
|
}
|
@@ -56,32 +68,11 @@ pipeline {
|
|
56
68
|
expression { currentBuild.resultIsBetterOrEqualTo('SUCCESS') }
|
57
69
|
branch "master"
|
58
70
|
expression {
|
59
|
-
def exitCode = sh returnStatus: true, script: ''
|
60
|
-
echo "Determining if publishing is requested..."
|
61
|
-
|
62
|
-
VERSION=`cat lib/conjur/version.rb | grep \'VERSION\\s*=\' | sed -e "s/.*\'\\(.*\\)\'.*/\\1/"`
|
63
|
-
echo Declared version: $VERSION
|
64
|
-
|
65
|
-
# Jenkins git plugin is broken and always fetches with `--no-tags`
|
66
|
-
# (or `--tags`, neither of which is what you want), so tags end up
|
67
|
-
# not being fetched. Try to fix that.
|
68
|
-
# (Unfortunately this fetches all remote heads, so we may have to find
|
69
|
-
# another solution for bigger repos.)
|
70
|
-
git fetch -q
|
71
|
-
|
72
|
-
# note when tag not found git rev-parse will just print its name
|
73
|
-
# TAG=`git rev-parse tags/v$VERSION 2>/dev/null || :`
|
74
|
-
TAG=`git rev-list -n 1 "v$VERSION" 2>/dev/null || :`
|
75
|
-
echo Tag v$VERSION: $TAG
|
76
|
-
|
77
|
-
HEAD=`git rev-parse HEAD`
|
78
|
-
echo HEAD: $HEAD
|
79
|
-
|
80
|
-
test "$HEAD" = "$TAG"
|
81
|
-
'''
|
71
|
+
def exitCode = sh returnStatus: true, script: './needs-publishing'
|
82
72
|
return exitCode == 0
|
83
73
|
}
|
84
74
|
}
|
75
|
+
|
85
76
|
steps {
|
86
77
|
// Clean up first
|
87
78
|
sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd'
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.2.1
|
data/bin/conjur
CHANGED
data/ci/cli-test.sh
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
#!/bin/bash -ex
|
2
2
|
|
3
|
+
# This can run with mounted source directory which is used in different Ruby versions.
|
4
|
+
# Since library support is different for different versions, clear out the lock to
|
5
|
+
# make sure full gem resolution runs each time.
|
6
|
+
rm -f Gemfile.lock
|
3
7
|
bundle install
|
4
8
|
|
5
9
|
# If we got passed arguments, run that as the test command. Otherwise, run the full suite of tests.
|
6
|
-
${@-bundle exec rake jenkins}
|
10
|
+
exec ${@-bundle exec rake jenkins}
|
data/conjur-cli.gemspec
CHANGED
@@ -24,14 +24,13 @@ Gem::Specification.new do |gem|
|
|
24
24
|
gem.add_dependency 'highline', '~> 1.7'
|
25
25
|
gem.add_dependency 'netrc', '~> 0.10'
|
26
26
|
gem.add_dependency 'deep_merge', '~> 1.0'
|
27
|
-
gem.add_dependency 'xdg', '
|
27
|
+
gem.add_dependency 'xdg', '= 2.2.3'
|
28
28
|
gem.add_dependency 'table_print', '~> 1.5'
|
29
29
|
|
30
30
|
gem.add_development_dependency 'rspec', '~> 3.0'
|
31
31
|
gem.add_development_dependency 'simplecov'
|
32
32
|
gem.add_development_dependency 'aruba', '~> 0.12'
|
33
33
|
gem.add_development_dependency 'ci_reporter_rspec', '~> 1.0'
|
34
|
-
gem.add_development_dependency 'ci_reporter_cucumber', '~> 1.0'
|
35
34
|
gem.add_development_dependency 'rake', '~> 10.0'
|
36
35
|
gem.add_development_dependency 'io-grab', '~> 0.0'
|
37
36
|
gem.add_development_dependency 'json_spec'
|
data/dev/docker-compose.yml
CHANGED
data/dev/start.sh
CHANGED
@@ -6,9 +6,9 @@ export COMPOSE_PROJECT_NAME=clirubydev
|
|
6
6
|
docker-compose build
|
7
7
|
|
8
8
|
if [ ! -f data_key ]; then
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
echo "Generating data key"
|
10
|
+
docker-compose pull
|
11
|
+
docker-compose run --no-deps --rm conjur data-key generate > data_key
|
12
12
|
fi
|
13
13
|
|
14
14
|
export CONJUR_DATA_KEY="$(cat data_key)"
|
@@ -18,5 +18,5 @@ Feature: Host factory tokens
|
|
18
18
|
Scenario: create a host using a token
|
19
19
|
When I successfully run `conjur hostfactory tokens create myapp`
|
20
20
|
And I keep the JSON response at "0/token" as "TOKEN"
|
21
|
-
Then I successfully run `conjur hostfactory hosts create %{TOKEN} host-01`
|
21
|
+
Then I use it to successfully run `conjur hostfactory hosts create %{TOKEN} host-01`
|
22
22
|
And the JSON should have "api_key"
|
@@ -12,7 +12,3 @@ Feature: Show public keys for a user
|
|
12
12
|
Scenario: After adding a key, the key is shown
|
13
13
|
When I run `conjur pubkeys show alice`
|
14
14
|
And the output should match /^ssh-rsa .* laptop$/
|
15
|
-
|
16
|
-
Scenario: Public keys can be listed using cURL, without authentication
|
17
|
-
When I successfully run `curl -k $conjur_url/public_keys/cucumber/user/alice`
|
18
|
-
Then the output should match /^ssh-rsa .* laptop$/
|
@@ -1,22 +1,3 @@
|
|
1
|
-
Transform /\$ns/ do |s|
|
2
|
-
s.gsub('$ns', namespace)
|
3
|
-
end
|
4
|
-
|
5
|
-
Transform /\$user_role/ do |s|
|
6
|
-
s.gsub('$user_role', test_user.role_id)
|
7
|
-
end
|
8
|
-
|
9
|
-
Transform /^table:/ do |table|
|
10
|
-
table.tap do |t|
|
11
|
-
t.hashes.each do |row|
|
12
|
-
row.each do |_,v|
|
13
|
-
v.gsub!('$ns', namespace)
|
14
|
-
v.gsub!('$user_role', test_user.role_id)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
1
|
When /^the command completes successfully/ do
|
21
2
|
last_command_started.wait
|
22
3
|
last_command_started.terminate
|
@@ -1,9 +1,7 @@
|
|
1
1
|
# Use a json_spec style memorized value as an environment variable
|
2
|
-
When /I
|
2
|
+
When /I use it to (.*)/ do |statement|
|
3
3
|
JsonSpec.memory.each do |k,v|
|
4
|
-
|
5
|
-
v = v[1...-1] if v[0] == '"'
|
6
|
-
value.gsub! "%{#{k}}", v
|
4
|
+
statement = statement.gsub("%{#{k}}", v)
|
7
5
|
end
|
8
|
-
|
6
|
+
step "I #{statement}"
|
9
7
|
end
|
data/features/support/hooks.rb
CHANGED
@@ -4,17 +4,6 @@ Aruba.configure do |config|
|
|
4
4
|
config.io_wait_timeout = 2
|
5
5
|
end
|
6
6
|
|
7
|
-
Transform /\$conjur_url/ do |statement|
|
8
|
-
statement.gsub "$conjur_url", Conjur.configuration.appliance_url
|
9
|
-
end
|
10
|
-
|
11
|
-
Transform /\%\{\w+\}/ do |statement|
|
12
|
-
JsonSpec.memory.each do |k,v|
|
13
|
-
statement = statement.gsub("%{#{k}}", v)
|
14
|
-
end
|
15
|
-
statement
|
16
|
-
end
|
17
|
-
|
18
7
|
Before('@conjurapi-log') do
|
19
8
|
set_env 'CONJURAPI_LOG', 'stderr'
|
20
9
|
end
|
data/lib/conjur/cli.rb
CHANGED
@@ -25,9 +25,7 @@ require 'active_support/deprecation'
|
|
25
25
|
require 'xdg'
|
26
26
|
require 'fileutils'
|
27
27
|
|
28
|
-
# this makes mime/types gem load much faster by
|
29
|
-
# mime types and caching them in binary form
|
30
|
-
ENV['RUBY_MIME_TYPES_LAZY_LOAD'] ||= 'true'
|
28
|
+
# this makes mime/types gem load much faster by caching them in binary form
|
31
29
|
ENV['RUBY_MIME_TYPES_CACHE'] ||= (
|
32
30
|
XDG['CACHE'].to_path.tap(&FileUtils.method(:mkdir_p)) + 'ruby-mime-types.cache'
|
33
31
|
).to_s
|
data/lib/conjur/version.rb
CHANGED
data/needs-publishing
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/bin/bash -ex
|
2
|
+
|
3
|
+
echo "Determining if publishing is requested..."
|
4
|
+
|
5
|
+
VERSION=$(ruby -I lib -r conjur/version -e 'puts Conjur::VERSION')
|
6
|
+
echo Declared version: $VERSION
|
7
|
+
|
8
|
+
if curl -s https://rubygems.org/api/v1/versions/conjur-cli.json | jq -e ".[] | select(.number == \"$VERSION\")" >/dev/null; then
|
9
|
+
echo "Found $VERSION on rubygems, not republishing"
|
10
|
+
exit 1
|
11
|
+
fi
|
12
|
+
|
13
|
+
# Jenkins git plugin is broken and always fetches with `--no-tags`
|
14
|
+
# (or `--tags`, neither of which is what you want), so tags end up
|
15
|
+
# not being fetched. Try to fix that.
|
16
|
+
# (Unfortunately this fetches all remote heads, so we may have to find
|
17
|
+
# another solution for bigger repos.)
|
18
|
+
git fetch -q
|
19
|
+
|
20
|
+
# note when tag not found git rev-parse will just print its name
|
21
|
+
# TAG=`git rev-parse tags/v$VERSION 2>/dev/null || :`
|
22
|
+
TAG=`git rev-list -n 1 "v$VERSION" 2>/dev/null || :`
|
23
|
+
echo Tag v$VERSION: $TAG
|
24
|
+
|
25
|
+
HEAD=`git rev-parse HEAD`
|
26
|
+
echo HEAD: $HEAD
|
27
|
+
|
28
|
+
test "$HEAD" = "$TAG"
|
data/test.sh
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: 6.2.
|
4
|
+
version: 6.2.1
|
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:
|
12
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -105,16 +105,16 @@ dependencies:
|
|
105
105
|
name: xdg
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 2.2.3
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 2.2.3
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: table_print
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,20 +185,6 @@ dependencies:
|
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '1.0'
|
188
|
-
- !ruby/object:Gem::Dependency
|
189
|
-
name: ci_reporter_cucumber
|
190
|
-
requirement: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '1.0'
|
195
|
-
type: :development
|
196
|
-
prerelease: false
|
197
|
-
version_requirements: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - "~>"
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '1.0'
|
202
188
|
- !ruby/object:Gem::Dependency
|
203
189
|
name: rake
|
204
190
|
requirement: !ruby/object:Gem::Requirement
|
@@ -392,6 +378,7 @@ files:
|
|
392
378
|
- lib/conjur/version.rb
|
393
379
|
- lib/patches/conjur/error.rb
|
394
380
|
- lib/patches/gli.rb
|
381
|
+
- needs-publishing
|
395
382
|
- profile.rb
|
396
383
|
- publish.sh
|
397
384
|
- push-image
|
@@ -430,8 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
417
|
- !ruby/object:Gem::Version
|
431
418
|
version: '0'
|
432
419
|
requirements: []
|
433
|
-
|
434
|
-
rubygems_version: 2.7.6
|
420
|
+
rubygems_version: 3.0.3
|
435
421
|
signing_key:
|
436
422
|
specification_version: 4
|
437
423
|
summary: Conjur command line interface
|