chef-vault 3.4.0.pre.pre419 → 3.4.0.pre.pre420

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. metadata +1 -45
  3. data/.github/CODEOWNERS +0 -2
  4. data/.gitignore +0 -33
  5. data/.rspec +0 -2
  6. data/.rubocop.yml +0 -6
  7. data/.simplecov +0 -6
  8. data/.travis.yml +0 -19
  9. data/Changelog.md +0 -141
  10. data/DEMO.md +0 -60
  11. data/Gemfile +0 -12
  12. data/KNIFE_EXAMPLES.md +0 -256
  13. data/README.md +0 -333
  14. data/Rakefile +0 -50
  15. data/THEORY.md +0 -363
  16. data/UPGRADE.md +0 -55
  17. data/appveyor.yml +0 -32
  18. data/chef-vault.gemspec +0 -54
  19. data/features/clean.feature +0 -23
  20. data/features/clean_on_refresh.feature +0 -27
  21. data/features/clean_unknown_clients.feature +0 -45
  22. data/features/detect_and_warn_v1_vault.feature +0 -14
  23. data/features/isvault.feature +0 -29
  24. data/features/itemtype.feature +0 -24
  25. data/features/step_definitions/chef-databag.rb +0 -9
  26. data/features/step_definitions/chef-repo.rb +0 -72
  27. data/features/step_definitions/chef-vault.rb +0 -151
  28. data/features/step_definitions/chef_databagitem.rb +0 -9
  29. data/features/support/env.rb +0 -14
  30. data/features/vault_create.feature +0 -63
  31. data/features/vault_list.feature +0 -31
  32. data/features/vault_show.feature +0 -45
  33. data/features/vault_show_vaultname.feature +0 -21
  34. data/features/vault_update.feature +0 -18
  35. data/features/verify_id_matches.feature +0 -10
  36. data/features/wrong_private_key.feature +0 -13
  37. data/hooks/pre-commit +0 -43
  38. data/spec/chef-vault/actor_spec.rb +0 -247
  39. data/spec/chef-vault/certificate_spec.rb +0 -37
  40. data/spec/chef-vault/chef_api_spec.rb +0 -39
  41. data/spec/chef-vault/item_keys_spec.rb +0 -263
  42. data/spec/chef-vault/item_spec.rb +0 -360
  43. data/spec/chef-vault/user_spec.rb +0 -36
  44. data/spec/chef-vault_spec.rb +0 -65
  45. data/spec/spec_helper.rb +0 -91
  46. data/tasks/github_changelog_generator.rb +0 -30
