conjur-cli 5.5.0 → 5.6.3

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: ac5dff61d36b91557e546edb4f9f0c42d1d47ae7
4
- data.tar.gz: 4b217db2dcbab92a5ac3d321043e05f67aaaab6d
3
+ metadata.gz: 9ed6b6ede4ce280bd68268f820911a620b7ab216
4
+ data.tar.gz: 8b5dfecbcbcabc3adb7d2e3325660e6a5a8e7c49
5
5
  SHA512:
6
- metadata.gz: 8ad164a85360446876629b60e811f881246238502149794de61efa3a7495de85e4bd6bc35bdd85e83958f5d7f8d6005bd788003fb6b07c39e8e76e25e9fa51fd
7
- data.tar.gz: df5671793e1adaad9e527bc1a8352de32f941fe99d914cfa9c503f05c12b55afc52a05cfc347508f8c3d443fe163b0e1f3507e72e5f03b9a2604c495845e948e
6
+ metadata.gz: 9d5e00ad48beb3ab211759acdaf249def511f3efe832dc04399c540102d9182488286de3900c792cb63015f3537cd7f677805f4b7f19c1984d6b2991507624b9
7
+ data.tar.gz: 464040c1700ea7ab95ecce32ce63681d81535af916ecf642fc8408d5c7756ddc8c5f828251e5830263e029f1051191bbc0fe0b1b1b40cfd9dc9cb18f9e443f3d
data/.rubocop.yml CHANGED
@@ -5,10 +5,10 @@ Style/MethodDefParentheses:
5
5
  EnforcedStyle: require_no_parentheses
6
6
 
7
7
  Style/StringLiterals:
8
- EnforcedStyle: double_quotes
8
+ Enabled: false # more trouble than it's worth
9
9
 
10
10
  Lint/EndAlignment:
11
- AlignWith: start_of_line
11
+ EnforcedStyleAlignWith: start_of_line
12
12
 
13
13
  Style/AndOr:
14
14
  EnforcedStyle: conditionals
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ # 5.6.3
2
+
3
+ * Fix the gemspec to reflect dependency changes.
4
+
5
+ # 5.6.2
6
+
7
+ * License changed to Apache 2.0
8
+ * Don't let conjur-api drift to v5.
9
+
10
+ # 5.6.1
11
+
12
+ * Fix handling of `-k / --kind` argument to `resource list`.
13
+
14
+ # 5.6.0
15
+
16
+ The following enhancements require Conjur server 4.9.1.0 or later:
17
+
18
+ * Supports filter and pagination of role-listing methods `role memberships`, `role members`, and `resource permitted_roles`.
19
+ * Supports non-recursive (`--no-recursive`) retrieval of `role memberships`.
20
+
21
+ On older server versions, the new options will be ignored by the server.
22
+
1
23
  # 5.5.0
2
24
 
3
25
  * Use `CONJUR_AUTHN_TOKEN_FILE` as the Conjur access token file, if it's available in the environment.
data/Dockerfile CHANGED
@@ -4,7 +4,7 @@ RUN mkdir /src
4
4
  WORKDIR /src
5
5
 
6
6
  COPY Gemfile Gemfile
7
- COPY conjur.gemspec conjur.gemspec
7
+ COPY conjur-cli.gemspec conjur-cli.gemspec
8
8
  COPY lib/conjur/version.rb lib/conjur/version.rb
9
9
 
10
10
  # Make sure only one version of bundler is available
data/Gemfile CHANGED
@@ -1,19 +1,14 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- #ruby=ruby-2.2.5
3
+ #ruby=ruby-2.4.1
4
4
  #ruby-gemset=conjur-cli
5
5
 
6
6
  # Specify your gem's dependencies in conjur.gemspec
7
7
  gemspec
8
8
 
9
- gem 'activesupport', '~> 4.2'
10
-
11
- gem 'conjur-api', '>= 4.29.0', git: 'https://github.com/conjurinc/api-ruby.git', branch: 'master'
12
- gem 'semantic', '>= 1.4.1', git: 'https://github.com/jlindsey/semantic.git'
13
-
14
9
  group :test, :development do
15
10
  gem 'pry' # Don't be tempted to change this to pry-byebug until we drop support for 1.9
16
11
  gem 'pry-doc'
17
12
  gem 'ruby-prof'
18
- gem 'conjur-debify', '~> 1.0'
13
+ gem 'conjur-debify', '~> 1.0', require: false
19
14
  end
