conjur-cli 6.1.0 → 6.2.0

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
  SHA256:
3
- metadata.gz: 0533b1c7e9164260ba4a86d41004a71811d24b034230909cbcb6967cc8ac71e5
4
- data.tar.gz: 305ee4fc8b00b049b65eb7bd8742bd69d4bf41716c926291f21801b2139ce8f5
3
+ metadata.gz: f36460d10d570d5ff2a54a398d29306fe1219fafb7ba2840ae6ddf58c49371ba
4
+ data.tar.gz: ea60423bdea6801c241156bc4a286f198fdc1540aa3688b127ce5ead8e7c293b
5
5
  SHA512:
6
- metadata.gz: f4bdae507abdcb0032bb312bbdba75fb5e6f94bc5292cfe773ee2ca691951ca3fe3616018b54bd9993e2d1f45bcb7ce5c7d87f9884f1d16e0d73e4dc238bddb3
7
- data.tar.gz: 4a2d081ada6358818ec5b1607600e5b841e8d85bb3299da4fc9107a13bfc25700ebe72a1fbb3ac05b7b3dbf09834ec76b38df50def439292f958c5025bd4346a
6
+ metadata.gz: 5461e4818f8b51ec34099e488e58b37722e592b1238ab7ce275935710b25890fd4ba1cbe5a464b74e7fedafdbc21320ab4fa206871cfbad124473c74ed3c79a0
7
+ data.tar.gz: 6691b092ec9669c544234ac0f47449d915b0cbcae2562b5133b32378ea591c3987a716fa22daa8370b71e0e3988b9eda7a621f8062e9b32068f25c45acb05b31
@@ -1,11 +1,25 @@
1
- # 6.0.1
1
+ # 6.2.0
2
+
3
+ * Add `ldap-sync` subcommand.
4
+
5
+ # 6.1.1
6
+
7
+ * No longer displaying error stack traces by default when an exception occurs duing CLI
8
+ initialization (e.g when trying to open a missing conjur certificate file). Stack traces
9
+ can be enabled for all errors in the CLI by setting the environment variable `GLI_DEBUG=true`.
10
+
11
+ # [6.1.0](https://github.com/cyberark/conjur-cli/releases/tag/v6.1.0)
12
+
13
+ * Pin dependency 'conjur-api' to '~> 5.1'. This update adds authn-local support to the API. [conjur-api PR #131](https://github.com/cyberark/conjur-api-ruby/pull/131)
14
+
15
+ # [6.0.1](https://github.com/cyberark/conjur-cli/releases/tag/v6.0.1)
2
16
 
3
17
  * Pushes to `cyberark/conjur-cli:5` on DockerHub when tests pass
4
18
  * Use SNI when fetching certificate with `conjur init`.
5
19
  * Correctly specify dependency versions in gemspec.
6
20
  * Allow ActiveSupport v5 as a dependency.
7
21
 
8
- # 6.0.0
22
+ # [6.0.0](https://github.com/cyberark/conjur-cli/releases/tag/v6.0.0)
9
23
 
10
24
  * Provides compatibility with [cyberark/conjur](https://github.com/cyberark/conjur), Conjur 5 CE.
11
25
  * License changed to Apache 2.0.
@@ -14,196 +28,3 @@
14
28
 
15
29
  [v4-branch]: https://github.com/cyberark/conjur-cli/tree/v4
16
30
  [v4-changelog]: https://github.com/cyberark/conjur-cli/blob/v4/CHANGELOG.md
17
-
18
- # 5.3.0
19
-
20
- * Add `jobs` subcommands for `ldap-sync`.
21
- * Add `--detach` switch to `now` subcommand.
22
- * Relax dependency gem versions.
23
-
24
- # 5.2.5
25
-
26
- * Fix behavior of `conjur env` when [policy plugin](https://github.com/conjurinc/conjur-asset-policy) is installed.
27
-
28
- # 5.2.4
29
-
30
- * Fix behavior of `conjur env`, when detecting variables vs literals
31
-
32
- # 5.2.3
33
-
34
- * Disable prompts in bootstrap when there's no tty
35
- * Bump api-ruby, fixes 404 core bug
36
-
37
- # 5.2.1
38
-
39
- * Fix handling of `ldap-sync` dry-run argument.
40
-
41
- # 5.2.0
42
-
43
- * Add `ldap-sync` management commands (requires Conjur 4.7 or later).
44
- * Use `CONJUR_AUTHN_TOKEN` as the Conjur access token, if it's available in the environment.
45
- * `conjurize` will ignore `conjur` cookbook releases that don't have an associated tarball.
46
- * Pass `--recipe-url` argument to Chef, which is now required.
47
-
48
- # 5.1.2
49
-
50
- * Fix problem finding config files for plugin installation.
51
-
52
- # 5.1.1
53
-
54
- * Global CLI plugin config is now stored in `/opt/conjur/etc/plugins.yml`.
55
-
56
- # 5.0.0
57
-
58
- * **Breaking change** Ruby Policy DSL is now deprecated in favor of
59
- [new YML policy markup](https://developer.conjur.net/reference/policy-markup.html).
60
- The existing `policy` subcommand has been moved to the `rubydsl` subcommand.
61
- The new `policy` command operates on YML policies.
62
- * Created a new non-Omnibus Debian packaging of the Ruby gems.
63
-
64
- # 4.30.1
65
-
66
- * Fix the `conjur-api` gem dependency version
67
-
68
- # 4.30.0
69
-
70
- * Implementation of `conjur bootstrap` is moved to the API gem, and made extensible.
71
- * Added new steps to `conjur bootstrap`, including the creation of service identities, and giving `elevate` and `reveal` to the `security_admin` group.
72
- * `hostfactory create` verifies that the current role is able to admin the host factory group; otherwise, host factory creation will fail.
73
-
74
- # 4.29.0
75
- * Add `conjur host rotate_api_key` command.
76
- * Add `conjur version` (as well as `conjur server version`) command to show server version info.
77
- * Add `conjur server health` and `conjur server info` to display server health and info.
78
- * Add `conjur version` (as well as `conjur server version`) command to show server version info.
79
- * Add `conjur server health` and `conjur server info` to display server health and info.
80
- * Check server version compatibility if exception occurs and command has configured minimum version
81
- * Add `conjur layer retire` to allow retiring a layer.
82
- * Add `cidr` commands to `user`, `host`, and `hostfactory token`
83
- * Move `audit send` and `host factory` commands from plugins into the core CLI
84
- * Add `variable expire` and `variable expirations` subcommands. Variable expirations is available in version 4.6 of the Conjur server.
85
- * Add `--json` option to `conjurize` to print the Conjur configuration and host identity as a JSON file
86
- * Require `--layer` argument to `hostfactory create`, ensure that the owner is an admin of the layer.
87
-
88
- # 4.28.2
89
- * `--collection` is now optional (with no default) for both `conjur script execute` and `conjur policy load`.
90
-
91
- # 4.28.1
92
- * Add `--collection` option for `conjur script execute`. Scripts are now portable across environments, like policies.
93
-
94
- # 4.28.0
95
- * Add `conjur policy retire` to allow retiring a policy.
96
- * Fix `--as-group` and `--as-role` options for `conjur policy load`. Either can now be used to specify ownership of the policy.
97
- * Fix `--follow` option for `conjur audit`.
98
- * Remove support for per-project `.conjurrc` files.
99
-
100
- # 4.27.0
101
-
102
- * New commands `elevate` and `reveal` for execution of privileged commands on Conjur 4.5+.
103
-
104
- # 4.26.0
105
-
106
- * New implementation of bash completions.
107
-
108
- # 4.25.2
109
- * Fixes a conflict with RVM: Sets `GEM_HOME` and `GEM_PATH to nil.
110
-
111
- # 4.25.1
112
-
113
- * Remove spurious line written to stdout during user creation.
114
- * Fix up-front permission checking in `conjur bootstrap` so that it will run on a fresh server.
115
-
116
- # 4.25.0
117
-
118
- * A record can be retired to a specific role, in addition to the default behavior of retiring to the `attic` user.
119
- * Variable can be created with the id only, without becoming interactive.
120
- * Run `conjur variable create -i -a` to create interactively with annotations.
121
- * Interactive annotation can be performed on bare resources with `conjur resource annotate -i`.
122
- * Don't require 'admin' user to bootstrap, prompt to create a new security admin during bootstrap.
123
- * Check if user privileges are sufficient before running `retire`.
124
- * Don't revoke a user's access to a record in the middle of retire, because doing so leads to 403 errors later on.
125
- * Interactive mode of user, group and pubkey creation.
126
-
127
- # 4.24.0
128
-
129
- * Interactive mode for variable creation.
130
-
131
- # 4.23.0
132
-
133
- * Don't check if netrc is world-readable on Windows, since the answer is not reliable.
134
- * Use new [conjur](https://supermarket.chef.io/cookbooks/conjur) cookbook for conjurize.
135
- * Fix faulty initialization of plugins list, if it's nil, in the .conjurrc.
136
- * Log DSL commands to stderr, even if CONJURAPI_LOG is not explicitly configured.
137
- * In policy DSL, allow creation of records without an explicit `id`. In this case, the current scope is used as the `id`.
138
-
139
- # 4.22.0
140
-
141
- * New 'plugin' subcommand to manage CLI plugins.
142
- * Configure SSL certificate from Conjur.configuration.
143
- * Print the error message if there's a problem loading a plugin.
144
-
145
- # 4.21.1
146
-
147
- * Configure trust to the new certificate in `conjur init`, before attempting to contact the Conjur server.
148
-
149
- # 4.21.0
150
-
151
- * Use user cache dir for mimetype cache.
152
- * Retrieve the whole certificate chain on conjur init.
153
-
154
- # 4.20.1
155
-
156
- * Improve the error reporting.
157
-
158
- # 4.20.0
159
-
160
- * GID manipulation commands.
161
-
162
- # 4.19.0
163
-
164
- * Add command `conjur role graph` for batch retrieval of role relationships.
165
-
166
- # 4.18.5
167
-
168
- * Bump conjur-api version to mime-types problem
169
-
170
- # 4.18.4
171
-
172
- * Revert "Find (and store) credentials by only a hostname as the machine in netrc"
173
-
174
- # 4.18.3
175
-
176
- * Use the latest conjur-ssh cookbook version for conjurize
177
-
178
- # 4.18.2
179
-
180
- * Require a recent version of netrc
181
- * Complain if netrc is world readable
182
- * Find (and store) credentials by only a hostname as the machine in netrc
183
- * Make the command start up faster by lazy loading some gems
184
- * `authn whoami` will notice if the user is logged in via env vars
185
- * `conjurize` default conjur-ssh cookbook updated to 1.2.2
186
-
187
- # 4.18.0
188
-
189
- * New `conjurize` command
190
- * Deprecate the `host enroll` command
191
- * `variable create` command now takes an optional value for the variable after the variable id
192
- * Configure "permissive" netrc to allow the `conjur` Unix group to read the `.netrc` or `conjur.identity` file.
193
-
194
- # 4.17.0
195
-
196
- * Support --policy parameter in `conjur env`
197
- * Bugfix: failures on 'variable retire'
198
- * Raise a better error in case of missing config
199
-
200
- # 4.16.0
201
-
202
- * Add 'bootstrap' CLI command
203
- * Raise a better error if conjur env encounters a variable with no value
204
-
205
- # 4.15.0
206
-
207
- * Migration to rspec 3
208
- * Commands to retire(decommission) variable, host, user, group
209
- * Bugfix (in some situations `conjur init` logged config file location incorrectly)
@@ -54,32 +54,33 @@ pipeline {
54
54
 
55
55
  when {
56
56
  expression { currentBuild.resultIsBetterOrEqualTo('SUCCESS') }
57
- // expression {
58
- // def exitCode = sh returnStatus: true, script: ''' set +x
59
- // echo "Determining if publishing is requested..."
60
- //
61
- // VERSION=`cat lib/conjur/version.rb | grep \'VERSION\\s*=\' | sed -e "s/.*\'\\(.*\\)\'.*/\\1/"`
62
- // echo Declared version: $VERSION
63
- //
64
- // # Jenkins git plugin is broken and always fetches with `--no-tags`
65
- // # (or `--tags`, neither of which is what you want), so tags end up
66
- // # not being fetched. Try to fix that.
67
- // # (Unfortunately this fetches all remote heads, so we may have to find
68
- // # another solution for bigger repos.)
69
- // git fetch -q
70
- //
71
- // # note when tag not found git rev-parse will just print its name
72
- // # TAG=`git rev-parse tags/v$VERSION 2>/dev/null || :`
73
- // TAG=`git rev-list -n 1 "v$VERSION 2>/dev/null || :`
74
- // echo Tag v$VERSION: $TAG
75
- //
76
- // HEAD=`git rev-parse HEAD`
77
- // echo HEAD: $HEAD
78
- //
79
- // test "$HEAD" = "$TAG"
80
- // '''
81
- // return exitCode == 0
82
- // }
57
+ branch "master"
58
+ expression {
59
+ def exitCode = sh returnStatus: true, script: ''' set +x
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
+ '''
82
+ return exitCode == 0
83
+ }
83
84
  }
84
85
  steps {
85
86
  // Clean up first
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.1.0
1
+ 6.1.1
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.version = Conjur::VERSION
20
20
 
21
21
  gem.add_dependency 'activesupport', '>= 4.2', '< 6'
22
- gem.add_dependency 'conjur-api', '~> 5.1'
22
+ gem.add_dependency 'conjur-api', '~> 5.3'
23
23
  gem.add_dependency 'gli', '>=2.8.0'
24
24
  gem.add_dependency 'highline', '~> 1.7'
25
25
  gem.add_dependency 'netrc', '~> 0.10'
@@ -33,6 +33,12 @@ Feature: Checking permissions on a resource
33
33
  kind: job
34
34
  id: cook
35
35
 
36
+ - !grant
37
+ role: !role
38
+ kind: job
39
+ id: cook
40
+ member: !user admin
41
+
36
42
  - !permit
37
43
  role: !role
38
44
  kind: job
@@ -18,11 +18,18 @@ Feature: Test the existence of a resource
18
18
  Scenario: Even foreign user can check existence of a resource
19
19
  Given I load the policy:
20
20
  """
21
- - !resource
22
- kind: food
23
- id: bacon
21
+ - &resources
22
+ - !resource
23
+ kind: food
24
+ id: bacon
24
25
 
25
26
  - !user alice
27
+
28
+ - !permit
29
+ role: !user alice
30
+ privileges:
31
+ - read
32
+ resources: *resources
26
33
  """
27
34
  And I login as "alice"
28
35
  And I reset the command list
@@ -93,6 +93,9 @@ module Conjur
93
93
  apply_config
94
94
  load_plugins
95
95
  commands_from 'conjur/command'
96
+ rescue => ex
97
+ stderr.puts "error: #{ex.message}"
98
+ raise if ENV['GLI_DEBUG'] == 'true'
96
99
  end
97
100
 
98
101
  def appliance_version
@@ -0,0 +1,37 @@
1
+ require 'conjur/command'
2
+
3
+ class Conjur::Command::LDAPSync < Conjur::Command
4
+ desc 'LDAP sync management commands'
5
+ command :'ldap-sync' do |cgrp|
6
+
7
+ cgrp.desc 'Manage the policy used to sync Conjur and the LDAP server'
8
+ cgrp.command :policy do |policy|
9
+
10
+ policy.desc 'Show the current policy'
11
+ policy.command :show do |show|
12
+
13
+ show.desc 'LDAP Sync profile to use (defined in UI)'
14
+ show.arg_name 'profile'
15
+ show.flag ['p', 'profile'], default_value: 'default'
16
+
17
+ show.action do |_,options,_|
18
+ begin
19
+ resp = api.ldap_sync_policy(config_name: options[:profile])
20
+
21
+ if (policy = resp['policy'])
22
+ if resp['ok']
23
+ puts(policy)
24
+ else
25
+ exit_now! 'Failed creating the policy.'
26
+ end
27
+ else
28
+ exit_now! resp['error']['message']
29
+ end
30
+ rescue RestClient::ResourceNotFound => ex
31
+ exit_now! "LDAP sync is not supported by the server #{Conjur.configuration.appliance_url}"
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -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 = '6.1.0'
22
+ VERSION = '6.2.0'
23
23
  ::Version=VERSION
24
24
  end
@@ -1,35 +1,48 @@
1
1
  require 'spec_helper'
2
2
  require 'highline'
3
3
 
4
- GITHUB_FP = "SHA1 Fingerprint=D7:9F:07:61:10:B3:92:93:E3:49:AC:89:84:5B:03:80:C1:9E:2F:8B"
4
+ GITHUB_FP = "SHA1 Fingerprint=CA:06:F5:6B:25:8B:7A:0D:4F:2B:05:47:09:39:47:86:51:15:19:84"
5
5
  GITHUB_CERT = <<EOF
6
6
  -----BEGIN CERTIFICATE-----
7
- MIIEtjCCA56gAwIBAgIQDHmpRLCMEZUgkmFf4msdgzANBgkqhkiG9w0BAQsFADBs
7
+ MIIHQjCCBiqgAwIBAgIQCgYwQn9bvO1pVzllk7ZFHzANBgkqhkiG9w0BAQsFADB1
8
8
  MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
9
- d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
10
- ZSBFViBSb290IENBMB4XDTEzMTAyMjEyMDAwMFoXDTI4MTAyMjEyMDAwMFowdTEL
11
- MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
12
- LmRpZ2ljZXJ0LmNvbTE0MDIGA1UEAxMrRGlnaUNlcnQgU0hBMiBFeHRlbmRlZCBW
13
- YWxpZGF0aW9uIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
14
- ggEBANdTpARR+JmmFkhLZyeqk0nQOe0MsLAAh/FnKIaFjI5j2ry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
+ CqtS6BqQlmQ2jh7RhQAAAWNBYm3fAAAEAwBHMEUCIQChzdTKUU2N+XcqcK0OJYrN
39
+ 8EYynloVxho4yPk6Dq3EPgIgdNH5u8rC3UcslQV4B9o0a0w204omDREGKTVuEpxG
40
+ eOQwDQYJKoZIhvcNAQELBQADggEBAHAPWpanWOW/ip2oJ5grAH8mqQfaunuCVE+v
41
+ ac+88lkDK/LVdFgl2B6kIHZiYClzKtfczG93hWvKbST4NRNHP9LiaQqdNC17e5vN
42
+ HnXVUGw+yxyjMLGqkgepOnZ2Rb14kcTOGp4i5AuJuuaMwXmCo7jUwPwfLe1NUlVB
43
+ Kqg6LK0Hcq4K0sZnxE8HFxiZ92WpV2AVWjRMEc/2z2shNoDvxvFUYyY1Oe67xINk
44
+ myQKc+ygSBZzyLnXSFVWmHr3u5dcaaQGGAR42v6Ydr4iL38Hd4dOiBma+FXsXBIq
45
+ WUjbST4VXmdaol7uzFMojA4zkxQDZAvF5XgJlAFadfySna/teik=
33
46
  -----END CERTIFICATE-----
34
47
  EOF
35
48
 
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ describe Conjur::Command::LDAPSync, logged_in: true do
4
+ let (:policy_response) { { 'ok' => true, 'events' => [], 'policy' => <<eop
5
+ "---
6
+ - !user
7
+ annotations:
8
+ ldap-sync/source: ldap-server:389
9
+ ldap-sync/upstream-dn: CN=Administrator,OU=functest,OU=testdata,OU=dev-ci,DC=dev-ci,DC=conjur
10
+ id: Administrator
11
+ uidnumber:"}
12
+ eop
13
+ }
14
+ }
15
+
16
+ describe_command "ldap-sync policy show" do
17
+
18
+ context "on a server that supports LDAP sync" do
19
+ before do
20
+ expect_any_instance_of(Conjur::API).to receive(:ldap_sync_policy).with(config_name: 'default').and_return policy_response
21
+ end
22
+
23
+ it "shows the policy" do
24
+ expect { invoke }.to write policy_response['policy']
25
+ end
26
+ end
27
+
28
+ context "on a server that doesn't support LDAP sync" do
29
+ before do
30
+ expect_any_instance_of(Conjur::API).to receive(:ldap_sync_policy).and_raise(RestClient::ResourceNotFound)
31
+ end
32
+
33
+ it "shows an error message" do
34
+ expect {invoke}.to raise_error(GLI::CustomExit, /LDAP sync is not supported by the server/)
35
+ end
36
+ end
37
+ end
38
+ 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: 6.1.0
4
+ version: 6.2.0
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: 2018-04-06 00:00:00.000000000 Z
12
+ date: 2018-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.1'
40
+ version: '5.3'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.1'
47
+ version: '5.3'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: gli
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -372,6 +372,7 @@ files:
372
372
  - lib/conjur/command/host_factories.rb
373
373
  - lib/conjur/command/hosts.rb
374
374
  - lib/conjur/command/init.rb
375
+ - lib/conjur/command/ldap_sync.rb
375
376
  - lib/conjur/command/plugin.rb
376
377
  - lib/conjur/command/policies.rb
377
378
  - lib/conjur/command/pubkeys.rb
@@ -398,6 +399,7 @@ files:
398
399
  - spec/command/authn_spec.rb
399
400
  - spec/command/hosts_spec.rb
400
401
  - spec/command/init_spec.rb
402
+ - spec/command/ldap_sync_spec.rb
401
403
  - spec/command/pubkeys_spec.rb
402
404
  - spec/command/resources_spec.rb
403
405
  - spec/command/roles_spec.rb
@@ -471,6 +473,7 @@ test_files:
471
473
  - spec/command/authn_spec.rb
472
474
  - spec/command/hosts_spec.rb
473
475
  - spec/command/init_spec.rb
476
+ - spec/command/ldap_sync_spec.rb
474
477
  - spec/command/pubkeys_spec.rb
475
478
  - spec/command/resources_spec.rb
476
479
  - spec/command/roles_spec.rb