@@ -1,36 +0,0 @@
1
- RSpec.describe ChefVault::User do
2
- let(:item) { double(ChefVault::Item) }
3
- let(:user) { ChefVault::User.new("foo", "bar") }
4
-
5
- before do
6
- allow(ChefVault::Item).to receive(:load).with("foo", "bar") { item }
7
- allow(item).to receive(:[]).with("id") { "bar" }
8
- allow(item).to receive(:[]).with("password") { "baz" }
9
- end
10
-
11
- describe "#new" do
12
- it "loads item" do
13
- expect(ChefVault::Item).to receive(:load).with("foo", "bar")
14
-
15
- ChefVault::User.new("foo", "bar")
16
- end
17
- end
18
-
19
- describe "#[]" do
20
- it "returns the value of the 'id' parameter" do
21
- expect(user["id"]).to eq "bar"
22
- end
23
- end
24
-
25
- describe "decrypt_password" do
26
- it "echoes warning" do
27
- expect(ChefVault::Log).to receive(:warn).with("This method is deprecated, please switch to item['value'] calls")
28
- user.decrypt_password
29
- end
30
-
31
- it "returns items password" do
32
- expect(item).to receive(:[]).with("password")
33
- expect(user.decrypt_password).to eq "baz"
34
- end
35
- end
36
- end
@@ -1,65 +0,0 @@
1
- #
2
- # Helper for configuring the Chef Zero server
3
- # (inspired by ChefSpec)
4
- #
5
- def chef_zero
6
- require "socket"
7
- require "tmpdir"
8
- require "fileutils"
9
- require "chef_zero/server"
10
- # Find a free TCP port
11
- server = TCPServer.new("127.0.0.1", 0)
12
- port = server.addr[1].to_i
13
- server.close
14
- # Define a Chef Zero Server
15
- server = ChefZero::Server.new(port: port)
16
- # Write the private key
17
- tmp = Dir.mktmpdir
18
- key = File.join(tmp, "client.pem")
19
- File.write(key, ChefZero::PRIVATE_KEY)
20
- # Configure the server
21
- Chef::Config[:client_key] = key
22
- Chef::Config[:client_name] = "chefvault"
23
- Chef::Config[:node_name] = "chefvault"
24
- Chef::Config[:chef_server_url] = server.url
25
- # Exit handlers
26
- at_exit { FileUtils.rm_rf(tmp) }
27
- at_exit { server.stop if server.running? }
28
- server
29
- end
30
-
31
- RSpec.describe ChefVault do
32
- let(:vault) { ChefVault.new("foo") }
33
-
34
- describe "#new" do
35
- context "with only a vault parameter specified" do
36
-
37
- it "assigns 'foo' to the vault accessor" do
38
- expect(vault.vault).to eq "foo"
39
- end
40
- end
41
- end
42
-
43
- context "with a vault and config file parameter specified" do
44
- before do
45
- allow(IO).to receive(:read).with("knife.rb").and_return("node_name 'myserver'")
46
- end
47
-
48
- let(:vault) { ChefVault.new("foo", "knife.rb") }
49
-
50
- it "assigns 'foo' to the vault accessor" do
51
- expect(vault.vault).to eq "foo"
52
- end
53
-
54
- it "loads the Chef config values" do
55
- expect(ChefVault).to receive(:load_config).with("knife.rb")
56
- vault
57
- end
58
- end
59
-
60
- describe "#version" do
61
- it "the version method equals VERSION" do
62
- expect(vault.version).to eq(ChefVault::VERSION)
63
- end
64
- end
65
- end
@@ -1,91 +0,0 @@
1
- require "simplecov" if ENV["COVERAGE"]
2
- require_relative "../lib/chef-vault"
3
-
4
- # This file was generated by the `rspec --init` command. Conventionally, all
5
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
6
- # The generated `.rspec` file contains `--require spec_helper` which will cause this
7
- # file to always be loaded, without a need to explicitly require it in any files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need it.
15
- #
16
- # The `.rspec` file also contains a few flags that are not defaults but that
17
- # users commonly want.
18
- #
19
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
20
- RSpec.configure do |config|
21
- # rspec-expectations config goes here. You can use an alternate
22
- # assertion/expectation library such as wrong or the stdlib/minitest
23
- # assertions if you prefer.
24
- config.expect_with :rspec do |expectations|
25
- # This option will default to `true` in RSpec 4. It makes the `description`
26
- # and `failure_message` of custom matchers include text for helper methods
27
- # defined using `chain`, e.g.:
28
- # be_bigger_than(2).and_smaller_than(4).description
29
- # # => "be bigger than 2 and smaller than 4"
30
- # ...rather than:
31
- # # => "be bigger than 2"
32
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
33
- end
34
-
35
- # rspec-mocks config goes here. You can use an alternate test double
36
- # library (such as bogus or mocha) by changing the `mock_with` option here.
37
- config.mock_with :rspec do |mocks|
38
- # Prevents you from mocking or stubbing a method that does not exist on
39
- # a real object. This is generally recommended, and will default to
40
- # `true` in RSpec 4.
41
- mocks.verify_partial_doubles = true
42
- mocks.allow_message_expectations_on_nil = true
43
- end
44
-
45
- # The settings below are suggested to provide a good initial experience
46
- # with RSpec, but feel free to customize to your heart's content.
47
- # These two settings work together to allow you to limit a spec run
48
- # to individual examples or groups you care about by tagging them with
49
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
50
- # get run.
51
- config.filter_run :focus
52
- config.run_all_when_everything_filtered = true
53
-
54
- # Limits the available syntax to the non-monkey patched syntax that is recommended.
55
- # For more details, see:
56
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
57
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
58
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
59
- config.disable_monkey_patching!
60
-
61
- # This setting enables warnings. It's recommended, but in some cases may
62
- # be too noisy due to issues in dependencies.
63
- # config.warnings = true
64
-
65
- # Many RSpec users commonly either run the entire suite or an individual
66
- # file, and it's useful to allow more verbose output when running an
67
- # individual spec file.
68
- if config.files_to_run.one?
69
- # Use the documentation formatter for detailed output,
70
- # unless a formatter has already been configured
71
- # (e.g. via a command-line flag).
72
- config.default_formatter = "doc"
73
- end
74
-
75
- # Print the 10 slowest examples and example groups at the
76
- # end of the spec run, to help surface which specs are running
77
- # particularly slow.
78
- config.profile_examples = 10
79
-
80
- # Run specs in random order to surface order dependencies. If you find an
81
- # order dependency and want to debug it, you can fix the order by providing
82
- # the seed, which is printed after each run.
83
- # --seed 1234
84
- config.order = :random
85
-
86
- # Seed global randomization in this process using the `--seed` CLI option.
87
- # Setting this allows you to use `--seed` to deterministically reproduce
88
- # test failures related to randomization by passing the same `--seed` value
89
- # as the one that triggered the failure.
90
- Kernel.srand config.seed
91
- end
@@ -1,30 +0,0 @@
1
- #
2
- # Copyright:: Copyright (c) 2016 Chef Software Inc.
3
- # License:: Apache License, Version 2.0
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
- #
17
-
18
- require "chef-vault/version"
19
-
20
- begin
21
- require "github_changelog_generator/task"
22
-
23
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
24
- config.future_release = "v#{ChefVault::VERSION}"
25
- config.max_issues = 0
26
- config.add_issues_wo_labels = false
27
- end
28
- rescue LoadError
29
- puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs"
30
- end