data/Jenkinsfile ADDED
@@ -0,0 +1,98 @@
1
+ pipeline {
2
+ agent { label 'executor-v2' }
3
+
4
+ options {
5
+ timestamps()
6
+ buildDiscarder(logRotator(numToKeepStr: '30'))
7
+ }
8
+
9
+ stages {
10
+
11
+ stage('Test 2.2') {
12
+ environment {
13
+ RUBY_VERSION = '2.2'
14
+ }
15
+ steps {
16
+ sh './test.sh'
17
+ junit 'spec/reports/*.xml, features/reports/*.xml'
18
+ }
19
+ }
20
+
21
+ stage('Test 2.3') {
22
+ environment {
23
+ RUBY_VERSION = '2.3'
24
+ }
25
+ steps {
26
+ sh './test.sh'
27
+ junit 'spec/reports/*.xml, features/reports/*.xml'
28
+ }
29
+ }
30
+
31
+ stage('Test 2.4') {
32
+ environment {
33
+ RUBY_VERSION = '2.4'
34
+ }
35
+ steps {
36
+ sh './test.sh'
37
+ junit 'spec/reports/*.xml, features/reports/*.xml'
38
+ }
39
+ }
40
+
41
+ stage('Build deb') {
42
+ steps {
43
+ sh './build-deb.sh'
44
+ archiveArtifacts "tmp/deb/*"
45
+ }
46
+ }
47
+
48
+ stage('Publish deb') {
49
+ when {
50
+ branch 'master'
51
+ }
52
+
53
+ steps {
54
+ sh './publish.sh conjurtools stable'
55
+ }
56
+ }
57
+
58
+ // Only publish to RubyGems if branch is 'master'
59
+ // AND someone confirms this stage within 5 minutes
60
+ stage('Publish to RubyGems?') {
61
+ agent { label 'releaser-v2' }
62
+
63
+ when {
64
+ allOf {
65
+ branch 'v4'
66
+ expression {
67
+ boolean publish = false
68
+ try {
69
+ timeout(time: 5, unit: 'MINUTES') {
70
+ input(message: 'Publish to RubyGems?')
71
+ publish = true
72
+ }
73
+ } catch (final ignore) {
74
+ publish = false
75
+ }
76
+ return publish
77
+ }
78
+ }
79
+ }
80
+ steps {
81
+ sh './publish-rubygem.sh'
82
+ }
83
+ }
84
+ }
85
+
86
+ post {
87
+ always {
88
+ sh 'docker run -i --rm -v $PWD:/src -w /src alpine/git clean -fxd'
89
+ deleteDir()
90
+ }
91
+ failure {
92
+ slackSend(color: 'danger', message: "${env.JOB_NAME} #${env.BUILD_NUMBER} FAILURE (<${env.BUILD_URL}|Open>)")
93
+ }
94
+ unstable {
95
+ slackSend(color: 'warning', message: "${env.JOB_NAME} #${env.BUILD_NUMBER} UNSTABLE (<${env.BUILD_URL}|Open>)")
96
+ }
97
+ }
98
+ }
data/LICENSE.md ADDED
@@ -0,0 +1,195 @@
1
+ Apache License
2
+ ==============
3
+
4
+ _Version 2.0, January 2004_
5
+ _&lt;<http://www.apache.org/licenses/>&gt;_
6
+
7
+ ### Terms and Conditions for use, reproduction, and distribution
8
+
9
+ #### 1. Definitions
10
+
11
+ “License” shall mean the terms and conditions for use, reproduction, and
12
+ distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ “Licensor” shall mean the copyright owner or entity authorized by the copyright
15
+ owner that is granting the License.
16
+
17
+ “Legal Entity” shall mean the union of the acting entity and all other entities
18
+ that control, are controlled by, or are under common control with that entity.
19
+ For the purposes of this definition, “control” means **(i)** the power, direct or
20
+ indirect, to cause the direction or management of such entity, whether by
21
+ contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or **(iii)** beneficial ownership of such entity.
23
+
24
+ “You” (or “Your”) shall mean an individual or Legal Entity exercising
25
+ permissions granted by this License.
26
+
27
+ “Source” form shall mean the preferred form for making modifications, including
28
+ but not limited to software source code, documentation source, and configuration
29
+ files.
30
+
31
+ “Object” form shall mean any form resulting from mechanical transformation or
32
+ translation of a Source form, including but not limited to compiled object code,
33
+ generated documentation, and conversions to other media types.
34
+
35
+ “Work” shall mean the work of authorship, whether in Source or Object form, made
36
+ available under the License, as indicated by a copyright notice that is included
37
+ in or attached to the work (an example is provided in the Appendix below).
38
+
39
+ “Derivative Works” shall mean any work, whether in Source or Object form, that
40
+ is based on (or derived from) the Work and for which the editorial revisions,
41
+ annotations, elaborations, or other modifications represent, as a whole, an
42
+ original work of authorship. For the purposes of this License, Derivative Works
43
+ shall not include works that remain separable from, or merely link (or bind by
44
+ name) to the interfaces of, the Work and Derivative Works thereof.
45
+
46
+ “Contribution” shall mean any work of authorship, including the original version
47
+ of the Work and any modifications or additions to that Work or Derivative Works
48
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
49
+ by the copyright owner or by an individual or Legal Entity authorized to submit
50
+ on behalf of the copyright owner. For the purposes of this definition,
51
+ “submitted” means any form of electronic, verbal, or written communication sent
52
+ to the Licensor or its representatives, including but not limited to
53
+ communication on electronic mailing lists, source code control systems, and
54
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
55
+ the purpose of discussing and improving the Work, but excluding communication
56
+ that is conspicuously marked or otherwise designated in writing by the copyright
57
+ owner as “Not a Contribution.”
58
+
59
+ “Contributor” shall mean Licensor and any individual or Legal Entity on behalf
60
+ of whom a Contribution has been received by Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ #### 2. Grant of Copyright License
64
+
65
+ Subject to the terms and conditions of this License, each Contributor hereby
66
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
67
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
68
+ publicly display, publicly perform, sublicense, and distribute the Work and such
69
+ Derivative Works in Source or Object form.
70
+
71
+ #### 3. Grant of Patent License
72
+
73
+ Subject to the terms and conditions of this License, each Contributor hereby
74
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
75
+ irrevocable (except as stated in this section) patent license to make, have
76
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
77
+ such license applies only to those patent claims licensable by such Contributor
78
+ that are necessarily infringed by their Contribution(s) alone or by combination
79
+ of their Contribution(s) with the Work to which such Contribution(s) was
80
+ submitted. If You institute patent litigation against any entity (including a
81
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
82
+ Contribution incorporated within the Work constitutes direct or contributory
83
+ patent infringement, then any patent licenses granted to You under this License
84
+ for that Work shall terminate as of the date such litigation is filed.
85
+
86
+ #### 4. Redistribution
87
+
88
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
89
+ in any medium, with or without modifications, and in Source or Object form,
90
+ provided that You meet the following conditions:
91
+
92
+ * **(a)** You must give any other recipients of the Work or Derivative Works a copy of
93
+ this License; and
94
+ * **(b)** You must cause any modified files to carry prominent notices stating that You
95
+ changed the files; and
96
+ * **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
97
+ all copyright, patent, trademark, and attribution notices from the Source form
98
+ of the Work, excluding those notices that do not pertain to any part of the
99
+ Derivative Works; and
100
+ * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
101
+ Derivative Works that You distribute must include a readable copy of the
102
+ attribution notices contained within such NOTICE file, excluding those notices
103
+ that do not pertain to any part of the Derivative Works, in at least one of the
104
+ following places: within a NOTICE text file distributed as part of the
105
+ Derivative Works; within the Source form or documentation, if provided along
106
+ with the Derivative Works; or, within a display generated by the Derivative
107
+ Works, if and wherever such third-party notices normally appear. The contents of
108
+ the NOTICE file are for informational purposes only and do not modify the
109
+ License. You may add Your own attribution notices within Derivative Works that
110
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
111
+ provided that such additional attribution notices cannot be construed as
112
+ modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may provide
115
+ additional or different license terms and conditions for use, reproduction, or
116
+ distribution of Your modifications, or for any such Derivative Works as a whole,
117
+ provided Your use, reproduction, and distribution of the Work otherwise complies
118
+ with the conditions stated in this License.
119
+
120
+ #### 5. Submission of Contributions
121
+
122
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
123
+ for inclusion in the Work by You to the Licensor shall be under the terms and
124
+ conditions of this License, without any additional terms or conditions.
125
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
126
+ any separate license agreement you may have executed with Licensor regarding
127
+ such Contributions.
128
+
129
+ #### 6. Trademarks
130
+
131
+ This License does not grant permission to use the trade names, trademarks,
132
+ service marks, or product names of the Licensor, except as required for
133
+ reasonable and customary use in describing the origin of the Work and
134
+ reproducing the content of the NOTICE file.
135
+
136
+ #### 7. Disclaimer of Warranty
137
+
138
+ Unless required by applicable law or agreed to in writing, Licensor provides the
139
+ Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
141
+ including, without limitation, any warranties or conditions of TITLE,
142
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
143
+ solely responsible for determining the appropriateness of using or
144
+ redistributing the Work and assume any risks associated with Your exercise of
145
+ permissions under this License.
146
+
147
+ #### 8. Limitation of Liability
148
+
149
+ In no event and under no legal theory, whether in tort (including negligence),
150
+ contract, or otherwise, unless required by applicable law (such as deliberate
151
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
152
+ liable to You for damages, including any direct, indirect, special, incidental,
153
+ or consequential damages of any character arising as a result of this License or
154
+ out of the use or inability to use the Work (including but not limited to
155
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
156
+ any and all other commercial damages or losses), even if such Contributor has
157
+ been advised of the possibility of such damages.
158
+
159
+ #### 9. Accepting Warranty or Additional Liability
160
+
161
+ While redistributing the Work or Derivative Works thereof, You may choose to
162
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
163
+ other liability obligations and/or rights consistent with this License. However,
164
+ in accepting such obligations, You may act only on Your own behalf and on Your
165
+ sole responsibility, not on behalf of any other Contributor, and only if You
166
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
167
+ incurred by, or claims asserted against, such Contributor by reason of your
168
+ accepting any such warranty or additional liability.
169
+
170
+ _END OF TERMS AND CONDITIONS_
171
+
172
+ ### APPENDIX: How to apply the Apache License to your work
173
+
174
+ To apply the Apache License to your work, attach the following boilerplate
175
+ notice, with the fields enclosed by brackets `[]` replaced with your own
176
+ identifying information. (Don't include the brackets!) The text should be
177
+ enclosed in the appropriate comment syntax for the file format. We also
178
+ recommend that a file or class name and description of purpose be included on
179
+ the same “printed page” as the copyright notice for easier identification within
180
+ third-party archives.
181
+
182
+ Copyright [yyyy] [name of copyright owner]
183
+
184
+ Licensed under the Apache License, Version 2.0 (the "License");
185
+ you may not use this file except in compliance with the License.
186
+ You may obtain a copy of the License at
187
+
188
+ http://www.apache.org/licenses/LICENSE-2.0
189
+
190
+ Unless required by applicable law or agreed to in writing, software
191
+ distributed under the License is distributed on an "AS IS" BASIS,
192
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
+ See the License for the specific language governing permissions and
194
+ limitations under the License.
195
+
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Conjur
2
2
 
3
- Command-line interface to Conjur.
3
+ Command-line interface to Conjur.
4
4
 
5
5
  A complete reference guide is available at [developer.conjur.net](http://developer.conjur.net/reference).
6
6
 
7
+ Note that this `v4` branch is for Conjur 4.x. Use `master` for Conjur 5.x and later.
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
@@ -31,3 +33,19 @@ To enable bash completions, run this command:
31
33
  3. Commit your changes (`git commit -am 'Added some feature'`)
32
34
  4. Push to the branch (`git push origin my-new-feature`)
33
35
  5. Create new Pull Request
36
+
37
+ ## License
38
+
39
+ Copyright 2016-2017 CyberArk
40
+
41
+ Licensed under the Apache License, Version 2.0 (the "License");
42
+ you may not use this software except in compliance with the License.
43
+ You may obtain a copy of the License at
44
+
45
+ http://www.apache.org/licenses/LICENSE-2.0
46
+
47
+ Unless required by applicable law or agreed to in writing, software
48
+ distributed under the License is distributed on an "AS IS" BASIS,
49
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
+ See the License for the specific language governing permissions and
51
+ limitations under the License.
@@ -8,9 +8,8 @@ username, password = Conjur::Authn.get_credentials
8
8
  raise "Not logged in to Conjur" unless username && password
9
9
  puts "Performing acceptance tests as root-ish user '#{username}'"
10
10
 
11
- # Future Aruba
12
11
  Aruba.configure do |config|
13
- config.exit_timeout = 15
12
+ config.exit_timeout = 30
14
13
  config.io_wait_timeout = 2
15
14
  end
16
15
 
@@ -15,6 +15,7 @@ module ConjurCLIWorld
15
15
  end
16
16
 
17
17
  def save_password username, password
18
+ raise "Password for #{username} not found" if password.blank?
18
19
  raise "Found existing password for user '#{username}'" if passwords[username]
19
20
  passwords[username] = password
20
21
  end
@@ -34,8 +35,13 @@ module ConjurCLIWorld
34
35
  admin_api.current_role.role_id
35
36
  end
36
37
 
38
+ def random_hex nbytes = 12
39
+ @random ||= Random.new
40
+ @random.bytes(nbytes).unpack('h*').first
41
+ end
42
+
37
43
  def namespace
38
- @namespace ||= admin_api.create_variable("text/plain", "id").id
44
+ @namespace ||= random_hex
39
45
  end
40
46
 
41
47
  # Aruba's method
@@ -45,7 +51,7 @@ module ConjurCLIWorld
45
51
  end
46
52
 
47
53
  # Substitute the namespace for marker $ns
48
- def unescape(string)
54
+ def sanitize_text string
49
55
  string = super
50
56
  string.gsub("$ns", namespace)
51
57
  end